diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..11553716 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +name: pr + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Lint + run: | + yarn install + yarn lint + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Test + run: | + yarn install + yarn test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index dba77558..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,49 +0,0 @@ -# .gitlab-ci.yml -# -# txwrapper -# -# pipelines can be triggered manually in the web - -stages: - - test - -variables: - GIT_DEPTH: 3 - REGISTRY: "registry.parity.io/parity/infrastructure/scripts" - -.docker-env: &docker-env - image: ${REGISTRY}/parity-ci-docs:latest - before_script: - - bash --version - - yarn --version - only: - - master - - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - - schedules - - web - - /^[0-9]+$/ # PRs - dependencies: [] - interruptible: true - retry: - max: 2 - when: - - runner_system_failure - - unknown_failure - - api_failure - tags: - - linux-docker - -cache: - key: '${CI_JOB_NAME}' - paths: - - node_modules/ - -### stage: test - -linux-test: - stage: test - <<: *docker-env - script: - - yarn install - - yarn test - - yarn lint diff --git a/docs/globals.md b/docs/globals.md index 99c26b0d..0742ea14 100644 --- a/docs/globals.md +++ b/docs/globals.md @@ -14,10 +14,11 @@ * ["importPrivateKey"](modules/_importprivatekey_.md) * ["methods/balances/transfer"](modules/_methods_balances_transfer_.md) * ["methods/balances/transferKeepAlive"](modules/_methods_balances_transferkeepalive_.md) +* ["methods/democracy/activateProxy"](modules/_methods_democracy_activateproxy_.md) +* ["methods/democracy/closeProxy"](modules/_methods_democracy_closeproxy_.md) +* ["methods/democracy/deactivateProxy"](modules/_methods_democracy_deactivateproxy_.md) +* ["methods/democracy/openProxy"](modules/_methods_democracy_openproxy_.md) * ["methods/democracy/proxyVote"](modules/_methods_democracy_proxyvote_.md) -* ["methods/democracy/removeProxy"](modules/_methods_democracy_removeproxy_.md) -* ["methods/democracy/resignProxy"](modules/_methods_democracy_resignproxy_.md) -* ["methods/democracy/setProxy"](modules/_methods_democracy_setproxy_.md) * ["methods/democracy/types"](modules/_methods_democracy_types_.md) * ["methods/democracy/vote"](modules/_methods_democracy_vote_.md) * ["methods/session/setKeys"](modules/_methods_session_setkeys_.md) @@ -25,9 +26,14 @@ * ["methods/staking/bondExtra"](modules/_methods_staking_bondextra_.md) * ["methods/staking/chill"](modules/_methods_staking_chill_.md) * ["methods/staking/nominate"](modules/_methods_staking_nominate_.md) +* ["methods/staking/payoutNominator"](modules/_methods_staking_payoutnominator_.md) +* ["methods/staking/payoutValidator"](modules/_methods_staking_payoutvalidator_.md) +* ["methods/staking/setController"](modules/_methods_staking_setcontroller_.md) * ["methods/staking/unbond"](modules/_methods_staking_unbond_.md) * ["methods/staking/validate"](modules/_methods_staking_validate_.md) * ["methods/staking/withdrawUnbonded"](modules/_methods_staking_withdrawunbonded_.md) +* ["methods/vesting/vest"](modules/_methods_vesting_vest_.md) +* ["methods/vesting/vestOther"](modules/_methods_vesting_vestother_.md) * ["util/constants"](modules/_util_constants_.md) * ["util/registry"](modules/_util_registry_.md) * ["util/types"](modules/_util_types_.md) diff --git a/docs/interfaces/_methods_balances_transfer_.balancestransferargs.md b/docs/interfaces/_methods_balances_transfer_.balancestransferargs.md index 917e13cb..198c980e 100644 --- a/docs/interfaces/_methods_balances_transfer_.balancestransferargs.md +++ b/docs/interfaces/_methods_balances_transfer_.balancestransferargs.md @@ -21,7 +21,7 @@ • **dest**: *string* -*Defined in [src/methods/balances/transfer.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/balances/transfer.ts#L12)* +*Defined in [src/methods/balances/transfer.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/balances/transfer.ts#L12)* The recipient address, SS-58 encoded. @@ -31,6 +31,6 @@ ___ • **value**: *number* -*Defined in [src/methods/balances/transfer.ts:16](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/balances/transfer.ts#L16)* +*Defined in [src/methods/balances/transfer.ts:16](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/balances/transfer.ts#L16)* The amount to send. diff --git a/docs/interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md b/docs/interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md new file mode 100644 index 00000000..a1af30c8 --- /dev/null +++ b/docs/interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md @@ -0,0 +1,25 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/activateProxy"](../modules/_methods_democracy_activateproxy_.md) › [DemocracyActivateProxyArgs](_methods_democracy_activateproxy_.democracyactivateproxyargs.md) + +# Interface: DemocracyActivateProxyArgs + +## Hierarchy + +* object + + ↳ **DemocracyActivateProxyArgs** + +## Index + +### Properties + +* [proxy](_methods_democracy_activateproxy_.democracyactivateproxyargs.md#proxy) + +## Properties + +### proxy + +• **proxy**: *string* + +*Defined in [src/methods/democracy/activateProxy.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/activateProxy.ts#L12)* + +Address to set as proxy, SS-58 encoded. diff --git a/docs/interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md b/docs/interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md new file mode 100644 index 00000000..9b98f11a --- /dev/null +++ b/docs/interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md @@ -0,0 +1,25 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/deactivateProxy"](../modules/_methods_democracy_deactivateproxy_.md) › [DemocracyDeactivateProxyArgs](_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md) + +# Interface: DemocracyDeactivateProxyArgs + +## Hierarchy + +* object + + ↳ **DemocracyDeactivateProxyArgs** + +## Index + +### Properties + +* [proxy](_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md#proxy) + +## Properties + +### proxy + +• **proxy**: *string* + +*Defined in [src/methods/democracy/deactivateProxy.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/deactivateProxy.ts#L12)* + +The address of the proxy to remove, SS-58 encoded. diff --git a/docs/interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md b/docs/interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md new file mode 100644 index 00000000..45ad1eaf --- /dev/null +++ b/docs/interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md @@ -0,0 +1,25 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/openProxy"](../modules/_methods_democracy_openproxy_.md) › [DemocracyOpenProxyArgs](_methods_democracy_openproxy_.democracyopenproxyargs.md) + +# Interface: DemocracyOpenProxyArgs + +## Hierarchy + +* object + + ↳ **DemocracyOpenProxyArgs** + +## Index + +### Properties + +* [target](_methods_democracy_openproxy_.democracyopenproxyargs.md#target) + +## Properties + +### target + +• **target**: *string* + +*Defined in [src/methods/democracy/openProxy.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/openProxy.ts#L12)* + +The address of the proxy to remove, SS-58 encoded. diff --git a/docs/interfaces/_methods_democracy_proxyvote_.democracyproxyvoteargs.md b/docs/interfaces/_methods_democracy_proxyvote_.democracyproxyvoteargs.md index 620b3655..2044d5e4 100644 --- a/docs/interfaces/_methods_democracy_proxyvote_.democracyproxyvoteargs.md +++ b/docs/interfaces/_methods_democracy_proxyvote_.democracyproxyvoteargs.md @@ -21,7 +21,7 @@ • **refIndex**: *number* -*Defined in [src/methods/democracy/proxyVote.ts:13](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/proxyVote.ts#L13)* +*Defined in [src/methods/democracy/proxyVote.ts:13](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/proxyVote.ts#L13)* ___ @@ -29,6 +29,6 @@ ___ • **vote**: *[Vote](../modules/_methods_democracy_types_.md#vote)* -*Defined in [src/methods/democracy/proxyVote.ts:18](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/proxyVote.ts#L18)* +*Defined in [src/methods/democracy/proxyVote.ts:18](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/proxyVote.ts#L18)* Vote diff --git a/docs/interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md b/docs/interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md deleted file mode 100644 index 8cf0d872..00000000 --- a/docs/interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md +++ /dev/null @@ -1,25 +0,0 @@ -[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/removeProxy"](../modules/_methods_democracy_removeproxy_.md) › [DemocracyRemoveProxyArgs](_methods_democracy_removeproxy_.democracyremoveproxyargs.md) - -# Interface: DemocracyRemoveProxyArgs - -## Hierarchy - -* object - - ↳ **DemocracyRemoveProxyArgs** - -## Index - -### Properties - -* [proxy](_methods_democracy_removeproxy_.democracyremoveproxyargs.md#proxy) - -## Properties - -### proxy - -• **proxy**: *string* - -*Defined in [src/methods/democracy/removeProxy.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/removeProxy.ts#L12)* - -The address of the proxy to remove, SS-58 encoded. diff --git a/docs/interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md b/docs/interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md deleted file mode 100644 index 45773f8f..00000000 --- a/docs/interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md +++ /dev/null @@ -1,25 +0,0 @@ -[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/setProxy"](../modules/_methods_democracy_setproxy_.md) › [DemocracySetProxyArgs](_methods_democracy_setproxy_.democracysetproxyargs.md) - -# Interface: DemocracySetProxyArgs - -## Hierarchy - -* object - - ↳ **DemocracySetProxyArgs** - -## Index - -### Properties - -* [proxy](_methods_democracy_setproxy_.democracysetproxyargs.md#proxy) - -## Properties - -### proxy - -• **proxy**: *string* - -*Defined in [src/methods/democracy/setProxy.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/setProxy.ts#L12)* - -Address to set as proxy, SS-58 encoded. diff --git a/docs/interfaces/_methods_democracy_vote_.democracyvoteargs.md b/docs/interfaces/_methods_democracy_vote_.democracyvoteargs.md index 8f846d8e..74cb9cb3 100644 --- a/docs/interfaces/_methods_democracy_vote_.democracyvoteargs.md +++ b/docs/interfaces/_methods_democracy_vote_.democracyvoteargs.md @@ -21,7 +21,7 @@ • **refIndex**: *number* -*Defined in [src/methods/democracy/vote.ts:13](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/vote.ts#L13)* +*Defined in [src/methods/democracy/vote.ts:13](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/vote.ts#L13)* ___ @@ -29,6 +29,6 @@ ___ • **vote**: *[Vote](../modules/_methods_democracy_types_.md#vote)* -*Defined in [src/methods/democracy/vote.ts:18](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/vote.ts#L18)* +*Defined in [src/methods/democracy/vote.ts:18](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/vote.ts#L18)* Vote diff --git a/docs/interfaces/_methods_session_setkeys_.sessionsetkeysargs.md b/docs/interfaces/_methods_session_setkeys_.sessionsetkeysargs.md index 9d094b6c..985a8a36 100644 --- a/docs/interfaces/_methods_session_setkeys_.sessionsetkeysargs.md +++ b/docs/interfaces/_methods_session_setkeys_.sessionsetkeysargs.md @@ -21,7 +21,7 @@ • **keys**: *string[]* -*Defined in [src/methods/session/setKeys.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/session/setKeys.ts#L12)* +*Defined in [src/methods/session/setKeys.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/session/setKeys.ts#L12)* The 5 keys to set. @@ -31,6 +31,6 @@ ___ • **proof**? : *undefined | string* -*Defined in [src/methods/session/setKeys.ts:16](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/session/setKeys.ts#L16)* +*Defined in [src/methods/session/setKeys.ts:16](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/session/setKeys.ts#L16)* Proof (unused for now). diff --git a/docs/interfaces/_methods_staking_bond_.stakingbondargs.md b/docs/interfaces/_methods_staking_bond_.stakingbondargs.md index 927465c8..8e0885ea 100644 --- a/docs/interfaces/_methods_staking_bond_.stakingbondargs.md +++ b/docs/interfaces/_methods_staking_bond_.stakingbondargs.md @@ -22,7 +22,7 @@ • **controller**: *string* -*Defined in [src/methods/staking/bond.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bond.ts#L12)* +*Defined in [src/methods/staking/bond.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bond.ts#L12)* The SS-58 encoded address of the Controller account. @@ -32,7 +32,7 @@ ___ • **payee**: *string* -*Defined in [src/methods/staking/bond.ts:20](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bond.ts#L20)* +*Defined in [src/methods/staking/bond.ts:20](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bond.ts#L20)* The rewards destination. Can be "Stash", "Staked", or "Controller". @@ -42,6 +42,6 @@ ___ • **value**: *number* -*Defined in [src/methods/staking/bond.ts:16](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bond.ts#L16)* +*Defined in [src/methods/staking/bond.ts:16](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bond.ts#L16)* The number of tokens to bond. diff --git a/docs/interfaces/_methods_staking_bondextra_.stakingbondextraargs.md b/docs/interfaces/_methods_staking_bondextra_.stakingbondextraargs.md index de0b7728..bb10c8e8 100644 --- a/docs/interfaces/_methods_staking_bondextra_.stakingbondextraargs.md +++ b/docs/interfaces/_methods_staking_bondextra_.stakingbondextraargs.md @@ -20,6 +20,6 @@ • **maxAdditional**: *number* -*Defined in [src/methods/staking/bondExtra.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bondExtra.ts#L12)* +*Defined in [src/methods/staking/bondExtra.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bondExtra.ts#L12)* The maximum amount to bond. diff --git a/docs/interfaces/_methods_staking_nominate_.stakingnominateargs.md b/docs/interfaces/_methods_staking_nominate_.stakingnominateargs.md index 53b72fd6..28590f18 100644 --- a/docs/interfaces/_methods_staking_nominate_.stakingnominateargs.md +++ b/docs/interfaces/_methods_staking_nominate_.stakingnominateargs.md @@ -20,7 +20,7 @@ • **targets**: *Array‹string›* -*Defined in [src/methods/staking/nominate.ts:15](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/nominate.ts#L15)* +*Defined in [src/methods/staking/nominate.ts:15](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/nominate.ts#L15)* The SS-58 encoded addresses of the targets you wish to nominate. A maximum of 16 nominations are allowed. diff --git a/docs/interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md b/docs/interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md new file mode 100644 index 00000000..cb2d13fd --- /dev/null +++ b/docs/interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md @@ -0,0 +1,40 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/payoutNominator"](../modules/_methods_staking_payoutnominator_.md) › [StakingPayoutNominatorArgs](_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md) + +# Interface: StakingPayoutNominatorArgs + +## Hierarchy + +* object + + ↳ **StakingPayoutNominatorArgs** + +## Index + +### Properties + +* [era](_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md#era) +* [validators](_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md#validators) + +## Properties + +### era + +• **era**: *number* + +*Defined in [src/methods/staking/payoutNominator.ts:14](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/payoutNominator.ts#L14)* + +May not be lower than one following the most recently paid era. If it is +higher, then it indicates an instruction to skip the payout of all +previous eras. + +___ + +### validators + +• **validators**: *[string, number][]* + +*Defined in [src/methods/staking/payoutNominator.ts:20](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/payoutNominator.ts#L20)* + +List of all validators that `who` had exposure to during `era`. If it is +incomplete, then less than the full reward will be paid out. It must not +exceed `MAX_NOMINATIONS`. diff --git a/docs/interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md b/docs/interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md new file mode 100644 index 00000000..7449fe62 --- /dev/null +++ b/docs/interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md @@ -0,0 +1,27 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/payoutValidator"](../modules/_methods_staking_payoutvalidator_.md) › [StakingPayoutValidatorArgs](_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md) + +# Interface: StakingPayoutValidatorArgs + +## Hierarchy + +* object + + ↳ **StakingPayoutValidatorArgs** + +## Index + +### Properties + +* [era](_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md#era) + +## Properties + +### era + +• **era**: *number* + +*Defined in [src/methods/staking/payoutValidator.ts:14](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/payoutValidator.ts#L14)* + +May not be lower than one following the most recently paid era. If it is +higher, then it indicates an instruction to skip the payout of all +previous eras. diff --git a/docs/interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md b/docs/interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md new file mode 100644 index 00000000..a58b9103 --- /dev/null +++ b/docs/interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md @@ -0,0 +1,25 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/setController"](../modules/_methods_staking_setcontroller_.md) › [StakingSetControllerArgs](_methods_staking_setcontroller_.stakingsetcontrollerargs.md) + +# Interface: StakingSetControllerArgs + +## Hierarchy + +* object + + ↳ **StakingSetControllerArgs** + +## Index + +### Properties + +* [controller](_methods_staking_setcontroller_.stakingsetcontrollerargs.md#controller) + +## Properties + +### controller + +• **controller**: *string* + +*Defined in [src/methods/staking/setController.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/setController.ts#L12)* + +The SS-58 encoded controller address. diff --git a/docs/interfaces/_methods_staking_unbond_.stakingunbondargs.md b/docs/interfaces/_methods_staking_unbond_.stakingunbondargs.md index 3c4f9c33..b426cff0 100644 --- a/docs/interfaces/_methods_staking_unbond_.stakingunbondargs.md +++ b/docs/interfaces/_methods_staking_unbond_.stakingunbondargs.md @@ -20,6 +20,6 @@ • **value**: *number* -*Defined in [src/methods/staking/unbond.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/unbond.ts#L12)* +*Defined in [src/methods/staking/unbond.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/unbond.ts#L12)* The number of tokens to unbond. diff --git a/docs/interfaces/_methods_staking_validate_.stakingvalidateargs.md b/docs/interfaces/_methods_staking_validate_.stakingvalidateargs.md index 67d03d6b..a62fc035 100644 --- a/docs/interfaces/_methods_staking_validate_.stakingvalidateargs.md +++ b/docs/interfaces/_methods_staking_validate_.stakingvalidateargs.md @@ -20,7 +20,7 @@ • **prefs**: *object* -*Defined in [src/methods/staking/validate.ts:12](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/validate.ts#L12)* +*Defined in [src/methods/staking/validate.ts:12](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/validate.ts#L12)* Set the desired commission for the validator. Value is Perbill. diff --git a/docs/interfaces/_methods_vesting_vestother_.vestingvestotherargs.md b/docs/interfaces/_methods_vesting_vestother_.vestingvestotherargs.md new file mode 100644 index 00000000..559853a7 --- /dev/null +++ b/docs/interfaces/_methods_vesting_vestother_.vestingvestotherargs.md @@ -0,0 +1,26 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/vesting/vestOther"](../modules/_methods_vesting_vestother_.md) › [VestingVestOtherArgs](_methods_vesting_vestother_.vestingvestotherargs.md) + +# Interface: VestingVestOtherArgs + +## Hierarchy + +* object + + ↳ **VestingVestOtherArgs** + +## Index + +### Properties + +* [target](_methods_vesting_vestother_.vestingvestotherargs.md#target) + +## Properties + +### target + +• **target**: *string* + +*Defined in [src/methods/vesting/vestOther.ts:13](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/vesting/vestOther.ts#L13)* + +The account whose vested funds should be unlocked. Must have funds still +locked under this module. diff --git a/docs/interfaces/_util_types_.basetxinfo.md b/docs/interfaces/_util_types_.basetxinfo.md index 2a195120..9c3c12d9 100644 --- a/docs/interfaces/_util_types_.basetxinfo.md +++ b/docs/interfaces/_util_types_.basetxinfo.md @@ -28,7 +28,7 @@ JSON format for information that is common to all transactions. • **address**: *string* -*Defined in [src/util/types.ts:21](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L21)* +*Defined in [src/util/types.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L21)* The ss-58 encoded address of the sending account. @@ -38,7 +38,7 @@ ___ • **blockHash**: *string* -*Defined in [src/util/types.ts:25](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L25)* +*Defined in [src/util/types.ts:25](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L25)* The checkpoint hash of the block, in hex. @@ -48,7 +48,7 @@ ___ • **blockNumber**: *number* -*Defined in [src/util/types.ts:29](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L29)* +*Defined in [src/util/types.ts:29](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L29)* The checkpoint block number (u32), in hex. @@ -58,7 +58,7 @@ ___ • **genesisHash**: *string* -*Defined in [src/util/types.ts:33](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L33)* +*Defined in [src/util/types.ts:33](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L33)* The genesis hash of the chain, in hex. @@ -68,7 +68,7 @@ ___ • **metadataRpc**: *string* -*Defined in [src/util/types.ts:38](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L38)* +*Defined in [src/util/types.ts:38](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L38)* The SCALE-encoded metadata, as a hex string. Can be retrieved via the RPC call `state_getMetadata`. @@ -79,7 +79,7 @@ ___ • **nonce**: *number* -*Defined in [src/util/types.ts:42](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L42)* +*Defined in [src/util/types.ts:42](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L42)* The nonce for this transaction. @@ -89,7 +89,7 @@ ___ • **specVersion**: *number* -*Defined in [src/util/types.ts:46](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L46)* +*Defined in [src/util/types.ts:46](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L46)* The current spec version for the runtime. @@ -99,7 +99,7 @@ ___ • **tip**? : *undefined | number* -*Defined in [src/util/types.ts:52](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L52)* +*Defined in [src/util/types.ts:52](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L52)* The tip for this transaction, in hex. @@ -111,7 +111,7 @@ ___ • **validityPeriod**? : *undefined | number* -*Defined in [src/util/types.ts:59](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L59)* +*Defined in [src/util/types.ts:59](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L59)* The amount of time (in second) the transaction is valid for. Will be translated into a mortal era. Defaults to 5 minutes. diff --git a/docs/interfaces/_util_types_.unsignedtransaction.md b/docs/interfaces/_util_types_.unsignedtransaction.md index 5c4eb4a4..5bf5ff09 100644 --- a/docs/interfaces/_util_types_.unsignedtransaction.md +++ b/docs/interfaces/_util_types_.unsignedtransaction.md @@ -92,7 +92,7 @@ ___ • **metadataRpc**: *string* -*Defined in [src/util/types.ts:11](https://github.com/paritytech/txwrapper/blob/230d329/src/util/types.ts#L11)* +*Defined in [src/util/types.ts:11](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/types.ts#L11)* The SCALE-encoded metadata, as a hex string. Can be retrieved via the RPC call `state_getMetadata`. diff --git a/docs/modules/_createsignedtx_.md b/docs/modules/_createsignedtx_.md index 4b0727b8..0fca7280 100644 --- a/docs/modules/_createsignedtx_.md +++ b/docs/modules/_createsignedtx_.md @@ -14,7 +14,7 @@ ▸ **createSignedTx**(`unsigned`: [UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md), `signature`: string): *string* -*Defined in [src/createSignedTx.ts:14](https://github.com/paritytech/txwrapper/blob/230d329/src/createSignedTx.ts#L14)* +*Defined in [src/createSignedTx.ts:14](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/createSignedTx.ts#L14)* Serialize a signed transaction in a format that can be submitted over the Node RPC Interface from the signing payload and signature produced by the diff --git a/docs/modules/_createsigningpayload_.md b/docs/modules/_createsigningpayload_.md index 3b71ca57..58be903a 100644 --- a/docs/modules/_createsigningpayload_.md +++ b/docs/modules/_createsigningpayload_.md @@ -14,7 +14,7 @@ ▸ **createSigningPayload**(`unsigned`: [UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)): *string* -*Defined in [src/createSigningPayload.ts:11](https://github.com/paritytech/txwrapper/blob/230d329/src/createSigningPayload.ts#L11)* +*Defined in [src/createSigningPayload.ts:11](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/createSigningPayload.ts#L11)* Construct the signing payload from an unsigned transaction and export it to a remote signer (this is often called "detached signing"). diff --git a/docs/modules/_decode_decode_.md b/docs/modules/_decode_decode_.md index 78838a3d..24fe9deb 100644 --- a/docs/modules/_decode_decode_.md +++ b/docs/modules/_decode_decode_.md @@ -14,7 +14,7 @@ ▸ **decode**(`unsignedTx`: [UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md), `metadataRpc`: string, `ss58Format?`: undefined | number): *DecodedUnsignedTx* -*Defined in [src/decode/decode.ts:18](https://github.com/paritytech/txwrapper/blob/230d329/src/decode/decode.ts#L18)* +*Defined in [src/decode/decode.ts:18](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/decode/decode.ts#L18)* Parse the transaction information from a signing payload, an unsigned tx, or a signed tx. @@ -30,7 +30,7 @@ Name | Type | Description | ▸ **decode**(`signedTx`: string, `metadataRpc`: string, `ss58Format?`: undefined | number): *DecodedSignedTx* -*Defined in [src/decode/decode.ts:32](https://github.com/paritytech/txwrapper/blob/230d329/src/decode/decode.ts#L32)* +*Defined in [src/decode/decode.ts:32](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/decode/decode.ts#L32)* Parse the transaction information from a signing payload, an unsigned tx, or a signed tx. @@ -46,7 +46,7 @@ Name | Type | Description | ▸ **decode**(`signingPayload`: string, `metadataRpc`: string, `ss58Format?`: undefined | number): *DecodedSigningPayload* -*Defined in [src/decode/decode.ts:46](https://github.com/paritytech/txwrapper/blob/230d329/src/decode/decode.ts#L46)* +*Defined in [src/decode/decode.ts:46](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/decode/decode.ts#L46)* Parse the transaction information from a signing payload, an unsigned tx, or a signed tx. diff --git a/docs/modules/_deriveaddress_.md b/docs/modules/_deriveaddress_.md index 235eba39..d55372a2 100644 --- a/docs/modules/_deriveaddress_.md +++ b/docs/modules/_deriveaddress_.md @@ -14,7 +14,7 @@ ▸ **deriveAddress**(`publicKey`: string | Uint8Array, `ss58Format`: number): *string* -*Defined in [src/deriveAddress.ts:11](https://github.com/paritytech/txwrapper/blob/230d329/src/deriveAddress.ts#L11)* +*Defined in [src/deriveAddress.ts:11](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/deriveAddress.ts#L11)* Derive an address from a cryptographic public key offline. diff --git a/docs/modules/_gettxhash_.md b/docs/modules/_gettxhash_.md index 4bf97caf..d802e042 100644 --- a/docs/modules/_gettxhash_.md +++ b/docs/modules/_gettxhash_.md @@ -14,7 +14,7 @@ ▸ **getTxHash**(`signedTx`: string): *string* -*Defined in [src/getTxHash.ts:8](https://github.com/paritytech/txwrapper/blob/230d329/src/getTxHash.ts#L8)* +*Defined in [src/getTxHash.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/getTxHash.ts#L8)* Derive the tx hash of a signed transaction offline. diff --git a/docs/modules/_importprivatekey_.md b/docs/modules/_importprivatekey_.md index 7b7d5133..df5a5ca1 100644 --- a/docs/modules/_importprivatekey_.md +++ b/docs/modules/_importprivatekey_.md @@ -18,7 +18,7 @@ Ƭ **KeyringPair**: *KeyringPairBase* -*Defined in [src/importPrivateKey.ts:10](https://github.com/paritytech/txwrapper/blob/230d329/src/importPrivateKey.ts#L10)* +*Defined in [src/importPrivateKey.ts:10](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/importPrivateKey.ts#L10)* A keyring pair @@ -28,7 +28,7 @@ A keyring pair ▸ **importPrivateKey**(`privateKey`: string | Uint8Array, `ss58Format`: number): *KeyringPair* -*Defined in [src/importPrivateKey.ts:18](https://github.com/paritytech/txwrapper/blob/230d329/src/importPrivateKey.ts#L18)* +*Defined in [src/importPrivateKey.ts:18](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/importPrivateKey.ts#L18)* Import a private key and create a KeyringPair. diff --git a/docs/modules/_methods_balances_transfer_.md b/docs/modules/_methods_balances_transfer_.md index 744e55b2..eba913f6 100644 --- a/docs/modules/_methods_balances_transfer_.md +++ b/docs/modules/_methods_balances_transfer_.md @@ -18,7 +18,7 @@ ▸ **transfer**(`args`: [BalancesTransferArgs](../interfaces/_methods_balances_transfer_.balancestransferargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/balances/transfer.ts:24](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/balances/transfer.ts#L24)* +*Defined in [src/methods/balances/transfer.ts:24](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/balances/transfer.ts#L24)* Construct a balance transfer transaction offline. diff --git a/docs/modules/_methods_balances_transferkeepalive_.md b/docs/modules/_methods_balances_transferkeepalive_.md index aba6b548..55586fcd 100644 --- a/docs/modules/_methods_balances_transferkeepalive_.md +++ b/docs/modules/_methods_balances_transferkeepalive_.md @@ -18,7 +18,7 @@ Ƭ **BalancesTransferKeepAliveArgs**: *[BalancesTransferArgs](../interfaces/_methods_balances_transfer_.balancestransferargs.md)* -*Defined in [src/methods/balances/transferKeepAlive.ts:4](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/balances/transferKeepAlive.ts#L4)* +*Defined in [src/methods/balances/transferKeepAlive.ts:4](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/balances/transferKeepAlive.ts#L4)* ## Functions @@ -26,7 +26,7 @@ ▸ **transferKeepAlive**(`args`: [BalancesTransferKeepAliveArgs](_methods_balances_transferkeepalive_.md#balancestransferkeepaliveargs), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/balances/transferKeepAlive.ts:11](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/balances/transferKeepAlive.ts#L11)* +*Defined in [src/methods/balances/transferKeepAlive.ts:11](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/balances/transferKeepAlive.ts#L11)* Construct a balance transfer transaction offline. diff --git a/docs/modules/_methods_democracy_activateproxy_.md b/docs/modules/_methods_democracy_activateproxy_.md new file mode 100644 index 00000000..856ac554 --- /dev/null +++ b/docs/modules/_methods_democracy_activateproxy_.md @@ -0,0 +1,32 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/activateProxy"](_methods_democracy_activateproxy_.md) + +# External module: "methods/democracy/activateProxy" + +## Index + +### Interfaces + +* [DemocracyActivateProxyArgs](../interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md) + +### Functions + +* [activateProxy](_methods_democracy_activateproxy_.md#activateproxy) + +## Functions + +### activateProxy + +▸ **activateProxy**(`args`: [DemocracyActivateProxyArgs](../interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/democracy/activateProxy.ts:20](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/activateProxy.ts#L20)* + +Specify a proxy that is already open to us. Called by the stash. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [DemocracyActivateProxyArgs](../interfaces/_methods_democracy_activateproxy_.democracyactivateproxyargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_closeproxy_.md b/docs/modules/_methods_democracy_closeproxy_.md new file mode 100644 index 00000000..4ac9bf03 --- /dev/null +++ b/docs/modules/_methods_democracy_closeproxy_.md @@ -0,0 +1,28 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/closeProxy"](_methods_democracy_closeproxy_.md) + +# External module: "methods/democracy/closeProxy" + +## Index + +### Functions + +* [closeProxy](_methods_democracy_closeproxy_.md#closeproxy) + +## Functions + +### closeProxy + +▸ **closeProxy**(`args`: object, `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/democracy/closeProxy.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/closeProxy.ts#L8)* + +Clear the proxy. Called by the proxy. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | object | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_deactivateproxy_.md b/docs/modules/_methods_democracy_deactivateproxy_.md new file mode 100644 index 00000000..cf9f61e0 --- /dev/null +++ b/docs/modules/_methods_democracy_deactivateproxy_.md @@ -0,0 +1,33 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/deactivateProxy"](_methods_democracy_deactivateproxy_.md) + +# External module: "methods/democracy/deactivateProxy" + +## Index + +### Interfaces + +* [DemocracyDeactivateProxyArgs](../interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md) + +### Functions + +* [deactivateProxy](_methods_democracy_deactivateproxy_.md#deactivateproxy) + +## Functions + +### deactivateProxy + +▸ **deactivateProxy**(`args`: [DemocracyDeactivateProxyArgs](../interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/democracy/deactivateProxy.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/deactivateProxy.ts#L21)* + +Deactivate the proxy, but leave open to this account. Called by the stash. +The proxy must already be active. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [DemocracyDeactivateProxyArgs](../interfaces/_methods_democracy_deactivateproxy_.democracydeactivateproxyargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_openproxy_.md b/docs/modules/_methods_democracy_openproxy_.md new file mode 100644 index 00000000..587c552f --- /dev/null +++ b/docs/modules/_methods_democracy_openproxy_.md @@ -0,0 +1,32 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/openProxy"](_methods_democracy_openproxy_.md) + +# External module: "methods/democracy/openProxy" + +## Index + +### Interfaces + +* [DemocracyOpenProxyArgs](../interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md) + +### Functions + +* [openProxy](_methods_democracy_openproxy_.md#openproxy) + +## Functions + +### openProxy + +▸ **openProxy**(`args`: [DemocracyOpenProxyArgs](../interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/democracy/openProxy.ts:20](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/openProxy.ts#L20)* + +Become a proxy. This must be called prior to a later `activateProxy`. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [DemocracyOpenProxyArgs](../interfaces/_methods_democracy_openproxy_.democracyopenproxyargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_proxyvote_.md b/docs/modules/_methods_democracy_proxyvote_.md index f57dbdd3..f9723969 100644 --- a/docs/modules/_methods_democracy_proxyvote_.md +++ b/docs/modules/_methods_democracy_proxyvote_.md @@ -18,7 +18,7 @@ ▸ **proxyVote**(`args`: [DemocracyProxyVoteArgs](../interfaces/_methods_democracy_proxyvote_.democracyproxyvoteargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/democracy/proxyVote.ts:26](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/proxyVote.ts#L26)* +*Defined in [src/methods/democracy/proxyVote.ts:26](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/proxyVote.ts#L26)* Vote in a referendum on behalf of a stash. diff --git a/docs/modules/_methods_democracy_removeproxy_.md b/docs/modules/_methods_democracy_removeproxy_.md deleted file mode 100644 index 40d9fffc..00000000 --- a/docs/modules/_methods_democracy_removeproxy_.md +++ /dev/null @@ -1,32 +0,0 @@ -[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/removeProxy"](_methods_democracy_removeproxy_.md) - -# External module: "methods/democracy/removeProxy" - -## Index - -### Interfaces - -* [DemocracyRemoveProxyArgs](../interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md) - -### Functions - -* [removeProxy](_methods_democracy_removeproxy_.md#removeproxy) - -## Functions - -### removeProxy - -▸ **removeProxy**(`args`: [DemocracyRemoveProxyArgs](../interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* - -*Defined in [src/methods/democracy/removeProxy.ts:20](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/removeProxy.ts#L20)* - -Clear the proxy. Called by the stash. - -**Parameters:** - -Name | Type | Description | ------- | ------ | ------ | -`args` | [DemocracyRemoveProxyArgs](../interfaces/_methods_democracy_removeproxy_.democracyremoveproxyargs.md) | - | -`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | - -**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_resignproxy_.md b/docs/modules/_methods_democracy_resignproxy_.md deleted file mode 100644 index f23e8707..00000000 --- a/docs/modules/_methods_democracy_resignproxy_.md +++ /dev/null @@ -1,28 +0,0 @@ -[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/resignProxy"](_methods_democracy_resignproxy_.md) - -# External module: "methods/democracy/resignProxy" - -## Index - -### Functions - -* [resignProxy](_methods_democracy_resignproxy_.md#resignproxy) - -## Functions - -### resignProxy - -▸ **resignProxy**(`args`: object, `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* - -*Defined in [src/methods/democracy/resignProxy.ts:8](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/resignProxy.ts#L8)* - -Clear the proxy. Called by the proxy. - -**Parameters:** - -Name | Type | Description | ------- | ------ | ------ | -`args` | object | - | -`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | - -**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_setproxy_.md b/docs/modules/_methods_democracy_setproxy_.md deleted file mode 100644 index 49261008..00000000 --- a/docs/modules/_methods_democracy_setproxy_.md +++ /dev/null @@ -1,32 +0,0 @@ -[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/democracy/setProxy"](_methods_democracy_setproxy_.md) - -# External module: "methods/democracy/setProxy" - -## Index - -### Interfaces - -* [DemocracySetProxyArgs](../interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md) - -### Functions - -* [setProxy](_methods_democracy_setproxy_.md#setproxy) - -## Functions - -### setProxy - -▸ **setProxy**(`args`: [DemocracySetProxyArgs](../interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* - -*Defined in [src/methods/democracy/setProxy.ts:20](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/setProxy.ts#L20)* - -Specify a proxy. Called by the stash. - -**Parameters:** - -Name | Type | Description | ------- | ------ | ------ | -`args` | [DemocracySetProxyArgs](../interfaces/_methods_democracy_setproxy_.democracysetproxyargs.md) | - | -`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | - -**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_democracy_types_.md b/docs/modules/_methods_democracy_types_.md index 99e827fd..d9f5a7fe 100644 --- a/docs/modules/_methods_democracy_types_.md +++ b/docs/modules/_methods_democracy_types_.md @@ -14,7 +14,7 @@ Ƭ **Vote**: *object* -*Defined in [src/methods/democracy/types.ts:4](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/types.ts#L4)* +*Defined in [src/methods/democracy/types.ts:4](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/types.ts#L4)* A vote in a referendum diff --git a/docs/modules/_methods_democracy_vote_.md b/docs/modules/_methods_democracy_vote_.md index 1f12931e..8c689927 100644 --- a/docs/modules/_methods_democracy_vote_.md +++ b/docs/modules/_methods_democracy_vote_.md @@ -18,7 +18,7 @@ ▸ **vote**(`args`: [DemocracyVoteArgs](../interfaces/_methods_democracy_vote_.democracyvoteargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/democracy/vote.ts:26](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/democracy/vote.ts#L26)* +*Defined in [src/methods/democracy/vote.ts:26](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/democracy/vote.ts#L26)* Vote in a referendum. diff --git a/docs/modules/_methods_session_setkeys_.md b/docs/modules/_methods_session_setkeys_.md index b57946a2..aa3d14e8 100644 --- a/docs/modules/_methods_session_setkeys_.md +++ b/docs/modules/_methods_session_setkeys_.md @@ -18,7 +18,7 @@ ▸ **setKeys**(`args`: [SessionSetKeysArgs](../interfaces/_methods_session_setkeys_.sessionsetkeysargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/session/setKeys.ts:24](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/session/setKeys.ts#L24)* +*Defined in [src/methods/session/setKeys.ts:24](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/session/setKeys.ts#L24)* Sets the session key(s) of the function caller to `key`. diff --git a/docs/modules/_methods_staking_bond_.md b/docs/modules/_methods_staking_bond_.md index fe84fd80..a957d678 100644 --- a/docs/modules/_methods_staking_bond_.md +++ b/docs/modules/_methods_staking_bond_.md @@ -18,7 +18,7 @@ ▸ **bond**(`args`: [StakingBondArgs](../interfaces/_methods_staking_bond_.stakingbondargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/bond.ts:28](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bond.ts#L28)* +*Defined in [src/methods/staking/bond.ts:28](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bond.ts#L28)* Construct a transaction to bond funds and create a Stash account. diff --git a/docs/modules/_methods_staking_bondextra_.md b/docs/modules/_methods_staking_bondextra_.md index faa31473..85d545c2 100644 --- a/docs/modules/_methods_staking_bondextra_.md +++ b/docs/modules/_methods_staking_bondextra_.md @@ -18,7 +18,7 @@ ▸ **bondExtra**(`args`: [StakingBondExtraArgs](../interfaces/_methods_staking_bondextra_.stakingbondextraargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/bondExtra.ts:21](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/bondExtra.ts#L21)* +*Defined in [src/methods/staking/bondExtra.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/bondExtra.ts#L21)* Add some extra amount that have appeared in the stash `free_balance` into the balance up for staking. diff --git a/docs/modules/_methods_staking_chill_.md b/docs/modules/_methods_staking_chill_.md index d062b568..55a6b372 100644 --- a/docs/modules/_methods_staking_chill_.md +++ b/docs/modules/_methods_staking_chill_.md @@ -14,7 +14,7 @@ ▸ **chill**(`args`: object, `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/chill.ts:8](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/chill.ts#L8)* +*Defined in [src/methods/staking/chill.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/chill.ts#L8)* Declare the desire to cease validating or nominating. Does not unbond funds. diff --git a/docs/modules/_methods_staking_nominate_.md b/docs/modules/_methods_staking_nominate_.md index b5e62c93..9c631015 100644 --- a/docs/modules/_methods_staking_nominate_.md +++ b/docs/modules/_methods_staking_nominate_.md @@ -18,7 +18,7 @@ ▸ **nominate**(`args`: [StakingNominateArgs](../interfaces/_methods_staking_nominate_.stakingnominateargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/nominate.ts:23](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/nominate.ts#L23)* +*Defined in [src/methods/staking/nominate.ts:23](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/nominate.ts#L23)* Construct a transaction to nominate. This must be called by the _Controller_ account. diff --git a/docs/modules/_methods_staking_payoutnominator_.md b/docs/modules/_methods_staking_payoutnominator_.md new file mode 100644 index 00000000..04fc332d --- /dev/null +++ b/docs/modules/_methods_staking_payoutnominator_.md @@ -0,0 +1,35 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/payoutNominator"](_methods_staking_payoutnominator_.md) + +# External module: "methods/staking/payoutNominator" + +## Index + +### Interfaces + +* [StakingPayoutNominatorArgs](../interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md) + +### Functions + +* [payoutNominator](_methods_staking_payoutnominator_.md#payoutnominator) + +## Functions + +### payoutNominator + +▸ **payoutNominator**(`args`: [StakingPayoutNominatorArgs](../interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/staking/payoutNominator.ts:31](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/payoutNominator.ts#L31)* + +Make one nominator's payout for one era. +WARNING: once an era is payed for a validator such validator can't claim the +payout of previous era. +WARNING: Incorrect arguments here can result in loss of payout. Be very careful. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [StakingPayoutNominatorArgs](../interfaces/_methods_staking_payoutnominator_.stakingpayoutnominatorargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_staking_payoutvalidator_.md b/docs/modules/_methods_staking_payoutvalidator_.md new file mode 100644 index 00000000..c9d54973 --- /dev/null +++ b/docs/modules/_methods_staking_payoutvalidator_.md @@ -0,0 +1,35 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/payoutValidator"](_methods_staking_payoutvalidator_.md) + +# External module: "methods/staking/payoutValidator" + +## Index + +### Interfaces + +* [StakingPayoutValidatorArgs](../interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md) + +### Functions + +* [payoutValidator](_methods_staking_payoutvalidator_.md#payoutvalidator) + +## Functions + +### payoutValidator + +▸ **payoutValidator**(`args`: [StakingPayoutValidatorArgs](../interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/staking/payoutValidator.ts:25](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/payoutValidator.ts#L25)* + +Make one validator's payout for one era. +WARNING: once an era is payed for a validator such validator can't claim the +payout of previous era. +WARNING: Incorrect arguments here can result in loss of payout. Be very careful. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [StakingPayoutValidatorArgs](../interfaces/_methods_staking_payoutvalidator_.stakingpayoutvalidatorargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_staking_setcontroller_.md b/docs/modules/_methods_staking_setcontroller_.md new file mode 100644 index 00000000..83360416 --- /dev/null +++ b/docs/modules/_methods_staking_setcontroller_.md @@ -0,0 +1,33 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/staking/setController"](_methods_staking_setcontroller_.md) + +# External module: "methods/staking/setController" + +## Index + +### Interfaces + +* [StakingSetControllerArgs](../interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md) + +### Functions + +* [setController](_methods_staking_setcontroller_.md#setcontroller) + +## Functions + +### setController + +▸ **setController**(`args`: [StakingSetControllerArgs](../interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/staking/setController.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/setController.ts#L21)* + +(Re-)set the controller of a stash. Effects will be felt at the beginning of +the next era. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [StakingSetControllerArgs](../interfaces/_methods_staking_setcontroller_.stakingsetcontrollerargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_staking_unbond_.md b/docs/modules/_methods_staking_unbond_.md index bf036c6e..e8c0a7bd 100644 --- a/docs/modules/_methods_staking_unbond_.md +++ b/docs/modules/_methods_staking_unbond_.md @@ -18,7 +18,7 @@ ▸ **unbond**(`args`: [StakingUnbondArgs](../interfaces/_methods_staking_unbond_.stakingunbondargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/unbond.ts:21](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/unbond.ts#L21)* +*Defined in [src/methods/staking/unbond.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/unbond.ts#L21)* Construct a transaction to unbond funds from a Stash account. This must be called by the _Controller_ account. diff --git a/docs/modules/_methods_staking_validate_.md b/docs/modules/_methods_staking_validate_.md index faf7f385..4e73254b 100644 --- a/docs/modules/_methods_staking_validate_.md +++ b/docs/modules/_methods_staking_validate_.md @@ -18,7 +18,7 @@ ▸ **validate**(`args`: [StakingValidateArgs](../interfaces/_methods_staking_validate_.stakingvalidateargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/validate.ts:22](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/validate.ts#L22)* +*Defined in [src/methods/staking/validate.ts:22](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/validate.ts#L22)* Declare the desire to validate for the origin controller. diff --git a/docs/modules/_methods_staking_withdrawunbonded_.md b/docs/modules/_methods_staking_withdrawunbonded_.md index cf1c1a8d..87fc28df 100644 --- a/docs/modules/_methods_staking_withdrawunbonded_.md +++ b/docs/modules/_methods_staking_withdrawunbonded_.md @@ -14,7 +14,7 @@ ▸ **withdrawUnbonded**(`args`: object, `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* -*Defined in [src/methods/staking/withdrawUnbonded.ts:8](https://github.com/paritytech/txwrapper/blob/230d329/src/methods/staking/withdrawUnbonded.ts#L8)* +*Defined in [src/methods/staking/withdrawUnbonded.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/staking/withdrawUnbonded.ts#L8)* Remove any unlocked chunks from the `unlocking` queue from our management. diff --git a/docs/modules/_methods_vesting_vest_.md b/docs/modules/_methods_vesting_vest_.md new file mode 100644 index 00000000..d0987246 --- /dev/null +++ b/docs/modules/_methods_vesting_vest_.md @@ -0,0 +1,28 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/vesting/vest"](_methods_vesting_vest_.md) + +# External module: "methods/vesting/vest" + +## Index + +### Functions + +* [vest](_methods_vesting_vest_.md#vest) + +## Functions + +### vest + +▸ **vest**(`args`: object, `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/vesting/vest.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/vesting/vest.ts#L8)* + +Unlock any vested funds of the sender account. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | object | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_methods_vesting_vestother_.md b/docs/modules/_methods_vesting_vestother_.md new file mode 100644 index 00000000..98a5ecc4 --- /dev/null +++ b/docs/modules/_methods_vesting_vestother_.md @@ -0,0 +1,32 @@ +[@substrate/txwrapper](../README.md) › [Globals](../globals.md) › ["methods/vesting/vestOther"](_methods_vesting_vestother_.md) + +# External module: "methods/vesting/vestOther" + +## Index + +### Interfaces + +* [VestingVestOtherArgs](../interfaces/_methods_vesting_vestother_.vestingvestotherargs.md) + +### Functions + +* [vestOther](_methods_vesting_vestother_.md#vestother) + +## Functions + +### vestOther + +▸ **vestOther**(`args`: [VestingVestOtherArgs](../interfaces/_methods_vesting_vestother_.vestingvestotherargs.md), `info`: [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md)): *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* + +*Defined in [src/methods/vesting/vestOther.ts:21](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/methods/vesting/vestOther.ts#L21)* + +Unlock any vested funds of a `target` account. + +**Parameters:** + +Name | Type | Description | +------ | ------ | ------ | +`args` | [VestingVestOtherArgs](../interfaces/_methods_vesting_vestother_.vestingvestotherargs.md) | - | +`info` | [BaseTxInfo](../interfaces/_util_types_.basetxinfo.md) | Information required to construct the transaction. | + +**Returns:** *[UnsignedTransaction](../interfaces/_util_types_.unsignedtransaction.md)* diff --git a/docs/modules/_util_constants_.md b/docs/modules/_util_constants_.md index 17792d92..22b09007 100644 --- a/docs/modules/_util_constants_.md +++ b/docs/modules/_util_constants_.md @@ -16,7 +16,7 @@ • **EXTRINSIC_VERSION**: *4* = 4 -*Defined in [src/util/constants.ts:13](https://github.com/paritytech/txwrapper/blob/230d329/src/util/constants.ts#L13)* +*Defined in [src/util/constants.ts:13](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/constants.ts#L13)* Latest extrinsic version. @@ -26,7 +26,7 @@ ___ • **KUSAMA_SS58_FORMAT**: *2* = 2 -*Defined in [src/util/constants.ts:4](https://github.com/paritytech/txwrapper/blob/230d329/src/util/constants.ts#L4)* +*Defined in [src/util/constants.ts:4](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/constants.ts#L4)* Prefix for SS58-encoded addresses on Kusama. @@ -36,6 +36,6 @@ ___ • **POLKADOT_SS58_FORMAT**: *0* = 0 -*Defined in [src/util/constants.ts:8](https://github.com/paritytech/txwrapper/blob/230d329/src/util/constants.ts#L8)* +*Defined in [src/util/constants.ts:8](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/constants.ts#L8)* Prefix for SS58-encoded addresses on Polkadot. diff --git a/docs/modules/_util_registry_.md b/docs/modules/_util_registry_.md index 1bc02ae1..d9e1ae4d 100644 --- a/docs/modules/_util_registry_.md +++ b/docs/modules/_util_registry_.md @@ -14,7 +14,7 @@ ▸ **getRegistry**(`specName`: "kusama", `specVersion`: number): *TypeRegistry* -*Defined in [src/util/registry.ts:13](https://github.com/paritytech/txwrapper/blob/230d329/src/util/registry.ts#L13)* +*Defined in [src/util/registry.ts:13](https://github.com/paritytech/txwrapper/blob/a7b5a55/src/util/registry.ts#L13)* Create a specific TypeRegistry for a current chain. The reason we have this is, depending on different runtime versions, we have different types (e.g.: diff --git a/package.json b/package.json index 4253286b..44c8707f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test": "jest" }, "dependencies": { - "@polkadot/api": "^1.4.1" + "@polkadot/api": "^1.5.1" }, "devDependencies": { "@amaurymartiny/config": "^1.0.10", diff --git a/src/decode/decodeSignedTx.spec.ts b/src/decode/decodeSignedTx.spec.ts index 575df443..1918b9ec 100644 --- a/src/decode/decodeSignedTx.spec.ts +++ b/src/decode/decodeSignedTx.spec.ts @@ -2,6 +2,7 @@ import { createSignedTx } from '../createSignedTx'; import { createSigningPayload } from '../createSigningPayload'; import * as methods from '../methods'; import { + getAllMethods, KUSAMA_SS58_FORMAT, metadataRpc, signWithAlice, @@ -50,20 +51,5 @@ function testDecodeSignedTx(pallet: string, name: string): void { } describe('decodeSignedTx', () => { - testDecodeSignedTx('balances', 'transfer'); - testDecodeSignedTx('balances', 'transferKeepAlive'); - testDecodeSignedTx('democracy', 'removeProxy'); - testDecodeSignedTx('democracy', 'resignProxy'); - testDecodeSignedTx('democracy', 'setProxy'); - // Skipping until Vote has correct JSON serialization in polkadot-api. - // testDecodeSignedTx('democracy', 'proxyVote'); - // testDecodeSignedTx('democracy', 'vote'); - testDecodeSignedTx('session', 'setKeys'); - testDecodeSignedTx('staking', 'bond'); - testDecodeSignedTx('staking', 'bondExtra'); - testDecodeSignedTx('staking', 'chill'); - testDecodeSignedTx('staking', 'nominate'); - testDecodeSignedTx('staking', 'unbond'); - testDecodeSignedTx('staking', 'validate'); - testDecodeSignedTx('staking', 'withdrawUnbonded'); + getAllMethods().forEach(method => testDecodeSignedTx(...method)); }); diff --git a/src/decode/decodeSigningPayload.spec.ts b/src/decode/decodeSigningPayload.spec.ts index bf395deb..6ca742f4 100644 --- a/src/decode/decodeSigningPayload.spec.ts +++ b/src/decode/decodeSigningPayload.spec.ts @@ -1,6 +1,7 @@ import { createSigningPayload } from '../createSigningPayload'; import * as methods from '../methods'; import { + getAllMethods, KUSAMA_SS58_FORMAT, metadataRpc, TEST_BASE_TX_INFO, @@ -52,20 +53,5 @@ function testDecodeSigningPayload(pallet: string, name: string): void { } describe('decodeSigningPayload', () => { - testDecodeSigningPayload('balances', 'transfer'); - testDecodeSigningPayload('balances', 'transferKeepAlive'); - testDecodeSigningPayload('democracy', 'removeProxy'); - testDecodeSigningPayload('democracy', 'resignProxy'); - testDecodeSigningPayload('democracy', 'setProxy'); - // Skipping until Vote has correct JSON serialization in polkadot-api. - // testDecodeSigningPayload('democracy', 'proxyVote'); - // testDecodeSigningPayload('democracy', 'vote'); - testDecodeSigningPayload('session', 'setKeys'); - testDecodeSigningPayload('staking', 'bond'); - testDecodeSigningPayload('staking', 'bondExtra'); - testDecodeSigningPayload('staking', 'chill'); - testDecodeSigningPayload('staking', 'nominate'); - testDecodeSigningPayload('staking', 'unbond'); - testDecodeSigningPayload('staking', 'validate'); - testDecodeSigningPayload('staking', 'withdrawUnbonded'); + getAllMethods().forEach(method => testDecodeSigningPayload(...method)); }); diff --git a/src/decode/decodeUnsignedTx.spec.ts b/src/decode/decodeUnsignedTx.spec.ts index f65f43e6..57a99c85 100644 --- a/src/decode/decodeUnsignedTx.spec.ts +++ b/src/decode/decodeUnsignedTx.spec.ts @@ -1,5 +1,6 @@ import * as methods from '../methods'; import { + getAllMethods, KUSAMA_SS58_FORMAT, metadataRpc, TEST_BASE_TX_INFO, @@ -49,20 +50,5 @@ function testDecodeUnsignedTx(pallet: string, name: string): void { } describe('decodeUnsignedTx', () => { - testDecodeUnsignedTx('balances', 'transfer'); - testDecodeUnsignedTx('balances', 'transferKeepAlive'); - testDecodeUnsignedTx('democracy', 'removeProxy'); - testDecodeUnsignedTx('democracy', 'resignProxy'); - testDecodeUnsignedTx('democracy', 'setProxy'); - // Skipping until Vote has correct JSON serialization in polkadot-api. - // testDecodeUnsignedTx('democracy', 'proxyVote'); - // testDecodeUnsignedTx('democracy', 'vote'); - testDecodeUnsignedTx('session', 'setKeys'); - testDecodeUnsignedTx('staking', 'bond'); - testDecodeUnsignedTx('staking', 'bondExtra'); - testDecodeUnsignedTx('staking', 'chill'); - testDecodeUnsignedTx('staking', 'nominate'); - testDecodeUnsignedTx('staking', 'unbond'); - testDecodeUnsignedTx('staking', 'validate'); - testDecodeUnsignedTx('staking', 'withdrawUnbonded'); + getAllMethods().forEach(method => testDecodeUnsignedTx(...method)); }); diff --git a/src/methods/democracy/setProxy.spec.ts b/src/methods/democracy/activateProxy.spec.ts similarity index 63% rename from src/methods/democracy/setProxy.spec.ts rename to src/methods/democracy/activateProxy.spec.ts index 840f129c..167f88e0 100644 --- a/src/methods/democracy/setProxy.spec.ts +++ b/src/methods/democracy/activateProxy.spec.ts @@ -3,12 +3,12 @@ import { TEST_METHOD_ARGS, testBaseTxInfo } from '../../util'; -import { setProxy } from './setProxy'; +import { activateProxy } from './activateProxy'; -describe('democracy::setProxy', () => { +describe('democracy::activateProxy', () => { it('should work', () => { - const unsigned = setProxy( - TEST_METHOD_ARGS.democracy.setProxy, + const unsigned = activateProxy( + TEST_METHOD_ARGS.democracy.activateProxy, TEST_BASE_TX_INFO ); diff --git a/src/methods/democracy/setProxy.ts b/src/methods/democracy/activateProxy.ts similarity index 63% rename from src/methods/democracy/setProxy.ts rename to src/methods/democracy/activateProxy.ts index cb63e2cd..cf4de1a1 100644 --- a/src/methods/democracy/setProxy.ts +++ b/src/methods/democracy/activateProxy.ts @@ -5,7 +5,7 @@ import { UnsignedTransaction } from '../../util'; -export interface DemocracySetProxyArgs extends Args { +export interface DemocracyActivateProxyArgs extends Args { /** * Address to set as proxy, SS-58 encoded. */ @@ -13,18 +13,18 @@ export interface DemocracySetProxyArgs extends Args { } /** - * Specify a proxy. Called by the stash. + * Specify a proxy that is already open to us. Called by the stash. * * @param info - Information required to construct the transaction. */ -export function setProxy( - args: DemocracySetProxyArgs, +export function activateProxy( + args: DemocracyActivateProxyArgs, info: BaseTxInfo ): UnsignedTransaction { return createMethod({ method: { args, - name: 'setProxy', + name: 'activateProxy', pallet: 'democracy' }, ...info diff --git a/src/methods/democracy/resignProxy.spec.ts b/src/methods/democracy/closeProxy.spec.ts similarity index 58% rename from src/methods/democracy/resignProxy.spec.ts rename to src/methods/democracy/closeProxy.spec.ts index ec1eb208..28164967 100644 --- a/src/methods/democracy/resignProxy.spec.ts +++ b/src/methods/democracy/closeProxy.spec.ts @@ -3,12 +3,12 @@ import { TEST_METHOD_ARGS, testBaseTxInfo } from '../../util'; -import { resignProxy } from './resignProxy'; +import { closeProxy } from './closeProxy'; -describe('democracy::resignProxy', () => { +describe('democracy::closeProxy', () => { it('should work', () => { - const unsigned = resignProxy( - TEST_METHOD_ARGS.democracy.resignProxy, + const unsigned = closeProxy( + TEST_METHOD_ARGS.democracy.closeProxy, TEST_BASE_TX_INFO ); diff --git a/src/methods/democracy/resignProxy.ts b/src/methods/democracy/closeProxy.ts similarity index 73% rename from src/methods/democracy/resignProxy.ts rename to src/methods/democracy/closeProxy.ts index a0ea5045..7e8b3f91 100644 --- a/src/methods/democracy/resignProxy.ts +++ b/src/methods/democracy/closeProxy.ts @@ -5,11 +5,11 @@ import { BaseTxInfo, createMethod, UnsignedTransaction } from '../../util'; * * @param info - Information required to construct the transaction. */ -export function resignProxy(args: {}, info: BaseTxInfo): UnsignedTransaction { +export function closeProxy(args: {}, info: BaseTxInfo): UnsignedTransaction { return createMethod({ method: { args, - name: 'resignProxy', + name: 'closeProxy', pallet: 'democracy' }, ...info diff --git a/src/methods/democracy/removeProxy.spec.ts b/src/methods/democracy/deactivateProxy.spec.ts similarity index 62% rename from src/methods/democracy/removeProxy.spec.ts rename to src/methods/democracy/deactivateProxy.spec.ts index 1b665371..4eb1fb8a 100644 --- a/src/methods/democracy/removeProxy.spec.ts +++ b/src/methods/democracy/deactivateProxy.spec.ts @@ -3,12 +3,12 @@ import { TEST_METHOD_ARGS, testBaseTxInfo } from '../../util'; -import { removeProxy } from './removeProxy'; +import { deactivateProxy } from './deactivateProxy'; -describe('democracy::removeProxy', () => { +describe('democracy::deactivateProxy', () => { it('should work', () => { - const unsigned = removeProxy( - TEST_METHOD_ARGS.democracy.removeProxy, + const unsigned = deactivateProxy( + TEST_METHOD_ARGS.democracy.deactivateProxy, TEST_BASE_TX_INFO ); diff --git a/src/methods/democracy/deactivateProxy.ts b/src/methods/democracy/deactivateProxy.ts new file mode 100644 index 00000000..807907b6 --- /dev/null +++ b/src/methods/democracy/deactivateProxy.ts @@ -0,0 +1,33 @@ +import { + Args, + BaseTxInfo, + createMethod, + UnsignedTransaction +} from '../../util'; + +export interface DemocracyDeactivateProxyArgs extends Args { + /** + * The address of the proxy to remove, SS-58 encoded. + */ + proxy: string; +} + +/** + * Deactivate the proxy, but leave open to this account. Called by the stash. + * The proxy must already be active. + * + * @param info - Information required to construct the transaction. + */ +export function deactivateProxy( + args: DemocracyDeactivateProxyArgs, + info: BaseTxInfo +): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'deactivateProxy', + pallet: 'democracy' + }, + ...info + }); +} diff --git a/src/methods/democracy/index.ts b/src/methods/democracy/index.ts index 0cba135c..70b4db21 100644 --- a/src/methods/democracy/index.ts +++ b/src/methods/democracy/index.ts @@ -1,5 +1,6 @@ +export * from './activateProxy'; +export * from './closeProxy'; +export * from './deactivateProxy'; +export * from './openProxy'; export * from './proxyVote'; -export * from './removeProxy'; -export * from './resignProxy'; -export * from './setProxy'; export * from './vote'; diff --git a/src/methods/democracy/openProxy.spec.ts b/src/methods/democracy/openProxy.spec.ts new file mode 100644 index 00000000..e6b3b467 --- /dev/null +++ b/src/methods/democracy/openProxy.spec.ts @@ -0,0 +1,20 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { openProxy } from './openProxy'; + +describe('democracy::openProxy', () => { + it('should work', () => { + const unsigned = openProxy( + TEST_METHOD_ARGS.democracy.openProxy, + TEST_BASE_TX_INFO + ); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe( + '0x09168eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48' + ); + }); +}); diff --git a/src/methods/democracy/removeProxy.ts b/src/methods/democracy/openProxy.ts similarity index 62% rename from src/methods/democracy/removeProxy.ts rename to src/methods/democracy/openProxy.ts index 1e7d2ad8..d52f619e 100644 --- a/src/methods/democracy/removeProxy.ts +++ b/src/methods/democracy/openProxy.ts @@ -5,26 +5,26 @@ import { UnsignedTransaction } from '../../util'; -export interface DemocracyRemoveProxyArgs extends Args { +export interface DemocracyOpenProxyArgs extends Args { /** * The address of the proxy to remove, SS-58 encoded. */ - proxy: string; + target: string; } /** - * Clear the proxy. Called by the stash. + * Become a proxy. This must be called prior to a later `activateProxy`. * * @param info - Information required to construct the transaction. */ -export function removeProxy( - args: DemocracyRemoveProxyArgs, +export function openProxy( + args: DemocracyOpenProxyArgs, info: BaseTxInfo ): UnsignedTransaction { return createMethod({ method: { args, - name: 'removeProxy', + name: 'openProxy', pallet: 'democracy' }, ...info diff --git a/src/methods/index.ts b/src/methods/index.ts index df6984a6..53032cdc 100644 --- a/src/methods/index.ts +++ b/src/methods/index.ts @@ -2,5 +2,6 @@ import * as balances from './balances'; import * as democracy from './democracy'; import * as session from './session'; import * as staking from './staking'; +import * as vesting from './vesting'; -export { balances, democracy, session, staking }; +export { balances, democracy, session, staking, vesting }; diff --git a/src/methods/staking/index.ts b/src/methods/staking/index.ts index ef0cbf35..41de4a75 100644 --- a/src/methods/staking/index.ts +++ b/src/methods/staking/index.ts @@ -2,6 +2,9 @@ export * from './bond'; export * from './bondExtra'; export * from './chill'; export * from './nominate'; +export * from './payoutNominator'; +export * from './payoutValidator'; +export * from './setController'; export * from './unbond'; export * from './validate'; export * from './withdrawUnbonded'; diff --git a/src/methods/staking/payoutNominator.spec.ts b/src/methods/staking/payoutNominator.spec.ts new file mode 100644 index 00000000..c9cef6f1 --- /dev/null +++ b/src/methods/staking/payoutNominator.spec.ts @@ -0,0 +1,20 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { payoutNominator } from './payoutNominator'; + +describe('staking::payoutNominator', () => { + it('should work', () => { + const unsigned = payoutNominator( + TEST_METHOD_ARGS.staking.payoutNominator, + TEST_BASE_TX_INFO + ); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe( + '0x071064000000048eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4802000000' + ); + }); +}); diff --git a/src/methods/staking/payoutNominator.ts b/src/methods/staking/payoutNominator.ts new file mode 100644 index 00000000..6b1d1275 --- /dev/null +++ b/src/methods/staking/payoutNominator.ts @@ -0,0 +1,43 @@ +import { + Args, + BaseTxInfo, + createMethod, + UnsignedTransaction +} from '../../util'; + +export interface StakingPayoutNominatorArgs extends Args { + /** + * May not be lower than one following the most recently paid era. If it is + * higher, then it indicates an instruction to skip the payout of all + * previous eras. + */ + era: number; + /** + * List of all validators that `who` had exposure to during `era`. If it is + * incomplete, then less than the full reward will be paid out. It must not + * exceed `MAX_NOMINATIONS`. + */ + validators: [string, number][]; +} + +/** + * Make one nominator's payout for one era. + * WARNING: once an era is payed for a validator such validator can't claim the + * payout of previous era. + * WARNING: Incorrect arguments here can result in loss of payout. Be very careful. + * + * @param info - Information required to construct the transaction. + */ +export function payoutNominator( + args: StakingPayoutNominatorArgs, + info: BaseTxInfo +): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'payoutNominator', + pallet: 'staking' + }, + ...info + }); +} diff --git a/src/methods/staking/payoutValidator.spec.ts b/src/methods/staking/payoutValidator.spec.ts new file mode 100644 index 00000000..9ed8a947 --- /dev/null +++ b/src/methods/staking/payoutValidator.spec.ts @@ -0,0 +1,18 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { payoutValidator } from './payoutValidator'; + +describe('staking::payoutValidator', () => { + it('should work', () => { + const unsigned = payoutValidator( + TEST_METHOD_ARGS.staking.payoutValidator, + TEST_BASE_TX_INFO + ); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe('0x071164000000'); + }); +}); diff --git a/src/methods/staking/payoutValidator.ts b/src/methods/staking/payoutValidator.ts new file mode 100644 index 00000000..0c990df5 --- /dev/null +++ b/src/methods/staking/payoutValidator.ts @@ -0,0 +1,37 @@ +import { + Args, + BaseTxInfo, + createMethod, + UnsignedTransaction +} from '../../util'; + +export interface StakingPayoutValidatorArgs extends Args { + /** + * May not be lower than one following the most recently paid era. If it is + * higher, then it indicates an instruction to skip the payout of all + * previous eras. + */ + era: number; +} + +/** + * Make one validator's payout for one era. + * WARNING: once an era is payed for a validator such validator can't claim the + * payout of previous era. + * WARNING: Incorrect arguments here can result in loss of payout. Be very careful. + * + * @param info - Information required to construct the transaction. + */ +export function payoutValidator( + args: StakingPayoutValidatorArgs, + info: BaseTxInfo +): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'payoutValidator', + pallet: 'staking' + }, + ...info + }); +} diff --git a/src/methods/staking/setController.spec.ts b/src/methods/staking/setController.spec.ts new file mode 100644 index 00000000..498036f1 --- /dev/null +++ b/src/methods/staking/setController.spec.ts @@ -0,0 +1,20 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { setController } from './setController'; + +describe('staking::setController', () => { + it('should work', () => { + const unsigned = setController( + TEST_METHOD_ARGS.staking.setController, + TEST_BASE_TX_INFO + ); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe( + '0x0708ff8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48' + ); + }); +}); diff --git a/src/methods/staking/setController.ts b/src/methods/staking/setController.ts new file mode 100644 index 00000000..2e89114f --- /dev/null +++ b/src/methods/staking/setController.ts @@ -0,0 +1,33 @@ +import { + Args, + BaseTxInfo, + createMethod, + UnsignedTransaction +} from '../../util'; + +export interface StakingSetControllerArgs extends Args { + /** + * The SS-58 encoded controller address. + */ + controller: string; +} + +/** + * (Re-)set the controller of a stash. Effects will be felt at the beginning of + * the next era. + * + * @param info - Information required to construct the transaction. + */ +export function setController( + args: StakingSetControllerArgs, + info: BaseTxInfo +): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'setController', + pallet: 'staking' + }, + ...info + }); +} diff --git a/src/methods/vesting/index.ts b/src/methods/vesting/index.ts new file mode 100644 index 00000000..cc55eb0b --- /dev/null +++ b/src/methods/vesting/index.ts @@ -0,0 +1,2 @@ +export * from './vest'; +export * from './vestOther'; diff --git a/src/methods/vesting/vest.spec.ts b/src/methods/vesting/vest.spec.ts new file mode 100644 index 00000000..be7f5c7a --- /dev/null +++ b/src/methods/vesting/vest.spec.ts @@ -0,0 +1,15 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { vest } from './vest'; + +describe('vesting::vest', () => { + it('should work', () => { + const unsigned = vest(TEST_METHOD_ARGS.vesting.vest, TEST_BASE_TX_INFO); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe('0x1a00'); + }); +}); diff --git a/src/methods/vesting/vest.ts b/src/methods/vesting/vest.ts new file mode 100644 index 00000000..e86e99eb --- /dev/null +++ b/src/methods/vesting/vest.ts @@ -0,0 +1,17 @@ +import { BaseTxInfo, createMethod, UnsignedTransaction } from '../../util'; + +/** + * Unlock any vested funds of the sender account. + * + * @param info - Information required to construct the transaction. + */ +export function vest(args: {}, info: BaseTxInfo): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'vest', + pallet: 'vesting' + }, + ...info + }); +} diff --git a/src/methods/vesting/vestOther.spec.ts b/src/methods/vesting/vestOther.spec.ts new file mode 100644 index 00000000..2afce2f7 --- /dev/null +++ b/src/methods/vesting/vestOther.spec.ts @@ -0,0 +1,20 @@ +import { + TEST_BASE_TX_INFO, + TEST_METHOD_ARGS, + testBaseTxInfo +} from '../../util'; +import { vestOther } from './vestOther'; + +describe('vesting::vestOther', () => { + it('should work', () => { + const unsigned = vestOther( + TEST_METHOD_ARGS.vesting.vestOther, + TEST_BASE_TX_INFO + ); + + testBaseTxInfo(unsigned); + expect(unsigned.method).toBe( + '0x1a01ff90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22' + ); + }); +}); diff --git a/src/methods/vesting/vestOther.ts b/src/methods/vesting/vestOther.ts new file mode 100644 index 00000000..f24f8a04 --- /dev/null +++ b/src/methods/vesting/vestOther.ts @@ -0,0 +1,33 @@ +import { + Args, + BaseTxInfo, + createMethod, + UnsignedTransaction +} from '../../util'; + +export interface VestingVestOtherArgs extends Args { + /** + * The account whose vested funds should be unlocked. Must have funds still + * locked under this module. + */ + target: string; +} + +/** + * Unlock any vested funds of a `target` account. + * + * @param info - Information required to construct the transaction. + */ +export function vestOther( + args: VestingVestOtherArgs, + info: BaseTxInfo +): UnsignedTransaction { + return createMethod({ + method: { + args, + name: 'vestOther', + pallet: 'vesting' + }, + ...info + }); +} diff --git a/src/util/registry.ts b/src/util/registry.ts index 2d400a8f..e3c6b2e7 100644 --- a/src/util/registry.ts +++ b/src/util/registry.ts @@ -20,6 +20,7 @@ export function getRegistry( // Register types specific to chain/runtimeVersion registry.register( getSpecTypes( + registry, createType(registry, 'Text'), // Unneeded for now createType(registry, 'RuntimeVersion', { specName, diff --git a/src/util/testUtil.ts b/src/util/testUtil.ts index fcf96b70..671fc02e 100644 --- a/src/util/testUtil.ts +++ b/src/util/testUtil.ts @@ -3,11 +3,12 @@ */ /** */ import { Keyring } from '@polkadot/api'; -import metadataRpc from '@polkadot/metadata/Metadata/v10/static'; +import metadataRpc from '@polkadot/metadata/Metadata/v11/static'; import { createType } from '@polkadot/types'; import { TRANSACTION_VERSION } from '@polkadot/types/extrinsic/v4/Extrinsic'; import { cryptoWaitReady } from '@polkadot/util-crypto'; +import * as methods from '../methods'; import { getRegistry } from './registry'; import { UnsignedTransaction } from './types'; @@ -48,7 +49,33 @@ export function testBaseTxInfo(unsigned: UnsignedTransaction): void { } /** - * Arguments for all methods we're testing + * Return all methods available in txwrapper as [pallet, methodName]. Used for + * testing decodes on all methods. + */ +export function getAllMethods(): [string, string][] { + return Object.keys(methods) + .reduce((acc, pallet) => { + return acc.concat( + Object.keys(methods[pallet as keyof typeof methods]).map(name => [ + pallet, + name + ]) + ); + }, [] as [string, string][]) + .filter( + ([pallet, name]) => + !( + // Skipping until Vote has correct JSON serialization in polkadot-api. + ( + (pallet === 'democracy' && name === 'proxyVote') || + (pallet === 'democracy' && name === 'vote') + ) + ) + ); +} + +/** + * Dummy arguments for all methods we're testing. */ export const TEST_METHOD_ARGS = { balances: { @@ -62,6 +89,16 @@ export const TEST_METHOD_ARGS = { } }, democracy: { + activateProxy: { + proxy: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" + }, + closeProxy: {}, + deactivateProxy: { + proxy: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" + }, + openProxy: { + target: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" + }, proxyVote: { refIndex: 0, vote: { @@ -69,13 +106,6 @@ export const TEST_METHOD_ARGS = { conviction: 'Locked1x' } }, - removeProxy: { - proxy: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" - }, - resignProxy: {}, - setProxy: { - proxy: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" - }, vote: { refIndex: 0, vote: { @@ -112,14 +142,36 @@ export const TEST_METHOD_ARGS = { 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P' // seed "//Charlie" ] }, + payoutNominator: { + era: 100, + validators: [['FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP', 2]] as [ + string, + number + ][] + }, + payoutValidator: { + era: 100 + }, + setController: { + controller: 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP' // seed "//Bob" + }, unbond: { value: 100 }, validate: { prefs: { commission: 5 } }, withdrawUnbonded: {} + }, + vesting: { + vest: {}, + vestOther: { + target: 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P' // seed "//Charlie" + } } }; +/** + * Sign a payload with seed `//Alice`. + */ export async function signWithAlice(signingPayload: string): Promise { // We're creating an Alice account that will sign the payload // Wait for the promise to resolve async WASM diff --git a/yarn.lock b/yarn.lock index 378c2e5d..e5306863 100644 --- a/yarn.lock +++ b/yarn.lock @@ -481,136 +481,136 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" -"@polkadot/api-derive@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-1.4.2.tgz#c3f77a2174b8b9d7b81604f684f891cecd66270e" - integrity sha512-0wDicrqizfaQhSC7PfwOWikoeMcJKuOIF4+UokX4Zl1211GUJso//+5tMge0oaBNBip1OgXpjHY1ElkgC+bn/Q== +"@polkadot/api-derive@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-1.5.1.tgz#2bc31c1943e8707d08854eae1b623b357d3bb118" + integrity sha512-KmN9UBZFv1v0Q0PMgHGgcZvEbgIYnnyj3mV7M0o7F/200VyvWCySaR+T7Tqu19zdGvQ7ocmQ6VnTw9E2cKqUrA== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/api" "1.4.2" - "@polkadot/rpc-core" "1.4.2" - "@polkadot/rpc-provider" "1.4.2" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" - "@polkadot/util-crypto" "^2.5.1" + "@polkadot/api" "1.5.1" + "@polkadot/rpc-core" "1.5.1" + "@polkadot/rpc-provider" "1.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" + "@polkadot/util-crypto" "^2.6.1" bn.js "^5.1.1" memoizee "^0.4.14" rxjs "^6.5.4" -"@polkadot/api@1.4.2", "@polkadot/api@^1.4.1": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-1.4.2.tgz#fefabcd45f80fddbec488cfb9368faa7782be569" - integrity sha512-jXpW8rvmGGEIyBv9+SC4VW4MtH4iV7C6K1oXOQyF6SIds+Tzub97JwlLJexbCvYFx6j5ABNHyDjp+EQ6LEvr2w== +"@polkadot/api@1.5.1", "@polkadot/api@^1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-1.5.1.tgz#2da9adddfa94fd693692239e717e307092767ffa" + integrity sha512-cvqasyk91/lPB2YXCrQApvrVm0E/8aQcl/AO2iVNJQ1L+pHzR6rnd+94iKMmWFCtRZj86qguR813xsKwJ/PgLg== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/api-derive" "1.4.2" - "@polkadot/keyring" "^2.5.1" - "@polkadot/metadata" "1.4.2" - "@polkadot/rpc-core" "1.4.2" - "@polkadot/rpc-provider" "1.4.2" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" - "@polkadot/util-crypto" "^2.5.1" + "@polkadot/api-derive" "1.5.1" + "@polkadot/keyring" "^2.6.1" + "@polkadot/metadata" "1.5.1" + "@polkadot/rpc-core" "1.5.1" + "@polkadot/rpc-provider" "1.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" + "@polkadot/util-crypto" "^2.6.1" bn.js "^5.1.1" eventemitter3 "^4.0.0" rxjs "^6.5.4" -"@polkadot/jsonrpc@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-1.4.2.tgz#cf96a72ba54f00528c8d0fe07f83f204439cbd98" - integrity sha512-XydE0ckR35S3no9Lt+XSkDN8PXMJO37TV0Y5wCnfrLkH5xYTsno/Cje8JKmAz4epnakeAf+qecGBAZ9RMpR6dQ== +"@polkadot/jsonrpc@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-1.5.1.tgz#4259306678033be2dc4199e8baa0465946952c2b" + integrity sha512-Re9ibWzYXG44X05HyQPPHNXMurrOAxVwJaeSCjVJ3UN7DxXkXniIWohvupIoiRn0Ayp1/1QOK8YvEOjqxyqTMw== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" -"@polkadot/keyring@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.5.1.tgz#53a7368f20e40faea5904d89b96dc89975360a22" - integrity sha512-E6CdkHidW6CdP11sJv0Nq7sVPAAHSsIYdybPW34drVHjl11leho7WETIGkXGrbAFjj4bi6H2CFWfF4i0gh7qhg== +"@polkadot/keyring@^2.6.1": + version "2.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-2.6.1.tgz#dad4d2047ed94334aa509b404bf7d49374e219e6" + integrity sha512-h12f5tWfqzJUmXTnjQ5fVrfSIiZH2ToRdPwEn467yHpeCDPWNCnKN/qHHoYOFQi8TkALiQk03NZbLX4QgoNRFw== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/util" "2.5.1" - "@polkadot/util-crypto" "2.5.1" + "@polkadot/util" "2.6.1" + "@polkadot/util-crypto" "2.6.1" -"@polkadot/metadata@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-1.4.2.tgz#b17786ca21310187c939c41ae60f68bf9e998fa0" - integrity sha512-E3adceNls4NlJm4ErK7GIu6el6Z3GiUVuZDMmY2iZoo4awcgMjhRyJS/7k8VotcSW0B1q3EU7qPaOoD6f9xHLQ== +"@polkadot/metadata@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-1.5.1.tgz#4a859e73708f9ed1b627e155a7d7faea334fb805" + integrity sha512-Su7mdelNVn5fNUcM9qFlha6gayLoOnTjT7yWy21apt7bg11mrj5aiJ2J6YvKhnM+9xGpKYnTqAX2fFyDbPqiFg== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" - "@polkadot/util-crypto" "^2.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" + "@polkadot/util-crypto" "^2.6.1" bn.js "^5.1.1" -"@polkadot/rpc-core@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-1.4.2.tgz#001c55e99cc6d4b3c8507c5490ab7e866bc25883" - integrity sha512-teHT+psl5QoDHE6lPF/YUE0dpXrdSIZYfEG0sOkYzL/eS63WKcixXYYf8inaRvjNhbapPd/JvTof60a/PAHFqw== +"@polkadot/rpc-core@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-1.5.1.tgz#aa722e5b1348c1dd31899897a65c6a56f3695ad8" + integrity sha512-SE0cAcTeLvZxJHnD8+saiksyjoBhMGRcVB9BkDLPPKZJ1+xZfZ/SItHhXCtCgL1Ur3UUTbrdLHVLNgE6Tb11lg== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/jsonrpc" "1.4.2" - "@polkadot/metadata" "1.4.2" - "@polkadot/rpc-provider" "1.4.2" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" + "@polkadot/jsonrpc" "1.5.1" + "@polkadot/metadata" "1.5.1" + "@polkadot/rpc-provider" "1.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" memoizee "^0.4.14" rxjs "^6.5.4" -"@polkadot/rpc-provider@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-1.4.2.tgz#59d97b4279c5ff7b7ccee1d1877663a9118cac36" - integrity sha512-v9D+q5YACa8SCHWiYmlOy7evaoc8a2mPH1Yh7DNOnfi5b51D9dA6vbZSDfWavB/M9E1tTMGdFNzt7j+sAsnwKw== +"@polkadot/rpc-provider@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-1.5.1.tgz#48b463302f4ae153044e08fac79b9a75ffb370c4" + integrity sha512-w81LZbo0r0vEGu72YdiKYgC3zvtVPqkopASTu6pyr3GjltVHmdXRsogdEoogveYCaJvEG8ul2CW/gFROzr53EA== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/jsonrpc" "1.4.2" - "@polkadot/metadata" "1.4.2" - "@polkadot/types" "1.4.2" - "@polkadot/util" "^2.5.1" - "@polkadot/util-crypto" "^2.5.1" + "@polkadot/jsonrpc" "1.5.1" + "@polkadot/metadata" "1.5.1" + "@polkadot/types" "1.5.1" + "@polkadot/util" "^2.6.1" + "@polkadot/util-crypto" "^2.6.1" bn.js "^5.1.1" eventemitter3 "^4.0.0" isomorphic-fetch "^2.2.1" websocket "^1.0.31" -"@polkadot/types@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-1.4.2.tgz#4535d08d501186b22b0071eb3b540b05ad5ca2ce" - integrity sha512-Zpn7NQbFla0LWIGyHoMw3Vg83EcCGsC9ABWkoG9OzJQpInM7XCo7hA/Q/kHMKPyoICfNKOaweqf8+gbBtlAj/g== +"@polkadot/types@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-1.5.1.tgz#4e3acbd2e718536fad7e8874dfbf1957d4bb6fce" + integrity sha512-Iom607LqB7QT/+gPD1+n7lpq2fZ71Kfw1u7WASfrxGVO/K7LdzmC12rv1/hbsFP7vsiw8SKeEH16FIiU5/S5WA== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/metadata" "1.4.2" - "@polkadot/util" "^2.5.1" - "@polkadot/util-crypto" "^2.5.1" + "@polkadot/metadata" "1.5.1" + "@polkadot/util" "^2.6.1" + "@polkadot/util-crypto" "^2.6.1" "@types/bn.js" "^4.11.6" bn.js "^5.1.1" memoizee "^0.4.14" rxjs "^6.5.4" -"@polkadot/util-crypto@2.5.1", "@polkadot/util-crypto@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.5.1.tgz#9dceda1b2a6684d077ebe2981c4e0dbc69a52fd0" - integrity sha512-AhL37ffn8MkSNwg//uj/xYFYzdbR3h196UB7y3IN6CPhD+pOPZOqDpqdd0oT2xpksppctvWZqYEaT1k7l3R2Tw== +"@polkadot/util-crypto@2.6.1", "@polkadot/util-crypto@^2.6.1": + version "2.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-2.6.1.tgz#d5982e08d79e5315eb0ca8105ee0580f2284e572" + integrity sha512-XYPWlmuilDl4Yo1p/toYUoEp583lt3iwKOb1haIyylUzzQPIhW0t+7ys1ZSarAhuSqhy+7jbi3+DX5b8K1lFBQ== dependencies: "@babel/runtime" "^7.8.4" - "@polkadot/util" "2.5.1" - "@polkadot/wasm-crypto" "^1.0.1" - base-x "^3.0.7" + "@polkadot/util" "2.6.1" + "@polkadot/wasm-crypto" "^1.2.1" + base-x "^3.0.8" bip39 "^3.0.2" blakejs "^1.1.0" bn.js "^5.1.1" bs58 "^4.0.1" elliptic "^6.5.2" js-sha3 "^0.8.0" - pbkdf2 "^3.0.9" + pbkdf2 "^3.0.17" tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@2.5.1", "@polkadot/util@^2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.5.1.tgz#8b4be9f7418a2872f6ccb1a0d18e426b4e8779a9" - integrity sha512-MVQPyxkhfERvV1uGyne0b7iekX9h7v892144bNB5VYZ7C2rTuJ5XpaWgx0V9DANeaEv+cqfjeW+8ngYQwYhQKw== +"@polkadot/util@2.6.1", "@polkadot/util@^2.6.1": + version "2.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-2.6.1.tgz#1b8b1d76a87072ad1099319031d278756215ee43" + integrity sha512-iaTqsCH6EEFm1yHSxLGCi/cplZS1lNFcs6QEb+FNgP418nG55NW/j+acpUf94JfZ3MPRB4228ooh45drsaUqPQ== dependencies: "@babel/runtime" "^7.8.4" "@types/bn.js" "^4.11.6" @@ -619,10 +619,10 @@ chalk "^3.0.0" ip-regex "^4.1.0" -"@polkadot/wasm-crypto@^1.0.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-1.1.1.tgz#f3bf66ce96f02c674287fe59b059964a0c5804d0" - integrity sha512-LMZA+KDnE2qKD7Un9/OJKuCmsf63vvhjGqM/lcb+2FZu5TpfjP1AMeTurDOt1ip3+qEukd5FkfUHXQIiFJLVBQ== +"@polkadot/wasm-crypto@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-1.2.1.tgz#2189702447acd28d763886359576c87562241767" + integrity sha512-nckIoZBV4nBZdeKwFwH5t7skS7L7GO5EFUl5B1F6uCjUfdNpDz3DtqbYQHcLdCZNmG4TDLg6w/1J+rkl2SiUZw== "@sinonjs/commons@^1.7.0": version "1.7.0" @@ -1059,13 +1059,20 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base-x@^3.0.2, base-x@^3.0.7: +base-x@^3.0.2: version "3.0.7" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.7.tgz#1c5a7fafe8f66b4114063e8da102799d4e7c408f" integrity sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw== dependencies: safe-buffer "^5.0.1" +base-x@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" + integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== + dependencies: + safe-buffer "^5.0.1" + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -4323,7 +4330,7 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" -pbkdf2@^3.0.9: +pbkdf2@^3.0.17, pbkdf2@^3.0.9: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==