Skip to content

Commit

Permalink
chore: 0.30.0-rc.1 (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
rflechtner authored Nov 15, 2022
2 parents b3706d7 + 595f9fb commit 0e73c6a
Show file tree
Hide file tree
Showing 47 changed files with 1,038 additions and 719 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy API docs

on:
release:
types: [created]
types: [published]
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
'!utils/src/json-schema/*',
'!testing/**',
'!augment-api/**',
'!type-definitions/**',
'!**/*.chain.ts',
'!did/src/Did.chain.ts',
'!did/src/Did.rpc.ts',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
"typedoc": "^0.22.15",
"typescript": "^4.8.3"
},
"version": "0.29.0",
"version": "0.30.0-rc.1",
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion packages/augment-api/metadata/spiritnet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/augment-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kiltprotocol/augment-api",
"version": "0.29.0",
"version": "0.30.0-rc.1",
"description": "",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down
8 changes: 0 additions & 8 deletions packages/augment-api/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ declare module '@polkadot/api-base/types/consts' {
* request to leave the set of collator candidates.
**/
exitQueueDelay: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of collators a single delegator can delegate.
**/
maxCollatorsPerDelegator: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of delegations which can be made within the same
* round.
Expand Down Expand Up @@ -283,10 +279,6 @@ declare module '@polkadot/api-base/types/consts' {
* for a round.
**/
minCollatorStake: u128 & AugmentedConst<ApiType>;
/**
* Minimum stake required for any account to be able to delegate.
**/
minDelegation: u128 & AugmentedConst<ApiType>;
/**
* Minimum stake required for any account to become a delegator.
**/
Expand Down
17 changes: 13 additions & 4 deletions packages/augment-api/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,6 @@ declare module '@polkadot/api-base/types/errors' {
* Max unlocking requests reached.
**/
NoMoreUnstaking: AugmentedError<ApiType>;
/**
* The account has not staked enough funds to become a delegator.
**/
NomStakeBelowMin: AugmentedError<ApiType>;
/**
* The collator candidate wanted to execute the exit but has not
* requested to leave before by calling `init_leave_candidates`.
Expand All @@ -660,10 +656,19 @@ declare module '@polkadot/api-base/types/errors' {
* is not in the set of delegators.
**/
NotYetDelegating: AugmentedError<ApiType>;
/**
* Cannot claim rewards if empty.
**/
RewardsNotFound: AugmentedError<ApiType>;
/**
* Provided staked value is zero. Should never be thrown.
**/
StakeNotFound: AugmentedError<ApiType>;
/**
* The reward rate cannot be adjusted yet as an entire year has not
* passed.
**/
TooEarly: AugmentedError<ApiType>;
/**
* The set of collator candidates would fall below the required minimum
* if the collator left.
Expand Down Expand Up @@ -1091,6 +1096,10 @@ declare module '@polkadot/api-base/types/errors' {
* The specified owner does not own any names.
**/
OwnerNotFound: AugmentedError<ApiType>;
/**
* The origin was not authorized to perform that action
**/
Unauthorized: AugmentedError<ApiType>;
/**
* The specified name has already been previously banned.
**/
Expand Down
27 changes: 25 additions & 2 deletions packages/augment-api/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/
import type { BTreeMap, Bytes, Null, Option, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Weight } from '@polkadot/types/interfaces/runtime';
import type { AttestationAttestationsAttestationDetails, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, DelegationDelegationHierarchyDelegationHierarchyDetails, DelegationDelegationHierarchyDelegationNode, DidDidDetails, DidServiceEndpointsDidEndpoint, FrameSupportWeightsPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDidLookupConnectionRecord, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletWeb3NamesWeb3NameWeb3NameOwnership, ParachainStakingCandidate, ParachainStakingDelegationCounter, ParachainStakingDelegator, ParachainStakingInflationInflationInfo, ParachainStakingRoundInfo, ParachainStakingStake, ParachainStakingTotalStake, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RuntimeCommonAuthorizationAuthorizationId, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpTrieStorageProof, SpiritnetRuntimeSessionKeys } from '@polkadot/types/lookup';
import type { AttestationAttestationsAttestationDetails, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, DelegationDelegationHierarchyDelegationHierarchyDetails, DelegationDelegationHierarchyDelegationNode, DidDidDetails, DidServiceEndpointsDidEndpoint, FrameSupportWeightsPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDidLookupConnectionRecord, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletWeb3NamesWeb3NameWeb3NameOwnership, ParachainStakingCandidate, ParachainStakingDelegationCounter, ParachainStakingInflationInflationInfo, ParachainStakingRoundInfo, ParachainStakingStake, ParachainStakingTotalStake, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RuntimeCommonAuthorizationAuthorizationId, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpTrieStorageProof, SpiritnetRuntimeSessionKeys } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';

export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
Expand Down Expand Up @@ -301,6 +301,23 @@ declare module '@polkadot/api-base/types/storage' {
parachainId: AugmentedQuery<ApiType, () => Observable<u32>, []>;
};
parachainStaking: {
/**
* The number of authored blocks for collators. It is updated via the
* `note_author` hook when authoring a block .
**/
blocksAuthored: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u64>, [AccountId32]>;
/**
* The number of blocks for which rewards have been claimed by an address.
*
* For collators, this can be at most BlocksAuthored. It is updated when
* incrementing collator rewards, either when calling
* `inc_collator_rewards` or updating the `InflationInfo`.
*
* For delegators, this can be at most BlocksAuthored of the collator.It is
* updated when incrementing delegator rewards, either when calling
* `inc_delegator_rewards` or updating the `InflationInfo`.
**/
blocksRewarded: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u64>, [AccountId32]>;
/**
* The staking information for a candidate.
*
Expand All @@ -317,7 +334,7 @@ declare module '@polkadot/api-base/types/storage' {
*
* It maps from an account to its delegation details.
**/
delegatorState: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<ParachainStakingDelegator>>, [AccountId32]>;
delegatorState: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<ParachainStakingStake>>, [AccountId32]>;
forceNewRound: AugmentedQuery<ApiType, () => Observable<bool>, []>;
/**
* Inflation configuration.
Expand Down Expand Up @@ -347,6 +364,12 @@ declare module '@polkadot/api-base/types/storage' {
* The maximum number of collator candidates selected at each round.
**/
maxSelectedCandidates: AugmentedQuery<ApiType, () => Observable<u32>, []>;
/**
* The accumulated rewards for collator candidates and delegators.
*
* It maps from accounts to their total rewards since the last payout.
**/
rewards: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u128>, [AccountId32]>;
/**
* Current round number and next round scheduled transition.
**/
Expand Down
30 changes: 13 additions & 17 deletions packages/augment-api/src/interfaces/augment-api-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import '@polkadot/api-base/types/calls';

// FIXME: Error when using the autogenerated "from '@kiltprotocol/augment-api/extraDefs'"
import type { DidApiAccountId, RawDidLinkedInfo } from './extraDefs/index.js';
import type { DidApiAccountId, RawDidLinkedInfo, StakingRates } from './extraDefs/index.js';

import type { ApiTypes, AugmentedCall, DecoratedCallBase } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Text, Vec, u32 } from '@polkadot/types-codec';
Expand All @@ -18,7 +18,7 @@ import type { CollationInfo } from '@polkadot/types/interfaces/cumulus';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, AccountId32, Block, Header, Index, KeyTypeId, SlotDuration } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountId32, Balance, Block, Header, Index, KeyTypeId, SlotDuration } from '@polkadot/types/interfaces/runtime';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
Expand Down Expand Up @@ -103,21 +103,6 @@ declare module '@polkadot/api-base/types/calls' {
**/
queryByWeb3Name: AugmentedCall<ApiType, (name: Text | string) => Observable<Option<RawDidLinkedInfo>>>;
};
/** 0xa02708c798d60bce/1 */
didApi: {
/**
* Return the information relative to the owner of the provided DID, if present.
**/
queryDid: AugmentedCall<ApiType, (did: AccountId32 | string | Uint8Array) => Observable<Option<RawDidLinkedInfo>>>;
/**
* Return the information relative to the DID to which the provided account is linked, if any.
**/
queryDidByAccountId: AugmentedCall<ApiType, (account: DidApiAccountId | string | Uint8Array) => Observable<Option<RawDidLinkedInfo>>>;
/**
* Return the information relative to the owner of the provided web3name, if any.
**/
queryDidByW3n: AugmentedCall<ApiType, (name: Text | string) => Observable<Option<RawDidLinkedInfo>>>;
};
/** 0x37e397fc7c91f5e4/1 */
metadata: {
/**
Expand All @@ -143,6 +128,17 @@ declare module '@polkadot/api-base/types/calls' {
**/
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | Uint8Array | Bytes | string) => Observable<Bytes>>;
};
/** 0x45bfba51a310b223/1 */
staking: {
/**
* Calculate the current staking and reward rates for collators and delegators
**/
getStakingRates: AugmentedCall<ApiType, () => Observable<StakingRates>>;
/**
* Calculate the claimable staking rewards for a given account address
**/
getUnclaimedStakingRewards: AugmentedCall<ApiType, (account: AccountId32 | string | Uint8Array) => Observable<Balance>>;
};
/** 0xd2bc9897eed08f15/3 */
taggedTransactionQueue: {
/**
Expand Down
Loading

0 comments on commit 0e73c6a

Please sign in to comment.