Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade typescript API for runtime 2801 #2698

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/publish-typescript-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.sha }}
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.12
- name: Use Node.js
uses: actions/setup-node@v3
with:
Expand Down
603 changes: 391 additions & 212 deletions moonbeam-types-bundle/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion moonbeam-types-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"url": "git+https://github.com/moonbeam-foundation/moonbeam.git"
},
"dependencies": {
"@polkadot/api": "^10.11.2",
"@polkadot/api": "^10.12.1",
"typescript": "^4.7.4"
},
"devDependencies": {
Expand Down
649 changes: 424 additions & 225 deletions typescript-api/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions typescript-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/api-augment",
"version": "0.2800.0",
"version": "0.2801.0",
"type": "module",
"private": true,
"description": "Moonbeam types augment for @polkadot/api",
Expand Down Expand Up @@ -84,8 +84,8 @@
"api"
],
"devDependencies": {
"@polkadot/api": "^10.11.2",
"@polkadot/typegen": "^10.11.2",
"@polkadot/api": "^10.12.1",
"@polkadot/typegen": "^10.12.1",
"prettier": "^2.7.1",
"prettier-plugin-jsdoc": "^0.3.38",
"rimraf": "^3.0.2",
Expand Down
48 changes: 14 additions & 34 deletions typescript-api/src/moonbase/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ declare module "@polkadot/api-base/types/consts" {
/** Generic const */
[key: string]: Codec;
};
councilCollective: {
/** The maximum weight of a dispatch call that can be proposed and executed. */
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/** Generic const */
[key: string]: Codec;
};
crowdloanRewards: {
/** Percentage to be payed at initialization */
initializationPayment: Perbill & AugmentedConst<ApiType>;
Expand Down Expand Up @@ -193,28 +187,6 @@ declare module "@polkadot/api-base/types/consts" {
/** Generic const */
[key: string]: Codec;
};
localAssets: {
/** The amount of funds that must be reserved when creating a new approval. */
approvalDeposit: u128 & AugmentedConst<ApiType>;
/** The amount of funds that must be reserved for a non-provider asset account to be maintained. */
assetAccountDeposit: u128 & AugmentedConst<ApiType>;
/** The basic amount of funds that must be reserved for an asset. */
assetDeposit: u128 & AugmentedConst<ApiType>;
/** The basic amount of funds that must be reserved when adding metadata to your asset. */
metadataDepositBase: u128 & AugmentedConst<ApiType>;
/** The additional funds that must be reserved for the number of bytes you store in your metadata. */
metadataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call.
*
* Must be configured to result in a weight that makes each call fit in a block.
*/
removeItemsLimit: u32 & AugmentedConst<ApiType>;
/** The maximum length of a name or symbol stored on-chain. */
stringLimit: u32 & AugmentedConst<ApiType>;
/** Generic const */
[key: string]: Codec;
};
moonbeamOrbiters: {
/** Maximum number of orbiters per collator. */
maxPoolSize: u32 & AugmentedConst<ApiType>;
Expand Down Expand Up @@ -256,6 +228,8 @@ declare module "@polkadot/api-base/types/consts" {
[key: string]: Codec;
};
parachainStaking: {
/** Get the average time beetween 2 blocks in milliseconds */
blockTime: u64 & AugmentedConst<ApiType>;
/** Number of rounds candidate requests to decrease self-bond must wait to be executable */
candidateBondLessDelay: u32 & AugmentedConst<ApiType>;
/** Number of rounds that delegation less requests must wait before executable */
Expand Down Expand Up @@ -289,6 +263,8 @@ declare module "@polkadot/api-base/types/consts" {
revokeDelegationDelay: u32 & AugmentedConst<ApiType>;
/** Number of rounds after which block authors are rewarded */
rewardPaymentDelay: u32 & AugmentedConst<ApiType>;
/** Get the slot duration in milliseconds */
slotDuration: u64 & AugmentedConst<ApiType>;
/** Generic const */
[key: string]: Codec;
};
Expand Down Expand Up @@ -372,6 +348,16 @@ declare module "@polkadot/api-base/types/consts" {
/** Generic const */
[key: string]: Codec;
};
relayStorageRoots: {
/**
* Limit the number of relay storage roots that will be stored. This limit applies to the
* number of items, not to their age. Decreasing the value of `MaxStorageRoots` is a breaking
* change and needs a migration to clean the `RelayStorageRoots` mapping.
*/
maxStorageRoots: u32 & AugmentedConst<ApiType>;
/** Generic const */
[key: string]: Codec;
};
scheduler: {
/** The maximum weight that may be scheduled per block for any dispatchables. */
maximumWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
Expand Down Expand Up @@ -408,12 +394,6 @@ declare module "@polkadot/api-base/types/consts" {
/** Generic const */
[key: string]: Codec;
};
techCommitteeCollective: {
/** The maximum weight of a dispatch call that can be proposed and executed. */
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/** Generic const */
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks.
Expand Down
126 changes: 23 additions & 103 deletions typescript-api/src/moonbase/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,6 @@ declare module "@polkadot/api-base/types/errors" {
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
councilCollective: {
/** Members are already initialized! */
AlreadyInitialized: AugmentedError<ApiType>;
/** Duplicate proposals not allowed */
DuplicateProposal: AugmentedError<ApiType>;
/** Duplicate vote ignored */
DuplicateVote: AugmentedError<ApiType>;
/** Account is not a member */
NotMember: AugmentedError<ApiType>;
/** Prime account is not a member */
PrimeAccountNotMember: AugmentedError<ApiType>;
/** Proposal must exist */
ProposalMissing: AugmentedError<ApiType>;
/** The close call was made too early, before the end of the voting. */
TooEarly: AugmentedError<ApiType>;
/** There can only be a maximum of `MaxProposals` active proposals. */
TooManyProposals: AugmentedError<ApiType>;
/** Mismatched index */
WrongIndex: AugmentedError<ApiType>;
/** The given length bound for the proposal was too low. */
WrongProposalLength: AugmentedError<ApiType>;
/** The given weight bound for the proposal was too low. */
WrongProposalWeight: AugmentedError<ApiType>;
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
crowdloanRewards: {
/**
* User trying to associate a native identity with a relay chain identity for posterior reward
Expand Down Expand Up @@ -330,6 +304,8 @@ declare module "@polkadot/api-base/types/errors" {
InvalidNonce: AugmentedError<ApiType>;
/** The signature is invalid. */
InvalidSignature: AugmentedError<ApiType>;
/** Invalid Transaction */
InvalidTransaction: AugmentedError<ApiType>;
/** Calculating total payment overflowed */
PaymentOverflow: AugmentedError<ApiType>;
/** EVM reentrancy */
Expand Down Expand Up @@ -383,57 +359,6 @@ declare module "@polkadot/api-base/types/errors" {
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
localAssets: {
/** The asset-account already exists. */
AlreadyExists: AugmentedError<ApiType>;
/** The asset is not live, and likely being destroyed. */
AssetNotLive: AugmentedError<ApiType>;
/** Invalid metadata given. */
BadMetadata: AugmentedError<ApiType>;
/** Invalid witness data given. */
BadWitness: AugmentedError<ApiType>;
/** Account balance must be greater than or equal to the transfer amount. */
BalanceLow: AugmentedError<ApiType>;
/** Callback action resulted in error */
CallbackFailed: AugmentedError<ApiType>;
/** The origin account is frozen. */
Frozen: AugmentedError<ApiType>;
/** The asset status is not the expected status. */
IncorrectStatus: AugmentedError<ApiType>;
/** The asset ID is already taken. */
InUse: AugmentedError<ApiType>;
/**
* The asset is a live asset and is actively being used. Usually emit for operations such as
* `start_destroy` which require the asset to be in a destroying state.
*/
LiveAsset: AugmentedError<ApiType>;
/** Minimum balance should be non-zero. */
MinBalanceZero: AugmentedError<ApiType>;
/** The account to alter does not exist. */
NoAccount: AugmentedError<ApiType>;
/** The asset-account doesn't have an associated deposit. */
NoDeposit: AugmentedError<ApiType>;
/** The signing account has no permission to do the operation. */
NoPermission: AugmentedError<ApiType>;
/** The asset should be frozen before the given operation. */
NotFrozen: AugmentedError<ApiType>;
/** No approval exists that would allow the transfer. */
Unapproved: AugmentedError<ApiType>;
/**
* Unable to increment the consumer reference counters on the account. Either no provider
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or one fewer
* then the maximum number of consumers has been reached.
*/
UnavailableConsumer: AugmentedError<ApiType>;
/** The given asset ID is unknown. */
Unknown: AugmentedError<ApiType>;
/** The operation would result in funds being burned. */
WouldBurn: AugmentedError<ApiType>;
/** The source account would not survive the transfer and it needs to stay alive. */
WouldDie: AugmentedError<ApiType>;
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
maintenanceMode: {
/** The chain cannot enter maintenance mode because it is already in maintenance mode */
AlreadyInMaintenanceMode: AugmentedError<ApiType>;
Expand All @@ -454,6 +379,22 @@ declare module "@polkadot/api-base/types/errors" {
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
moonbeamLazyMigrations: {
/** There must be at least one address */
AddressesLengthCannotBeZero: AugmentedError<ApiType>;
/** There are no more VotingOf entries to be removed and democracy funds to be unlocked */
AllDemocracyFundsUnlocked: AugmentedError<ApiType>;
/** There are no more storage entries to be removed */
AllStorageEntriesHaveBeenRemoved: AugmentedError<ApiType>;
/** The contract is not corrupted (Still exist or properly suicided) */
ContractNotCorrupted: AugmentedError<ApiType>;
/** The limit cannot be zero */
LimitCannotBeZero: AugmentedError<ApiType>;
/** The limit for unlocking funds is too high */
UnlockLimitTooHigh: AugmentedError<ApiType>;
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
moonbeamOrbiters: {
/** The collator is already added in orbiters program. */
CollatorAlreadyAdded: AugmentedError<ApiType>;
Expand Down Expand Up @@ -666,6 +607,11 @@ declare module "@polkadot/api-base/types/errors" {
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
precompileBenchmarks: {
BenchmarkError: AugmentedError<ApiType>;
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
preimage: {
/** Preimage has already been noted on-chain. */
AlreadyNoted: AugmentedError<ApiType>;
Expand Down Expand Up @@ -792,32 +738,6 @@ declare module "@polkadot/api-base/types/errors" {
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
techCommitteeCollective: {
/** Members are already initialized! */
AlreadyInitialized: AugmentedError<ApiType>;
/** Duplicate proposals not allowed */
DuplicateProposal: AugmentedError<ApiType>;
/** Duplicate vote ignored */
DuplicateVote: AugmentedError<ApiType>;
/** Account is not a member */
NotMember: AugmentedError<ApiType>;
/** Prime account is not a member */
PrimeAccountNotMember: AugmentedError<ApiType>;
/** Proposal must exist */
ProposalMissing: AugmentedError<ApiType>;
/** The close call was made too early, before the end of the voting. */
TooEarly: AugmentedError<ApiType>;
/** There can only be a maximum of `MaxProposals` active proposals. */
TooManyProposals: AugmentedError<ApiType>;
/** Mismatched index */
WrongIndex: AugmentedError<ApiType>;
/** The given length bound for the proposal was too low. */
WrongProposalLength: AugmentedError<ApiType>;
/** The given weight bound for the proposal was too low. */
WrongProposalWeight: AugmentedError<ApiType>;
/** Generic error */
[key: string]: AugmentedError<ApiType>;
};
treasury: {
/** The payment has already been attempted. */
AlreadyAttempted: AugmentedError<ApiType>;
Expand Down
Loading
Loading