@bitgo/account-lib 2.20.0-rc.2 → 2.20.0-rc.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -0
- package/dist/resources/README.md +8 -2
- package/dist/resources/trx/protobuf/tron.js +5 -1
- package/dist/src/coin/avaxc/index.js +3 -3
- package/dist/src/coin/avaxc/keyPair.d.ts +1 -2
- package/dist/src/coin/avaxc/keyPair.d.ts.map +1 -1
- package/dist/src/coin/avaxc/keyPair.js +25 -44
- package/dist/src/coin/avaxc/resources.js +3 -3
- package/dist/src/coin/avaxc/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/avaxc/transactionBuilder.js +22 -41
- package/dist/src/coin/avaxc/transferBuilder.js +8 -28
- package/dist/src/coin/avaxc/utils.js +14 -54
- package/dist/src/coin/celo/index.js +3 -3
- package/dist/src/coin/celo/resources.js +3 -3
- package/dist/src/coin/celo/stakingBuilder.d.ts +1 -1
- package/dist/src/coin/celo/stakingBuilder.d.ts.map +1 -1
- package/dist/src/coin/celo/stakingBuilder.js +102 -104
- package/dist/src/coin/celo/stakingCall.js +8 -26
- package/dist/src/coin/celo/stakingUtils.d.ts +1 -1
- package/dist/src/coin/celo/stakingUtils.d.ts.map +1 -1
- package/dist/src/coin/celo/stakingUtils.js +33 -34
- package/dist/src/coin/celo/transaction.js +10 -30
- package/dist/src/coin/celo/transactionBuilder.d.ts +1 -1
- package/dist/src/coin/celo/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/celo/transactionBuilder.js +96 -115
- package/dist/src/coin/celo/transferBuilder.js +8 -28
- package/dist/src/coin/celo/types.js +71 -125
- package/dist/src/coin/celo/utils.js +25 -25
- package/dist/src/coin/dot/addressInitializationBuilder.d.ts +1 -2
- package/dist/src/coin/dot/addressInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/addressInitializationBuilder.js +60 -83
- package/dist/src/coin/dot/batchTransactionBuilder.d.ts +1 -1
- package/dist/src/coin/dot/batchTransactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/batchTransactionBuilder.js +55 -78
- package/dist/src/coin/dot/claimBuilder.d.ts +1 -2
- package/dist/src/coin/dot/claimBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/claimBuilder.js +46 -68
- package/dist/src/coin/dot/errors.d.ts +1 -1
- package/dist/src/coin/dot/errors.d.ts.map +1 -1
- package/dist/src/coin/dot/errors.js +12 -33
- package/dist/src/coin/dot/iface.d.ts +1 -2
- package/dist/src/coin/dot/iface.d.ts.map +1 -1
- package/dist/src/coin/dot/iface.js +1 -1
- package/dist/src/coin/dot/index.js +3 -3
- package/dist/src/coin/dot/keyPair.d.ts +1 -2
- package/dist/src/coin/dot/keyPair.d.ts.map +1 -1
- package/dist/src/coin/dot/keyPair.js +34 -52
- package/dist/src/coin/dot/singletonRegistry.js +6 -9
- package/dist/src/coin/dot/stakingBuilder.d.ts +1 -2
- package/dist/src/coin/dot/stakingBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/stakingBuilder.js +49 -71
- package/dist/src/coin/dot/transaction.d.ts +1 -2
- package/dist/src/coin/dot/transaction.d.ts.map +1 -1
- package/dist/src/coin/dot/transaction.js +146 -162
- package/dist/src/coin/dot/transactionBuilder.d.ts +2 -3
- package/dist/src/coin/dot/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilder.js +132 -204
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilderFactory.js +46 -65
- package/dist/src/coin/dot/transferBuilder.d.ts +1 -2
- package/dist/src/coin/dot/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transferBuilder.js +62 -85
- package/dist/src/coin/dot/txnSchema.js +17 -15
- package/dist/src/coin/dot/unnominateBuilder.d.ts +1 -1
- package/dist/src/coin/dot/unnominateBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/unnominateBuilder.js +24 -46
- package/dist/src/coin/dot/unstakeBuilder.d.ts +1 -1
- package/dist/src/coin/dot/unstakeBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/unstakeBuilder.js +38 -60
- package/dist/src/coin/dot/utils.d.ts +1 -2
- package/dist/src/coin/dot/utils.d.ts.map +1 -1
- package/dist/src/coin/dot/utils.js +97 -101
- package/dist/src/coin/dot/withdrawUnstakedBuilder.d.ts +1 -1
- package/dist/src/coin/dot/withdrawUnstakedBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/withdrawUnstakedBuilder.js +38 -60
- package/dist/src/coin/etc/index.js +3 -3
- package/dist/src/coin/etc/resources.js +3 -3
- package/dist/src/coin/etc/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/etc/transactionBuilder.js +22 -41
- package/dist/src/coin/etc/transferBuilder.js +8 -28
- package/dist/src/coin/etc/utils.js +10 -50
- package/dist/src/coin/eth/contractCall.js +8 -9
- package/dist/src/coin/eth/iface.d.ts +1 -1
- package/dist/src/coin/eth/iface.d.ts.map +1 -1
- package/dist/src/coin/eth/iface.js +1 -1
- package/dist/src/coin/eth/index.js +3 -3
- package/dist/src/coin/eth/keyPair.d.ts +1 -2
- package/dist/src/coin/eth/keyPair.d.ts.map +1 -1
- package/dist/src/coin/eth/keyPair.js +25 -44
- package/dist/src/coin/eth/transaction.d.ts +1 -2
- package/dist/src/coin/eth/transaction.d.ts.map +1 -1
- package/dist/src/coin/eth/transaction.js +48 -114
- package/dist/src/coin/eth/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/eth/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/eth/transactionBuilder.js +232 -303
- package/dist/src/coin/eth/transferBuilder/baseNFTTransferBuilder.js +37 -38
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC1155.js +36 -53
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC721.js +32 -49
- package/dist/src/coin/eth/transferBuilder.js +58 -59
- package/dist/src/coin/eth/types.js +52 -56
- package/dist/src/coin/eth/utils.d.ts +1 -1
- package/dist/src/coin/eth/utils.d.ts.map +1 -1
- package/dist/src/coin/eth/utils.js +100 -147
- package/dist/src/coin/eth/walletUtil.d.ts +2 -0
- package/dist/src/coin/eth/walletUtil.d.ts.map +1 -1
- package/dist/src/coin/eth/walletUtil.js +4 -2
- package/dist/src/coin/eth2/keyPair.d.ts +1 -2
- package/dist/src/coin/eth2/keyPair.d.ts.map +1 -1
- package/dist/src/coin/eth2/keyPair.js +19 -37
- package/dist/src/coin/hbar/index.js +2 -2
- package/dist/src/coin/hbar/keyPair.d.ts +1 -2
- package/dist/src/coin/hbar/keyPair.d.ts.map +1 -1
- package/dist/src/coin/hbar/keyPair.js +30 -49
- package/dist/src/coin/hbar/transaction.d.ts +1 -2
- package/dist/src/coin/hbar/transaction.d.ts.map +1 -1
- package/dist/src/coin/hbar/transaction.js +77 -146
- package/dist/src/coin/hbar/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/hbar/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/transactionBuilder.js +110 -193
- package/dist/src/coin/hbar/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/hbar/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/hbar/transactionBuilderFactory.js +27 -45
- package/dist/src/coin/hbar/transferBuilder.d.ts +1 -1
- package/dist/src/coin/hbar/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/transferBuilder.js +49 -113
- package/dist/src/coin/hbar/utils.d.ts +2 -15
- package/dist/src/coin/hbar/utils.d.ts.map +1 -1
- package/dist/src/coin/hbar/utils.js +38 -57
- package/dist/src/coin/hbar/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/walletInitializationBuilder.js +42 -107
- package/dist/src/coin/near/contractCallWrapper.js +46 -65
- package/dist/src/coin/near/errors.d.ts +1 -1
- package/dist/src/coin/near/errors.d.ts.map +1 -1
- package/dist/src/coin/near/errors.js +7 -25
- package/dist/src/coin/near/iface.d.ts +1 -2
- package/dist/src/coin/near/iface.d.ts.map +1 -1
- package/dist/src/coin/near/iface.js +1 -1
- package/dist/src/coin/near/index.d.ts +3 -0
- package/dist/src/coin/near/index.d.ts.map +1 -1
- package/dist/src/coin/near/index.js +9 -3
- package/dist/src/coin/near/keyPair.d.ts +1 -2
- package/dist/src/coin/near/keyPair.d.ts.map +1 -1
- package/dist/src/coin/near/keyPair.js +23 -40
- package/dist/src/coin/near/stakingActivateBuilder.d.ts +1 -1
- package/dist/src/coin/near/stakingActivateBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/stakingActivateBuilder.js +36 -105
- package/dist/src/coin/near/stakingDeactivateBuilder.d.ts +1 -1
- package/dist/src/coin/near/stakingDeactivateBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/stakingDeactivateBuilder.js +36 -105
- package/dist/src/coin/near/stakingWithdrawBuilder.d.ts +1 -1
- package/dist/src/coin/near/stakingWithdrawBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/stakingWithdrawBuilder.js +36 -105
- package/dist/src/coin/near/transaction.d.ts +1 -2
- package/dist/src/coin/near/transaction.d.ts.map +1 -1
- package/dist/src/coin/near/transaction.js +125 -154
- package/dist/src/coin/near/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/near/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/transactionBuilder.js +81 -144
- package/dist/src/coin/near/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/near/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/near/transactionBuilderFactory.js +33 -51
- package/dist/src/coin/near/transferBuilder.d.ts +1 -1
- package/dist/src/coin/near/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/transferBuilder.js +27 -91
- package/dist/src/coin/near/utils.d.ts +1 -1
- package/dist/src/coin/near/utils.d.ts.map +1 -1
- package/dist/src/coin/near/utils.js +35 -45
- package/dist/src/coin/near/walletInitializationBuilder.d.ts +1 -1
- package/dist/src/coin/near/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/near/walletInitializationBuilder.js +13 -70
- package/dist/src/coin/polygon/index.d.ts +8 -0
- package/dist/src/coin/polygon/index.d.ts.map +1 -0
- package/dist/src/coin/polygon/index.js +35 -0
- package/dist/src/coin/polygon/resources.d.ts +10 -0
- package/dist/src/coin/polygon/resources.d.ts.map +1 -0
- package/dist/src/coin/polygon/resources.js +25 -0
- package/dist/src/coin/polygon/transactionBuilder.d.ts +17 -0
- package/dist/src/coin/polygon/transactionBuilder.d.ts.map +1 -0
- package/dist/src/coin/polygon/transactionBuilder.js +44 -0
- package/dist/src/coin/polygon/transferBuilder.d.ts +19 -0
- package/dist/src/coin/polygon/transferBuilder.d.ts.map +1 -0
- package/dist/src/coin/polygon/transferBuilder.js +27 -0
- package/dist/src/coin/polygon/utils.d.ts +18 -0
- package/dist/src/coin/polygon/utils.d.ts.map +1 -0
- package/dist/src/coin/polygon/utils.js +42 -0
- package/dist/src/coin/polygon/walletUtil.d.ts +48 -0
- package/dist/src/coin/polygon/walletUtil.d.ts.map +1 -0
- package/dist/src/coin/polygon/walletUtil.js +632 -0
- package/dist/src/coin/rbtc/index.js +3 -3
- package/dist/src/coin/rbtc/resources.js +3 -3
- package/dist/src/coin/rbtc/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/rbtc/transactionBuilder.js +21 -40
- package/dist/src/coin/rbtc/transferBuilder.js +8 -28
- package/dist/src/coin/rbtc/utils.js +10 -50
- package/dist/src/coin/sol/ataInitializationBuilder.d.ts +1 -1
- package/dist/src/coin/sol/ataInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/ataInitializationBuilder.js +52 -123
- package/dist/src/coin/sol/ataInitializationTransaction.d.ts.map +1 -1
- package/dist/src/coin/sol/ataInitializationTransaction.js +34 -57
- package/dist/src/coin/sol/iface.d.ts +1 -1
- package/dist/src/coin/sol/iface.d.ts.map +1 -1
- package/dist/src/coin/sol/iface.js +1 -1
- package/dist/src/coin/sol/index.js +3 -3
- package/dist/src/coin/sol/instructionParamsFactory.d.ts +1 -1
- package/dist/src/coin/sol/instructionParamsFactory.d.ts.map +1 -1
- package/dist/src/coin/sol/instructionParamsFactory.js +62 -67
- package/dist/src/coin/sol/keyPair.d.ts +1 -2
- package/dist/src/coin/sol/keyPair.d.ts.map +1 -1
- package/dist/src/coin/sol/keyPair.js +24 -42
- package/dist/src/coin/sol/solInstructionFactory.js +33 -33
- package/dist/src/coin/sol/stakingActivateBuilder.d.ts +1 -1
- package/dist/src/coin/sol/stakingActivateBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/stakingActivateBuilder.js +45 -113
- package/dist/src/coin/sol/stakingDeactivateBuilder.d.ts +1 -1
- package/dist/src/coin/sol/stakingDeactivateBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/stakingDeactivateBuilder.js +36 -104
- package/dist/src/coin/sol/stakingWithdrawBuilder.d.ts +1 -1
- package/dist/src/coin/sol/stakingWithdrawBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/stakingWithdrawBuilder.js +41 -109
- package/dist/src/coin/sol/tokenEncodeDecode.js +46 -75
- package/dist/src/coin/sol/tokenTransferBuilder.d.ts +1 -1
- package/dist/src/coin/sol/tokenTransferBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/tokenTransferBuilder.js +42 -115
- package/dist/src/coin/sol/transaction.d.ts +1 -2
- package/dist/src/coin/sol/transaction.d.ts.map +1 -1
- package/dist/src/coin/sol/transaction.js +130 -221
- package/dist/src/coin/sol/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/sol/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/transactionBuilder.js +104 -171
- package/dist/src/coin/sol/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/sol/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/sol/transactionBuilderFactory.js +46 -64
- package/dist/src/coin/sol/transferBuilder.d.ts +1 -1
- package/dist/src/coin/sol/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/transferBuilder.js +37 -108
- package/dist/src/coin/sol/utils.d.ts +1 -1
- package/dist/src/coin/sol/utils.d.ts.map +1 -1
- package/dist/src/coin/sol/utils.js +49 -117
- package/dist/src/coin/sol/walletInitializationBuilder.d.ts +1 -1
- package/dist/src/coin/sol/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/walletInitializationBuilder.js +39 -107
- package/dist/src/coin/stx/abstractContractBuilder.d.ts.map +1 -1
- package/dist/src/coin/stx/abstractContractBuilder.js +34 -104
- package/dist/src/coin/stx/contractBuilder.js +38 -57
- package/dist/src/coin/stx/index.js +2 -2
- package/dist/src/coin/stx/keyPair.d.ts +1 -2
- package/dist/src/coin/stx/keyPair.d.ts.map +1 -1
- package/dist/src/coin/stx/keyPair.js +39 -62
- package/dist/src/coin/stx/sendmanyBuilder.js +43 -108
- package/dist/src/coin/stx/transaction.d.ts +1 -2
- package/dist/src/coin/stx/transaction.d.ts.map +1 -1
- package/dist/src/coin/stx/transaction.js +102 -183
- package/dist/src/coin/stx/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/stx/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/stx/transactionBuilder.js +121 -218
- package/dist/src/coin/stx/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/stx/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/stx/transactionBuilderFactory.js +36 -54
- package/dist/src/coin/stx/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/stx/transferBuilder.js +41 -111
- package/dist/src/coin/stx/utils.d.ts.map +1 -1
- package/dist/src/coin/stx/utils.js +58 -65
- package/dist/src/coin/trx/address.d.ts +1 -1
- package/dist/src/coin/trx/address.d.ts.map +1 -1
- package/dist/src/coin/trx/address.js +3 -6
- package/dist/src/coin/trx/contractCallBuilder.d.ts +1 -1
- package/dist/src/coin/trx/contractCallBuilder.d.ts.map +1 -1
- package/dist/src/coin/trx/contractCallBuilder.js +100 -160
- package/dist/src/coin/trx/iface.d.ts +1 -1
- package/dist/src/coin/trx/iface.d.ts.map +1 -1
- package/dist/src/coin/trx/iface.js +1 -1
- package/dist/src/coin/trx/index.js +4 -4
- package/dist/src/coin/trx/keyPair.d.ts +1 -3
- package/dist/src/coin/trx/keyPair.d.ts.map +1 -1
- package/dist/src/coin/trx/keyPair.js +37 -57
- package/dist/src/coin/trx/transaction.d.ts +1 -3
- package/dist/src/coin/trx/transaction.d.ts.map +1 -1
- package/dist/src/coin/trx/transaction.js +84 -124
- package/dist/src/coin/trx/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/trx/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/trx/transactionBuilder.js +72 -134
- package/dist/src/coin/trx/utils.js +57 -59
- package/dist/src/coin/trx/wrappedBuilder.d.ts +1 -2
- package/dist/src/coin/trx/wrappedBuilder.d.ts.map +1 -1
- package/dist/src/coin/trx/wrappedBuilder.js +43 -101
- package/dist/src/coin/xrp/index.js +2 -2
- package/dist/src/coin/xrp/keyPair.d.ts +1 -2
- package/dist/src/coin/xrp/keyPair.d.ts.map +1 -1
- package/dist/src/coin/xrp/keyPair.js +6 -23
- package/dist/src/coin/xrp/transaction.d.ts +1 -2
- package/dist/src/coin/xrp/transaction.d.ts.map +1 -1
- package/dist/src/coin/xrp/transaction.js +13 -34
- package/dist/src/coin/xrp/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/xrp/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/xrp/transactionBuilder.js +29 -51
- package/dist/src/coin/xrp/transactionBuilderFactory.d.ts +1 -1
- package/dist/src/coin/xrp/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/xrp/transactionBuilderFactory.js +17 -35
- package/dist/src/coin/xrp/transferBuilder.d.ts +1 -1
- package/dist/src/coin/xrp/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/xrp/transferBuilder.js +16 -73
- package/dist/src/coin/xrp/utils.d.ts +1 -1
- package/dist/src/coin/xrp/utils.d.ts.map +1 -1
- package/dist/src/coin/xrp/utils.js +22 -25
- package/dist/src/coin/xrp/walletInitializationBuilder.d.ts +1 -1
- package/dist/src/coin/xrp/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/xrp/walletInitializationBuilder.js +16 -73
- package/dist/src/coin/xtz/address.d.ts +1 -1
- package/dist/src/coin/xtz/address.d.ts.map +1 -1
- package/dist/src/coin/xtz/address.js +3 -6
- package/dist/src/coin/xtz/iface.d.ts +1 -1
- package/dist/src/coin/xtz/iface.d.ts.map +1 -1
- package/dist/src/coin/xtz/iface.js +1 -1
- package/dist/src/coin/xtz/index.js +4 -4
- package/dist/src/coin/xtz/keyPair.d.ts +1 -2
- package/dist/src/coin/xtz/keyPair.d.ts.map +1 -1
- package/dist/src/coin/xtz/keyPair.js +39 -59
- package/dist/src/coin/xtz/multisigUtils.js +64 -77
- package/dist/src/coin/xtz/transaction.d.ts +1 -2
- package/dist/src/coin/xtz/transaction.d.ts.map +1 -1
- package/dist/src/coin/xtz/transaction.js +175 -345
- package/dist/src/coin/xtz/transactionBuilder.d.ts +1 -2
- package/dist/src/coin/xtz/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/xtz/transactionBuilder.js +212 -347
- package/dist/src/coin/xtz/transferBuilder.js +25 -28
- package/dist/src/coin/xtz/utils.d.ts.map +1 -1
- package/dist/src/coin/xtz/utils.js +54 -125
- package/dist/src/index.d.ts +7 -11
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +38 -44
- package/dist/src/keyPair/index.d.ts +1 -2
- package/dist/src/keyPair/index.d.ts.map +1 -1
- package/dist/src/keyPair/index.js +9 -9
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +9 -9
- package/dist/tsconfig.tsbuildinfo +21131 -16701
- package/package.json +21 -43
- package/resources/README.md +8 -2
- package/resources/trx/protobuf/tron.js +5 -1
- package/dist/browser/bitgo-account-lib.js +0 -2
- package/dist/browser/bitgo-account-lib.js.LICENSE.txt +0 -335
- package/dist/src/coin/algo/assetTransferBuilder.d.ts +0 -43
- package/dist/src/coin/algo/assetTransferBuilder.d.ts.map +0 -1
- package/dist/src/coin/algo/assetTransferBuilder.js +0 -127
- package/dist/src/coin/algo/errors.d.ts +0 -11
- package/dist/src/coin/algo/errors.d.ts.map +0 -1
- package/dist/src/coin/algo/errors.js +0 -51
- package/dist/src/coin/algo/ifaces.d.ts +0 -46
- package/dist/src/coin/algo/ifaces.d.ts.map +0 -1
- package/dist/src/coin/algo/ifaces.js +0 -3
- package/dist/src/coin/algo/index.d.ts +0 -13
- package/dist/src/coin/algo/index.d.ts.map +0 -1
- package/dist/src/coin/algo/index.js +0 -47
- package/dist/src/coin/algo/keyPair.d.ts +0 -26
- package/dist/src/coin/algo/keyPair.d.ts.map +0 -1
- package/dist/src/coin/algo/keyPair.js +0 -95
- package/dist/src/coin/algo/keyRegistrationBuilder.d.ts +0 -104
- package/dist/src/coin/algo/keyRegistrationBuilder.d.ts.map +0 -1
- package/dist/src/coin/algo/keyRegistrationBuilder.js +0 -262
- package/dist/src/coin/algo/seedEncoding.d.ts +0 -25
- package/dist/src/coin/algo/seedEncoding.d.ts.map +0 -1
- package/dist/src/coin/algo/seedEncoding.js +0 -100
- package/dist/src/coin/algo/transaction.d.ts +0 -76
- package/dist/src/coin/algo/transaction.d.ts.map +0 -1
- package/dist/src/coin/algo/transaction.js +0 -287
- package/dist/src/coin/algo/transactionBuilder.d.ts +0 -205
- package/dist/src/coin/algo/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/algo/transactionBuilder.js +0 -445
- package/dist/src/coin/algo/transactionBuilderFactory.d.ts +0 -16
- package/dist/src/coin/algo/transactionBuilderFactory.d.ts.map +0 -1
- package/dist/src/coin/algo/transactionBuilderFactory.js +0 -70
- package/dist/src/coin/algo/transferBuilder.d.ts +0 -41
- package/dist/src/coin/algo/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/algo/transferBuilder.js +0 -111
- package/dist/src/coin/algo/txnSchema.d.ts +0 -7
- package/dist/src/coin/algo/txnSchema.d.ts.map +0 -1
- package/dist/src/coin/algo/txnSchema.js +0 -68
- package/dist/src/coin/algo/utils.d.ts +0 -249
- package/dist/src/coin/algo/utils.d.ts.map +0 -1
- package/dist/src/coin/algo/utils.js +0 -544
- package/dist/src/coin/baseCoin/baseKeyPair.d.ts +0 -27
- package/dist/src/coin/baseCoin/baseKeyPair.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/baseKeyPair.js +0 -3
- package/dist/src/coin/baseCoin/baseTransaction.d.ts +0 -71
- package/dist/src/coin/baseCoin/baseTransaction.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/baseTransaction.js +0 -94
- package/dist/src/coin/baseCoin/baseTransactionBuilder.d.ts +0 -128
- package/dist/src/coin/baseCoin/baseTransactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/baseTransactionBuilder.js +0 -179
- package/dist/src/coin/baseCoin/baseTransactionBuilderFactory.d.ts +0 -30
- package/dist/src/coin/baseCoin/baseTransactionBuilderFactory.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/baseTransactionBuilderFactory.js +0 -20
- package/dist/src/coin/baseCoin/baseUtils.d.ts +0 -45
- package/dist/src/coin/baseCoin/baseUtils.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/baseUtils.js +0 -3
- package/dist/src/coin/baseCoin/blsKeyPair.d.ts +0 -75
- package/dist/src/coin/baseCoin/blsKeyPair.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/blsKeyPair.js +0 -232
- package/dist/src/coin/baseCoin/ed25519KeyPair.d.ts +0 -50
- package/dist/src/coin/baseCoin/ed25519KeyPair.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/ed25519KeyPair.js +0 -141
- package/dist/src/coin/baseCoin/enum.d.ts +0 -43
- package/dist/src/coin/baseCoin/enum.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/enum.js +0 -70
- package/dist/src/coin/baseCoin/errors.d.ts +0 -65
- package/dist/src/coin/baseCoin/errors.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/errors.js +0 -156
- package/dist/src/coin/baseCoin/iface.d.ts +0 -162
- package/dist/src/coin/baseCoin/iface.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/iface.js +0 -38
- package/dist/src/coin/baseCoin/index.d.ts +0 -12
- package/dist/src/coin/baseCoin/index.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/index.js +0 -41
- package/dist/src/coin/baseCoin/secp256k1ExtendedKeyPair.d.ts +0 -55
- package/dist/src/coin/baseCoin/secp256k1ExtendedKeyPair.d.ts.map +0 -1
- package/dist/src/coin/baseCoin/secp256k1ExtendedKeyPair.js +0 -124
- package/dist/src/coin/cspr/constants.d.ts +0 -19
- package/dist/src/coin/cspr/constants.d.ts.map +0 -1
- package/dist/src/coin/cspr/constants.js +0 -28
- package/dist/src/coin/cspr/delegateBuilder.d.ts +0 -49
- package/dist/src/coin/cspr/delegateBuilder.d.ts.map +0 -1
- package/dist/src/coin/cspr/delegateBuilder.js +0 -175
- package/dist/src/coin/cspr/ifaces.d.ts +0 -69
- package/dist/src/coin/cspr/ifaces.d.ts.map +0 -1
- package/dist/src/coin/cspr/ifaces.js +0 -3
- package/dist/src/coin/cspr/index.d.ts +0 -5
- package/dist/src/coin/cspr/index.d.ts.map +0 -1
- package/dist/src/coin/cspr/index.js +0 -29
- package/dist/src/coin/cspr/keyPair.d.ts +0 -19
- package/dist/src/coin/cspr/keyPair.d.ts.map +0 -1
- package/dist/src/coin/cspr/keyPair.js +0 -94
- package/dist/src/coin/cspr/transaction.d.ts +0 -56
- package/dist/src/coin/cspr/transaction.d.ts.map +0 -1
- package/dist/src/coin/cspr/transaction.js +0 -251
- package/dist/src/coin/cspr/transactionBuilder.d.ts +0 -125
- package/dist/src/coin/cspr/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/cspr/transactionBuilder.js +0 -383
- package/dist/src/coin/cspr/transactionBuilderFactory.d.ts +0 -46
- package/dist/src/coin/cspr/transactionBuilderFactory.d.ts.map +0 -1
- package/dist/src/coin/cspr/transactionBuilderFactory.js +0 -116
- package/dist/src/coin/cspr/transferBuilder.d.ts +0 -39
- package/dist/src/coin/cspr/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/cspr/transferBuilder.js +0 -169
- package/dist/src/coin/cspr/undelegateBuilder.d.ts +0 -49
- package/dist/src/coin/cspr/undelegateBuilder.d.ts.map +0 -1
- package/dist/src/coin/cspr/undelegateBuilder.js +0 -175
- package/dist/src/coin/cspr/utils.d.ts +0 -189
- package/dist/src/coin/cspr/utils.d.ts.map +0 -1
- package/dist/src/coin/cspr/utils.js +0 -483
- package/dist/src/coin/cspr/walletInitializationBuilder.d.ts +0 -27
- package/dist/src/coin/cspr/walletInitializationBuilder.d.ts.map +0 -1
- package/dist/src/coin/cspr/walletInitializationBuilder.js +0 -160
- package/dist/src/mpc/curves/baseCurve.d.ts +0 -18
- package/dist/src/mpc/curves/baseCurve.d.ts.map +0 -1
- package/dist/src/mpc/curves/baseCurve.js +0 -6
- package/dist/src/mpc/curves/ed25519.d.ts +0 -17
- package/dist/src/mpc/curves/ed25519.d.ts.map +0 -1
- package/dist/src/mpc/curves/ed25519.js +0 -96
- package/dist/src/mpc/curves/index.d.ts +0 -5
- package/dist/src/mpc/curves/index.d.ts.map +0 -1
- package/dist/src/mpc/curves/index.js +0 -6
- package/dist/src/mpc/hdTree.d.ts +0 -24
- package/dist/src/mpc/hdTree.d.ts.map +0 -1
- package/dist/src/mpc/hdTree.js +0 -143
- package/dist/src/mpc/shamir.d.ts +0 -26
- package/dist/src/mpc/shamir.d.ts.map +0 -1
- package/dist/src/mpc/shamir.js +0 -87
- package/dist/src/mpc/tss.d.ts +0 -98
- package/dist/src/mpc/tss.d.ts.map +0 -1
- package/dist/src/mpc/tss.js +0 -346
- package/dist/src/mpc/util.d.ts +0 -7
- package/dist/src/mpc/util.d.ts.map +0 -1
- package/dist/src/mpc/util.js +0 -38
- package/dist/src/utils/crypto.d.ts +0 -99
- package/dist/src/utils/crypto.d.ts.map +0 -1
- package/dist/src/utils/crypto.js +0 -260
- package/dist/src/utils/ed25519KeyDeriver.d.ts +0 -49
- package/dist/src/utils/ed25519KeyDeriver.d.ts.map +0 -1
- package/dist/src/utils/ed25519KeyDeriver.js +0 -92
|
@@ -1,90 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
4
|
};
|
|
56
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
6
|
exports.StakingDeactivateBuilder = void 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
7
|
+
const assert_1 = __importDefault(require("assert"));
|
|
8
|
+
const sdk_core_1 = require("@bitgo/sdk-core");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const transactionBuilder_1 = require("./transactionBuilder");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
class StakingDeactivateBuilder extends transactionBuilder_1.TransactionBuilder {
|
|
13
|
+
constructor(_coinConfig) {
|
|
14
|
+
super(_coinConfig);
|
|
15
|
+
}
|
|
16
|
+
get transactionType() {
|
|
17
|
+
return sdk_core_1.TransactionType.StakingDeactivate;
|
|
68
18
|
}
|
|
69
|
-
Object.defineProperty(StakingDeactivateBuilder.prototype, "transactionType", {
|
|
70
|
-
get: function () {
|
|
71
|
-
return baseCoin_1.TransactionType.StakingDeactivate;
|
|
72
|
-
},
|
|
73
|
-
enumerable: false,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
19
|
/** @inheritdoc */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
for (
|
|
80
|
-
var instruction = _a[_i];
|
|
20
|
+
initBuilder(tx) {
|
|
21
|
+
super.initBuilder(tx);
|
|
22
|
+
for (const instruction of this._instructionsData) {
|
|
81
23
|
if (instruction.type === constants_1.InstructionBuilderTypes.StakingDeactivate) {
|
|
82
|
-
|
|
24
|
+
const deactivateInstruction = instruction;
|
|
83
25
|
this.sender(deactivateInstruction.params.fromAddress);
|
|
84
26
|
this.stakingAddress(deactivateInstruction.params.stakingAddress);
|
|
85
27
|
}
|
|
86
28
|
}
|
|
87
|
-
}
|
|
29
|
+
}
|
|
88
30
|
/**
|
|
89
31
|
* The staking address of the staking account.
|
|
90
32
|
*
|
|
@@ -93,38 +35,28 @@ var StakingDeactivateBuilder = /** @class */ (function (_super) {
|
|
|
93
35
|
*
|
|
94
36
|
* @see https://docs.solana.com/staking/stake-accounts#account-address
|
|
95
37
|
*/
|
|
96
|
-
|
|
38
|
+
stakingAddress(stakingAddress) {
|
|
97
39
|
utils_1.validateAddress(stakingAddress, 'stakingAddress');
|
|
98
40
|
this._stakingAddress = stakingAddress;
|
|
99
41
|
return this;
|
|
100
|
-
}
|
|
42
|
+
}
|
|
101
43
|
/** @inheritdoc */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
this._instructionsData = [stakingDeactivateData];
|
|
121
|
-
return [4 /*yield*/, _super.prototype.buildImplementation.call(this)];
|
|
122
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
return StakingDeactivateBuilder;
|
|
128
|
-
}(transactionBuilder_1.TransactionBuilder));
|
|
44
|
+
async buildImplementation() {
|
|
45
|
+
assert_1.default(this._sender, 'Sender must be set before building the transaction');
|
|
46
|
+
assert_1.default(this._stakingAddress, 'Staking address must be set before building the transaction');
|
|
47
|
+
if (this._sender === this._stakingAddress) {
|
|
48
|
+
throw new sdk_core_1.BuildTransactionError('Sender address cannot be the same as the Staking address');
|
|
49
|
+
}
|
|
50
|
+
const stakingDeactivateData = {
|
|
51
|
+
type: constants_1.InstructionBuilderTypes.StakingDeactivate,
|
|
52
|
+
params: {
|
|
53
|
+
fromAddress: this._sender,
|
|
54
|
+
stakingAddress: this._stakingAddress,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
this._instructionsData = [stakingDeactivateData];
|
|
58
|
+
return await super.buildImplementation();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
129
61
|
exports.StakingDeactivateBuilder = StakingDeactivateBuilder;
|
|
130
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Rha2luZ0RlYWN0aXZhdGVCdWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvaW4vc29sL3N0YWtpbmdEZWFjdGl2YXRlQnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFDQSxvREFBNEI7QUFFNUIsOENBQXlFO0FBQ3pFLDJDQUFzRDtBQUd0RCw2REFBMEQ7QUFDMUQsbUNBQTBDO0FBRTFDLE1BQWEsd0JBQXlCLFNBQVEsdUNBQWtCO0lBRzlELFlBQVksV0FBaUM7UUFDM0MsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0lBQ3JCLENBQUM7SUFFRCxJQUFjLGVBQWU7UUFDM0IsT0FBTywwQkFBZSxDQUFDLGlCQUFpQixDQUFDO0lBQzNDLENBQUM7SUFFRCxrQkFBa0I7SUFDbEIsV0FBVyxDQUFDLEVBQWU7UUFDekIsS0FBSyxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUN0QixLQUFLLE1BQU0sV0FBVyxJQUFJLElBQUksQ0FBQyxpQkFBaUIsRUFBRTtZQUNoRCxJQUFJLFdBQVcsQ0FBQyxJQUFJLEtBQUssbUNBQXVCLENBQUMsaUJBQWlCLEVBQUU7Z0JBQ2xFLE1BQU0scUJBQXFCLEdBQXNCLFdBQVcsQ0FBQztnQkFDN0QsSUF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2YXRlRGF0YV07XG5cbiAgICByZXR1cm4gYXdhaXQgc3VwZXIuYnVpbGRJbXBsZW1lbnRhdGlvbigpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCoin as CoinConfig } from '@bitgo/statics';
|
|
2
|
-
import { TransactionType } from '
|
|
2
|
+
import { TransactionType } from '@bitgo/sdk-core';
|
|
3
3
|
import { Transaction } from './transaction';
|
|
4
4
|
import { TransactionBuilder } from './transactionBuilder';
|
|
5
5
|
export declare class StakingWithdrawBuilder extends TransactionBuilder {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakingWithdrawBuilder.d.ts","sourceRoot":"","sources":["../../../../src/coin/sol/stakingWithdrawBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"stakingWithdrawBuilder.d.ts","sourceRoot":"","sources":["../../../../src/coin/sol/stakingWithdrawBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAyB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO1D,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI7C,SAAS,KAAK,eAAe,IAAI,eAAe,CAE/C;IAED,kBAAkB;IAClB,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI;IAYlC;;;;;;OAMG;IACH,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAM5C;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQ5B,kBAAkB;cACF,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;CAqB5D"}
|
|
@@ -1,91 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
4
|
};
|
|
56
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
6
|
exports.StakingWithdrawBuilder = void 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
7
|
+
const sdk_core_1 = require("@bitgo/sdk-core");
|
|
8
|
+
const transactionBuilder_1 = require("./transactionBuilder");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const assert_1 = __importDefault(require("assert"));
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
class StakingWithdrawBuilder extends transactionBuilder_1.TransactionBuilder {
|
|
13
|
+
constructor(_coinConfig) {
|
|
14
|
+
super(_coinConfig);
|
|
15
|
+
}
|
|
16
|
+
get transactionType() {
|
|
17
|
+
return sdk_core_1.TransactionType.StakingWithdraw;
|
|
68
18
|
}
|
|
69
|
-
Object.defineProperty(StakingWithdrawBuilder.prototype, "transactionType", {
|
|
70
|
-
get: function () {
|
|
71
|
-
return baseCoin_1.TransactionType.StakingWithdraw;
|
|
72
|
-
},
|
|
73
|
-
enumerable: false,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
19
|
/** @inheritdoc */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
for (
|
|
80
|
-
var instruction = _a[_i];
|
|
20
|
+
initBuilder(tx) {
|
|
21
|
+
super.initBuilder(tx);
|
|
22
|
+
for (const instruction of this._instructionsData) {
|
|
81
23
|
if (instruction.type === constants_1.InstructionBuilderTypes.StakingWithdraw) {
|
|
82
|
-
|
|
24
|
+
const withdrawInstruction = instruction;
|
|
83
25
|
this.sender(withdrawInstruction.params.fromAddress);
|
|
84
26
|
this.stakingAddress(withdrawInstruction.params.stakingAddress);
|
|
85
27
|
this.amount(withdrawInstruction.params.amount);
|
|
86
28
|
}
|
|
87
29
|
}
|
|
88
|
-
}
|
|
30
|
+
}
|
|
89
31
|
/**
|
|
90
32
|
* The address of the staking account.
|
|
91
33
|
*
|
|
@@ -93,11 +35,11 @@ var StakingWithdrawBuilder = /** @class */ (function (_super) {
|
|
|
93
35
|
* @returns {StakeBuilder} This staking builder.
|
|
94
36
|
*
|
|
95
37
|
*/
|
|
96
|
-
|
|
38
|
+
stakingAddress(stakingAddress) {
|
|
97
39
|
utils_1.validateAddress(stakingAddress, 'stakingAddress');
|
|
98
40
|
this._stakingAddress = stakingAddress;
|
|
99
41
|
return this;
|
|
100
|
-
}
|
|
42
|
+
}
|
|
101
43
|
/**
|
|
102
44
|
* The amount to withdraw expressed in Lamports, 1 SOL = 1_000_000_000 lamports
|
|
103
45
|
*
|
|
@@ -105,42 +47,32 @@ var StakingWithdrawBuilder = /** @class */ (function (_super) {
|
|
|
105
47
|
* @returns {StakeBuilder} This staking builder.
|
|
106
48
|
*
|
|
107
49
|
*/
|
|
108
|
-
|
|
50
|
+
amount(amount) {
|
|
109
51
|
if (!utils_1.isValidStakingAmount(amount)) {
|
|
110
|
-
throw new
|
|
52
|
+
throw new sdk_core_1.BuildTransactionError('Value cannot be zero or less');
|
|
111
53
|
}
|
|
112
54
|
this._amount = amount;
|
|
113
55
|
return this;
|
|
114
|
-
}
|
|
56
|
+
}
|
|
115
57
|
/** @inheritdoc */
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
this._instructionsData = [stakingWithdrawData];
|
|
137
|
-
return [4 /*yield*/, _super.prototype.buildImplementation.call(this)];
|
|
138
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
return StakingWithdrawBuilder;
|
|
144
|
-
}(transactionBuilder_1.TransactionBuilder));
|
|
58
|
+
async buildImplementation() {
|
|
59
|
+
assert_1.default(this._sender, 'Sender must be set before building the transaction');
|
|
60
|
+
assert_1.default(this._stakingAddress, 'Staking address must be set before building the transaction');
|
|
61
|
+
assert_1.default(this._amount, 'Amount must be set before building the transaction');
|
|
62
|
+
if (this._sender === this._stakingAddress) {
|
|
63
|
+
throw new sdk_core_1.BuildTransactionError('Sender address cannot be the same as the Staking address');
|
|
64
|
+
}
|
|
65
|
+
const stakingWithdrawData = {
|
|
66
|
+
type: constants_1.InstructionBuilderTypes.StakingWithdraw,
|
|
67
|
+
params: {
|
|
68
|
+
fromAddress: this._sender,
|
|
69
|
+
stakingAddress: this._stakingAddress,
|
|
70
|
+
amount: this._amount,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
this._instructionsData = [stakingWithdrawData];
|
|
74
|
+
return await super.buildImplementation();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
145
77
|
exports.StakingWithdrawBuilder = StakingWithdrawBuilder;
|
|
146
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3Rha2luZ1dpdGhkcmF3QnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb2luL3NvbC9zdGFraW5nV2l0aGRyYXdCdWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUNBLDhDQUF5RTtBQUV6RSw2REFBMEQ7QUFDMUQsMkNBQXNEO0FBRXRELG9EQUE0QjtBQUU1QixtQ0FBZ0U7QUFFaEUsTUFBYSxzQkFBdUIsU0FBUSx1Q0FBa0I7SUFJNUQsWUFBWSxXQUFpQztRQUMzQyxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7SUFDckIsQ0FBQztJQUVELElBQWMsZUFBZTtRQUMzQixP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