@bitgo/account-lib 2.20.0-rc.3 → 2.20.0-rc.32
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/.mocharc.js +1 -1
- package/CHANGELOG.md +311 -0
- package/dist/resources/README.md +8 -2
- package/dist/resources/trx/protobuf/tron.js +5 -1
- 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 +49 -69
- 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 +2 -3
- package/dist/src/coin/dot/keyPair.d.ts.map +1 -1
- package/dist/src/coin/dot/keyPair.js +34 -56
- 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 +55 -73
- 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 +154 -170
- 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 +133 -205
- 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 +71 -88
- 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 +9 -3
- package/dist/src/coin/dot/utils.d.ts.map +1 -1
- package/dist/src/coin/dot/utils.js +112 -102
- 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.d.ts +2 -4
- package/dist/src/coin/etc/index.d.ts.map +1 -1
- package/dist/src/coin/etc/index.js +7 -9
- 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.d.ts +1 -1
- package/dist/src/coin/etc/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/etc/transferBuilder.js +8 -28
- package/dist/src/coin/etc/utils.d.ts +1 -2
- package/dist/src/coin/etc/utils.d.ts.map +1 -1
- package/dist/src/coin/etc/utils.js +10 -50
- 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/coinTransferBuilder.d.ts +46 -0
- package/dist/src/coin/hbar/coinTransferBuilder.d.ts.map +1 -0
- package/dist/src/coin/hbar/coinTransferBuilder.js +143 -0
- package/dist/src/coin/hbar/constants.d.ts +8 -0
- package/dist/src/coin/hbar/constants.d.ts.map +1 -0
- package/dist/src/coin/hbar/constants.js +12 -0
- package/dist/src/coin/hbar/iface.d.ts +49 -0
- package/dist/src/coin/hbar/iface.d.ts.map +1 -0
- package/dist/src/coin/hbar/iface.js +3 -0
- package/dist/src/coin/hbar/index.d.ts +3 -0
- package/dist/src/coin/hbar/index.d.ts.map +1 -1
- package/dist/src/coin/hbar/index.js +9 -3
- package/dist/src/coin/hbar/keyPair.d.ts +2 -3
- package/dist/src/coin/hbar/keyPair.d.ts.map +1 -1
- package/dist/src/coin/hbar/keyPair.js +31 -50
- package/dist/src/coin/hbar/tokenAssociateBuilder.d.ts +38 -0
- package/dist/src/coin/hbar/tokenAssociateBuilder.d.ts.map +1 -0
- package/dist/src/coin/hbar/tokenAssociateBuilder.js +126 -0
- package/dist/src/coin/hbar/tokenTransferBuilder.d.ts +25 -0
- package/dist/src/coin/hbar/tokenTransferBuilder.d.ts.map +1 -0
- package/dist/src/coin/hbar/tokenTransferBuilder.js +115 -0
- package/dist/src/coin/hbar/transaction.d.ts +30 -23
- package/dist/src/coin/hbar/transaction.d.ts.map +1 -1
- package/dist/src/coin/hbar/transaction.js +197 -193
- package/dist/src/coin/hbar/transactionBuilder.d.ts +23 -25
- package/dist/src/coin/hbar/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/transactionBuilder.js +146 -223
- package/dist/src/coin/hbar/transactionBuilderFactory.d.ts +14 -4
- package/dist/src/coin/hbar/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/hbar/transactionBuilderFactory.js +50 -57
- package/dist/src/coin/hbar/transferBuilder.d.ts +9 -29
- package/dist/src/coin/hbar/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/transferBuilder.js +37 -157
- package/dist/src/coin/hbar/utils.d.ts +99 -58
- package/dist/src/coin/hbar/utils.d.ts.map +1 -1
- package/dist/src/coin/hbar/utils.js +183 -105
- package/dist/src/coin/hbar/walletInitializationBuilder.d.ts +5 -5
- package/dist/src/coin/hbar/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/hbar/walletInitializationBuilder.js +68 -113
- 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.js +2 -2
- 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 +6 -0
- package/dist/src/coin/polygon/index.d.ts.map +1 -0
- package/dist/src/coin/{celo → polygon}/index.js +7 -9
- 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/{avaxc → polygon}/transactionBuilder.d.ts +1 -1
- package/dist/src/coin/polygon/transactionBuilder.d.ts.map +1 -0
- package/dist/src/coin/polygon/transactionBuilder.js +44 -0
- package/dist/src/coin/{avaxc → polygon}/transferBuilder.d.ts +4 -2
- 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 +17 -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.d.ts +2 -4
- package/dist/src/coin/rbtc/index.d.ts.map +1 -1
- package/dist/src/coin/rbtc/index.js +7 -9
- 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.d.ts +1 -1
- package/dist/src/coin/rbtc/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/rbtc/transferBuilder.js +8 -28
- package/dist/src/coin/rbtc/utils.d.ts +1 -2
- package/dist/src/coin/rbtc/utils.d.ts.map +1 -1
- package/dist/src/coin/rbtc/utils.js +10 -50
- package/dist/src/coin/sol/ataInitializationBuilder.d.ts +12 -3
- package/dist/src/coin/sol/ataInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/ataInitializationBuilder.js +74 -126
- package/dist/src/coin/sol/ataInitializationTransaction.d.ts.map +1 -1
- package/dist/src/coin/sol/ataInitializationTransaction.js +36 -59
- package/dist/src/coin/sol/iface.d.ts +2 -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 +72 -70
- 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/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/index.d.ts +24 -16
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +58 -50
- 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 +29398 -22560
- package/package.json +25 -58
- 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/resources/hbar/protobuf/BasicTypes.proto +0 -424
- package/dist/resources/hbar/protobuf/CryptoCreate.proto +0 -47
- package/dist/resources/hbar/protobuf/CryptoTransfer.proto +0 -33
- package/dist/resources/hbar/protobuf/Duration.proto +0 -28
- package/dist/resources/hbar/protobuf/Timestamp.proto +0 -34
- package/dist/resources/hbar/protobuf/Transaction.proto +0 -35
- package/dist/resources/hbar/protobuf/TransactionBody.proto +0 -24
- package/dist/resources/hbar/protobuf/TransactionContents.proto +0 -33
- package/dist/resources/hbar/protobuf/hedera.d.ts +0 -4612
- package/dist/resources/hbar/protobuf/hedera.js +0 -12192
- 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/avaxc/index.d.ts +0 -8
- package/dist/src/coin/avaxc/index.d.ts.map +0 -1
- package/dist/src/coin/avaxc/index.js +0 -35
- package/dist/src/coin/avaxc/keyPair.d.ts +0 -27
- package/dist/src/coin/avaxc/keyPair.d.ts.map +0 -1
- package/dist/src/coin/avaxc/keyPair.js +0 -102
- package/dist/src/coin/avaxc/resources.d.ts +0 -12
- package/dist/src/coin/avaxc/resources.d.ts.map +0 -1
- package/dist/src/coin/avaxc/resources.js +0 -27
- package/dist/src/coin/avaxc/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/avaxc/transactionBuilder.js +0 -64
- package/dist/src/coin/avaxc/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/avaxc/transferBuilder.js +0 -45
- package/dist/src/coin/avaxc/utils.d.ts +0 -39
- package/dist/src/coin/avaxc/utils.d.ts.map +0 -1
- package/dist/src/coin/avaxc/utils.js +0 -110
- package/dist/src/coin/avaxc/walletUtil.d.ts +0 -22
- package/dist/src/coin/avaxc/walletUtil.d.ts.map +0 -1
- package/dist/src/coin/avaxc/walletUtil.js +0 -62
- 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/celo/index.d.ts +0 -8
- package/dist/src/coin/celo/index.d.ts.map +0 -1
- package/dist/src/coin/celo/resources.d.ts +0 -10
- package/dist/src/coin/celo/resources.d.ts.map +0 -1
- package/dist/src/coin/celo/resources.js +0 -26
- package/dist/src/coin/celo/stakingBuilder.d.ts +0 -91
- package/dist/src/coin/celo/stakingBuilder.d.ts.map +0 -1
- package/dist/src/coin/celo/stakingBuilder.js +0 -279
- package/dist/src/coin/celo/stakingCall.d.ts +0 -7
- package/dist/src/coin/celo/stakingCall.d.ts.map +0 -1
- package/dist/src/coin/celo/stakingCall.js +0 -31
- package/dist/src/coin/celo/stakingUtils.d.ts +0 -15
- package/dist/src/coin/celo/stakingUtils.d.ts.map +0 -1
- package/dist/src/coin/celo/stakingUtils.js +0 -99
- package/dist/src/coin/celo/transaction.d.ts +0 -10
- package/dist/src/coin/celo/transaction.d.ts.map +0 -1
- package/dist/src/coin/celo/transaction.js +0 -57
- package/dist/src/coin/celo/transactionBuilder.d.ts +0 -86
- package/dist/src/coin/celo/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/celo/transactionBuilder.js +0 -247
- package/dist/src/coin/celo/transferBuilder.d.ts +0 -19
- package/dist/src/coin/celo/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/celo/transferBuilder.js +0 -47
- package/dist/src/coin/celo/types.d.ts +0 -52
- package/dist/src/coin/celo/types.d.ts.map +0 -1
- package/dist/src/coin/celo/types.js +0 -276
- package/dist/src/coin/celo/utils.d.ts +0 -18
- package/dist/src/coin/celo/utils.d.ts.map +0 -1
- package/dist/src/coin/celo/utils.js +0 -99
- 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/coin/eth/contractCall.d.ts +0 -8
- package/dist/src/coin/eth/contractCall.d.ts.map +0 -1
- package/dist/src/coin/eth/contractCall.js +0 -18
- package/dist/src/coin/eth/iface.d.ts +0 -122
- package/dist/src/coin/eth/iface.d.ts.map +0 -1
- package/dist/src/coin/eth/iface.js +0 -8
- package/dist/src/coin/eth/index.d.ts +0 -10
- package/dist/src/coin/eth/index.d.ts.map +0 -1
- package/dist/src/coin/eth/index.js +0 -39
- package/dist/src/coin/eth/keyPair.d.ts +0 -27
- package/dist/src/coin/eth/keyPair.d.ts.map +0 -1
- package/dist/src/coin/eth/keyPair.js +0 -104
- package/dist/src/coin/eth/transaction.d.ts +0 -65
- package/dist/src/coin/eth/transaction.d.ts.map +0 -1
- package/dist/src/coin/eth/transaction.js +0 -203
- package/dist/src/coin/eth/transactionBuilder.d.ts +0 -195
- package/dist/src/coin/eth/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/eth/transactionBuilder.js +0 -695
- package/dist/src/coin/eth/transferBuilder/baseNFTTransferBuilder.d.ts +0 -47
- package/dist/src/coin/eth/transferBuilder/baseNFTTransferBuilder.d.ts.map +0 -1
- package/dist/src/coin/eth/transferBuilder/baseNFTTransferBuilder.js +0 -114
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC1155.d.ts +0 -14
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC1155.d.ts.map +0 -1
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC1155.js +0 -100
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC721.d.ts +0 -13
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC721.d.ts.map +0 -1
- package/dist/src/coin/eth/transferBuilder/transferBuilderERC721.js +0 -85
- package/dist/src/coin/eth/transferBuilder.d.ts +0 -65
- package/dist/src/coin/eth/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/eth/transferBuilder.js +0 -198
- package/dist/src/coin/eth/types.d.ts +0 -39
- package/dist/src/coin/eth/types.d.ts.map +0 -1
- package/dist/src/coin/eth/types.js +0 -139
- package/dist/src/coin/eth/utils.d.ts +0 -201
- package/dist/src/coin/eth/utils.d.ts.map +0 -1
- package/dist/src/coin/eth/utils.js +0 -533
- package/dist/src/coin/eth/walletUtil.d.ts +0 -19
- package/dist/src/coin/eth/walletUtil.d.ts.map +0 -1
- package/dist/src/coin/eth/walletUtil.js +0 -29
- package/dist/src/coin/hbar/ifaces.d.ts +0 -26
- package/dist/src/coin/hbar/ifaces.d.ts.map +0 -1
- package/dist/src/coin/hbar/ifaces.js +0 -3
- package/dist/src/coin/stx/abstractContractBuilder.d.ts +0 -19
- package/dist/src/coin/stx/abstractContractBuilder.d.ts.map +0 -1
- package/dist/src/coin/stx/abstractContractBuilder.js +0 -140
- package/dist/src/coin/stx/constants.d.ts +0 -8
- package/dist/src/coin/stx/constants.d.ts.map +0 -1
- package/dist/src/coin/stx/constants.js +0 -19
- package/dist/src/coin/stx/contractBuilder.d.ts +0 -33
- package/dist/src/coin/stx/contractBuilder.d.ts.map +0 -1
- package/dist/src/coin/stx/contractBuilder.js +0 -135
- package/dist/src/coin/stx/iface.d.ts +0 -48
- package/dist/src/coin/stx/iface.d.ts.map +0 -1
- package/dist/src/coin/stx/iface.js +0 -3
- package/dist/src/coin/stx/index.d.ts +0 -6
- package/dist/src/coin/stx/index.d.ts.map +0 -1
- package/dist/src/coin/stx/index.js +0 -32
- package/dist/src/coin/stx/keyPair.d.ts +0 -56
- package/dist/src/coin/stx/keyPair.d.ts.map +0 -1
- package/dist/src/coin/stx/keyPair.js +0 -163
- package/dist/src/coin/stx/sendmanyBuilder.d.ts +0 -23
- package/dist/src/coin/stx/sendmanyBuilder.d.ts.map +0 -1
- package/dist/src/coin/stx/sendmanyBuilder.js +0 -140
- package/dist/src/coin/stx/transaction.d.ts +0 -50
- package/dist/src/coin/stx/transaction.d.ts.map +0 -1
- package/dist/src/coin/stx/transaction.js +0 -306
- package/dist/src/coin/stx/transactionBuilder.d.ts +0 -87
- package/dist/src/coin/stx/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/stx/transactionBuilder.js +0 -360
- package/dist/src/coin/stx/transactionBuilderFactory.d.ts +0 -30
- package/dist/src/coin/stx/transactionBuilderFactory.d.ts.map +0 -1
- package/dist/src/coin/stx/transactionBuilderFactory.js +0 -99
- package/dist/src/coin/stx/transferBuilder.d.ts +0 -30
- package/dist/src/coin/stx/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/stx/transferBuilder.js +0 -169
- package/dist/src/coin/stx/utils.d.ts +0 -207
- package/dist/src/coin/stx/utils.d.ts.map +0 -1
- package/dist/src/coin/stx/utils.js +0 -510
- package/dist/src/coin/xtz/address.d.ts +0 -8
- package/dist/src/coin/xtz/address.d.ts.map +0 -1
- package/dist/src/coin/xtz/address.js +0 -13
- package/dist/src/coin/xtz/iface.d.ts +0 -81
- package/dist/src/coin/xtz/iface.d.ts.map +0 -1
- package/dist/src/coin/xtz/iface.js +0 -3
- package/dist/src/coin/xtz/index.d.ts +0 -8
- package/dist/src/coin/xtz/index.d.ts.map +0 -1
- package/dist/src/coin/xtz/index.js +0 -37
- package/dist/src/coin/xtz/keyPair.d.ts +0 -41
- package/dist/src/coin/xtz/keyPair.d.ts.map +0 -1
- package/dist/src/coin/xtz/keyPair.js +0 -156
- package/dist/src/coin/xtz/multisigUtils.d.ts +0 -134
- package/dist/src/coin/xtz/multisigUtils.d.ts.map +0 -1
- package/dist/src/coin/xtz/multisigUtils.js +0 -1193
- package/dist/src/coin/xtz/transaction.d.ts +0 -120
- package/dist/src/coin/xtz/transaction.d.ts.map +0 -1
- package/dist/src/coin/xtz/transaction.js +0 -485
- package/dist/src/coin/xtz/transactionBuilder.d.ts +0 -172
- package/dist/src/coin/xtz/transactionBuilder.d.ts.map +0 -1
- package/dist/src/coin/xtz/transactionBuilder.js +0 -588
- package/dist/src/coin/xtz/transferBuilder.d.ts +0 -24
- package/dist/src/coin/xtz/transferBuilder.d.ts.map +0 -1
- package/dist/src/coin/xtz/transferBuilder.js +0 -67
- package/dist/src/coin/xtz/utils.d.ts +0 -265
- package/dist/src/coin/xtz/utils.d.ts.map +0 -1
- package/dist/src/coin/xtz/utils.js +0 -531
- 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
- package/resources/hbar/protobuf/BasicTypes.proto +0 -424
- package/resources/hbar/protobuf/CryptoCreate.proto +0 -47
- package/resources/hbar/protobuf/CryptoTransfer.proto +0 -33
- package/resources/hbar/protobuf/Duration.proto +0 -28
- package/resources/hbar/protobuf/Timestamp.proto +0 -34
- package/resources/hbar/protobuf/Transaction.proto +0 -35
- package/resources/hbar/protobuf/TransactionBody.proto +0 -24
- package/resources/hbar/protobuf/TransactionContents.proto +0 -33
- package/resources/hbar/protobuf/hedera.d.ts +0 -4612
- package/resources/hbar/protobuf/hedera.js +0 -12192
|
@@ -1,169 +0,0 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
-
function step(op) {
|
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (_) try {
|
|
44
|
-
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;
|
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
-
switch (op[0]) {
|
|
47
|
-
case 0: case 1: t = op; break;
|
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
-
default:
|
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
-
if (t[2]) _.ops.pop();
|
|
57
|
-
_.trys.pop(); continue;
|
|
58
|
-
}
|
|
59
|
-
op = body.call(thisArg, _);
|
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
-
};
|
|
67
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
-
exports.TransferBuilder = void 0;
|
|
69
|
-
var bn_js_1 = __importDefault(require("bn.js"));
|
|
70
|
-
var transactions_1 = require("@stacks/transactions");
|
|
71
|
-
var baseCoin_1 = require("../baseCoin");
|
|
72
|
-
var errors_1 = require("../baseCoin/errors");
|
|
73
|
-
var transactionBuilder_1 = require("./transactionBuilder");
|
|
74
|
-
var utils_1 = require("./utils");
|
|
75
|
-
var TransferBuilder = /** @class */ (function (_super) {
|
|
76
|
-
__extends(TransferBuilder, _super);
|
|
77
|
-
function TransferBuilder(_coinConfig) {
|
|
78
|
-
return _super.call(this, _coinConfig) || this;
|
|
79
|
-
}
|
|
80
|
-
TransferBuilder.prototype.initBuilder = function (tx) {
|
|
81
|
-
var txData = tx.toJson();
|
|
82
|
-
if (txData.payload === undefined) {
|
|
83
|
-
throw new errors_1.InvalidTransactionError('payload must not be undefined');
|
|
84
|
-
}
|
|
85
|
-
if (txData.payload.payloadType === transactions_1.PayloadType.TokenTransfer) {
|
|
86
|
-
this.to(txData.payload.to);
|
|
87
|
-
this.amount(txData.payload.amount);
|
|
88
|
-
if (txData.payload.memo) {
|
|
89
|
-
this.memo(txData.payload.memo);
|
|
90
|
-
}
|
|
91
|
-
_super.prototype.initBuilder.call(this, tx);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
throw new errors_1.BuildTransactionError('Transaction should be transfer');
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
/** @inheritdoc */
|
|
98
|
-
TransferBuilder.prototype.buildImplementation = function () {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
var _a;
|
|
101
|
-
return __generator(this, function (_b) {
|
|
102
|
-
switch (_b.label) {
|
|
103
|
-
case 0:
|
|
104
|
-
this._options = this.buildTokenTransferOptions();
|
|
105
|
-
this.transaction.setTransactionType(baseCoin_1.TransactionType.Send);
|
|
106
|
-
_a = this.transaction;
|
|
107
|
-
return [4 /*yield*/, transactions_1.makeUnsignedSTXTokenTransfer(this._options)];
|
|
108
|
-
case 1:
|
|
109
|
-
_a.stxTransaction = _b.sent();
|
|
110
|
-
return [4 /*yield*/, _super.prototype.buildImplementation.call(this)];
|
|
111
|
-
case 2: return [2 /*return*/, _b.sent()];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
TransferBuilder.prototype.buildTokenTransferOptions = function () {
|
|
117
|
-
var defaultOpts = {
|
|
118
|
-
recipient: this._toAddress,
|
|
119
|
-
amount: this._amount,
|
|
120
|
-
memo: this._memo,
|
|
121
|
-
anchorMode: this._anchorMode,
|
|
122
|
-
network: this._network,
|
|
123
|
-
fee: new bn_js_1.default(this._fee.fee),
|
|
124
|
-
nonce: new bn_js_1.default(this._nonce),
|
|
125
|
-
};
|
|
126
|
-
if (this._fromPubKeys.length > 0) {
|
|
127
|
-
if (this._fromPubKeys.length === 1) {
|
|
128
|
-
return __assign(__assign({}, defaultOpts), { publicKey: this._fromPubKeys[0] });
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
return __assign(__assign({}, defaultOpts), { publicKeys: this._fromPubKeys, numSignatures: this._numberSignatures });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
throw new errors_1.InvalidParameterValueError('supply at least 1 public key');
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
// region Transfer fields
|
|
139
|
-
/**
|
|
140
|
-
* Set the destination address where the funds will be sent,
|
|
141
|
-
* it may take the format `'<shard>.<realm>.<account>'` or `'<account>'`
|
|
142
|
-
*
|
|
143
|
-
* @param {string} address the address to transfer funds to
|
|
144
|
-
* @returns {TransferBuilder} the builder with the new parameter set
|
|
145
|
-
*/
|
|
146
|
-
TransferBuilder.prototype.to = function (address) {
|
|
147
|
-
if (!utils_1.isValidAddress(address)) {
|
|
148
|
-
throw new errors_1.InvalidParameterValueError('Invalid address');
|
|
149
|
-
}
|
|
150
|
-
this._toAddress = address;
|
|
151
|
-
return this;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Set the amount to be transferred
|
|
155
|
-
*
|
|
156
|
-
* @param {string} amount amount to transfer in tinyBars (there are 100,000,000 tinyBars in one Hbar)
|
|
157
|
-
* @returns {TransferBuilder} the builder with the new parameter set
|
|
158
|
-
*/
|
|
159
|
-
TransferBuilder.prototype.amount = function (amount) {
|
|
160
|
-
if (!utils_1.isValidAmount(amount)) {
|
|
161
|
-
throw new errors_1.InvalidParameterValueError('Invalid amount');
|
|
162
|
-
}
|
|
163
|
-
this._amount = new bn_js_1.default(amount);
|
|
164
|
-
return this;
|
|
165
|
-
};
|
|
166
|
-
return TransferBuilder;
|
|
167
|
-
}(transactionBuilder_1.TransactionBuilder));
|
|
168
|
-
exports.TransferBuilder = TransferBuilder;
|
|
169
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmZXJCdWlsZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvaW4vc3R4L3RyYW5zZmVyQnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUNBLGdEQUEyQjtBQUMzQixxREFNOEI7QUFDOUIsd0NBQThDO0FBQzlDLDZDQUFnSDtBQUVoSCwyREFBMEQ7QUFDMUQsaUNBQXdEO0FBRXhEO0lBQXFDLG1DQUFrQjtJQUtyRCx5QkFBWSxXQUFpQztlQUMzQyxrQkFBTSxXQUFXLENBQUM7SUFDcEIsQ0FBQztJQUVELHFDQUFXLEdBQVgsVUFBWSxFQUFlO1FBQ3pCLElBQU0sTUFBTSxHQUFHLEVBQUUsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUMzQixJQUFJLE1BQU0sQ0FBQyxPQUFPLEtBQUssU0FBUyxFQUFFO1lBQ2hDLE1BQU0sSUFBSSxnQ0FBdUIsQ0FBQywrQkFBK0IsQ0FBQyxDQUFDO1NBQ3BFO1FBQ0QsSUFBSSxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsS0FBSywwQkFBVyxDQUFDLGFBQWEsRUFBRTtZQUM1RCxJQUFJLENBQUMsRUFBRSxDQUFDLE1BQU0sQ0FBQyxPQ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Jlc3M6IHN0cmluZyk6IHRoaXMge1xuICAgIGlmICghaXNWYWxpZEFkZHJlc3MoYWRkcmVzcykpIHtcbiAgICAgIHRocm93IG5ldyBJbnZhbGlkUGFyYW1ldGVyVmFsdWVFcnJvcignSW52YWxpZCBhZGRyZXNzJyk7XG4gICAgfVxuICAgIHRoaXMuX3RvQWRkcmVzcyA9IGFkZHJlc3M7XG4gICAgcmV0dXJuIHRoaXM7XG4gIH1cblxuICAvKipcbiAgICogU2V0IHRoZSBhbW91bnQgdG8gYmUgdHJhbnNmZXJyZWRcbiAgICpcbiAgICogQHBhcmFtIHtzdHJpbmd9IGFtb3VudCBhbW91bnQgdG8gdHJhbnNmZXIgaW4gdGlueUJhcnMgKHRoZXJlIGFyZSAxMDAsMDAwLDAwMCB0aW55QmFycyBpbiBvbmUgSGJhcilcbiAgICogQHJldHVybnMge1RyYW5zZmVyQnVpbGRlcn0gdGhlIGJ1aWxkZXIgd2l0aCB0aGUgbmV3IHBhcmFtZXRlciBzZXRcbiAgICovXG4gIGFtb3VudChhbW91bnQ6IHN0cmluZyk6IHRoaXMge1xuICAgIGlmICghaXNWYWxpZEFtb3VudChhbW91bnQpKSB7XG4gICAgICB0aHJvdyBuZXcgSW52YWxpZFBhcmFtZXRlclZhbHVlRXJyb3IoJ0ludmFsaWQgYW1vdW50Jyk7XG4gICAgfVxuICAgIHRoaXMuX2Ftb3VudCA9IG5ldyBCaWdOdW0oYW1vdW50KTtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxufVxuIl19
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { AddressHashMode, AddressVersion, ClarityValue, StacksTransaction } from '@stacks/transactions';
|
|
3
|
-
import { AddressDetails, SendParams } from './iface';
|
|
4
|
-
import { KeyPair } from '.';
|
|
5
|
-
import { StacksNetwork as BitgoStacksNetwork } from '@bitgo/statics';
|
|
6
|
-
/**
|
|
7
|
-
* Encodes a buffer as a "0x" prefixed lower-case hex string.
|
|
8
|
-
*
|
|
9
|
-
* @param {Buffer} buff - a buffer with a hexadecimal string
|
|
10
|
-
* @returns {string} - the hexadecimal string prefixed with "0x"
|
|
11
|
-
*/
|
|
12
|
-
export declare function bufferToHexPrefixString(buff: Buffer): string;
|
|
13
|
-
/**
|
|
14
|
-
* Remove the "0x" prefix from the given string, if present.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} hex - a hexadecimal string
|
|
17
|
-
* @returns {string} - the hexadecimal string without a leading "0x"
|
|
18
|
-
*/
|
|
19
|
-
export declare function removeHexPrefix(hex: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* @param tx
|
|
22
|
-
*/
|
|
23
|
-
export declare function getTxSenderAddress(tx: StacksTransaction): string;
|
|
24
|
-
/**
|
|
25
|
-
* Returns whether or not the string is a valid amount number
|
|
26
|
-
*
|
|
27
|
-
* @param {string} amount - the string to validate
|
|
28
|
-
* @returns {boolean} - the validation result
|
|
29
|
-
*/
|
|
30
|
-
export declare function isValidAmount(amount: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Returns whether or not the string is a valid protocol address
|
|
33
|
-
*
|
|
34
|
-
* @param {string} address - the address to be validated
|
|
35
|
-
* @returns {boolean} - the validation result
|
|
36
|
-
*/
|
|
37
|
-
export declare function isValidAddress(address: string): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Returns whether or not the string is a valid protocol transaction id or not.
|
|
40
|
-
*
|
|
41
|
-
* A valid transaction id is a SHA-512/256 hash of a serialized transaction; see
|
|
42
|
-
* the txidFromData function in @stacks/transaction:
|
|
43
|
-
* https://github.com/blockstack/stacks.js/blob/master/packages/transactions/src/utils.ts#L97
|
|
44
|
-
*
|
|
45
|
-
* @param {string} txId - the transaction id to be validated
|
|
46
|
-
* @returns {boolean} - the validation result
|
|
47
|
-
*/
|
|
48
|
-
export declare function isValidTransactionId(txId: string): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Returns whether or not the string is a valid protocol public key or
|
|
51
|
-
* extended public key.
|
|
52
|
-
*
|
|
53
|
-
* The key format is documented at
|
|
54
|
-
* https://github.com/stacksgov/sips/blob/main/sips/sip-005/sip-005-blocks-and-transactions.md#transaction-authorization
|
|
55
|
-
*
|
|
56
|
-
* @param {string} pub - the public key to be validated
|
|
57
|
-
* @returns {boolean} - the validation result
|
|
58
|
-
*/
|
|
59
|
-
export declare function isValidPublicKey(pub: string): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Returns whether or not the string is a valid protocol private key, or extended
|
|
62
|
-
* private key.
|
|
63
|
-
*
|
|
64
|
-
* The protocol key format is described in the @stacks/transactions npm package, in the
|
|
65
|
-
* createStacksPrivateKey function:
|
|
66
|
-
* https://github.com/blockstack/stacks.js/blob/master/packages/transactions/src/keys.ts#L125
|
|
67
|
-
*
|
|
68
|
-
* @param {string} prv - the private key (or extended private key) to be validated
|
|
69
|
-
* @returns {boolean} - the validation result
|
|
70
|
-
*/
|
|
71
|
-
export declare function isValidPrivateKey(prv: string): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Checks if raw transaction can be deserialized
|
|
74
|
-
*
|
|
75
|
-
* @param {unknown} rawTransaction - transaction in raw hex format
|
|
76
|
-
* @returns {boolean} - the validation result
|
|
77
|
-
*/
|
|
78
|
-
export declare function isValidRawTransaction(rawTransaction: unknown): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Returns whether or not the memo string is valid
|
|
81
|
-
*
|
|
82
|
-
* @param {string} memo - the string to be validated
|
|
83
|
-
* @returns {boolean} - the validation result
|
|
84
|
-
*/
|
|
85
|
-
export declare function isValidMemo(memo: string): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Checks for valid contract address
|
|
88
|
-
*
|
|
89
|
-
* @param {string} addr - contract deployer address
|
|
90
|
-
* @param {BitgoStacksNetwork} network - network object
|
|
91
|
-
* @returns {boolean} - the validation result
|
|
92
|
-
*/
|
|
93
|
-
export declare function isValidContractAddress(addr: string, network: BitgoStacksNetwork): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Check if the name is one of valid contract names
|
|
96
|
-
*
|
|
97
|
-
* @param {string} name - function name
|
|
98
|
-
* @returns {boolean} - validation result
|
|
99
|
-
*/
|
|
100
|
-
export declare function isValidContractFunctionName(name: string): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Unpads a memo string, so it removes nulls.
|
|
103
|
-
*
|
|
104
|
-
* Useful when memo is fill up the length. Result is becomes readable.
|
|
105
|
-
*
|
|
106
|
-
* @param {string} memo - the string to be validated
|
|
107
|
-
* @returns {boolean} - the validation result
|
|
108
|
-
*/
|
|
109
|
-
export declare function unpadMemo(memo: string): string;
|
|
110
|
-
/**
|
|
111
|
-
* Generate a multisig address from multiple STX public keys
|
|
112
|
-
*
|
|
113
|
-
* @param {string[]} pubKeys - list of public keys as strings
|
|
114
|
-
* @param {AddressVersion} addressVersion - MainnetMultiSig, TestnetMultiSig
|
|
115
|
-
* @param {AddressHashMode} addressHashMode - SerializeP2SH
|
|
116
|
-
* @param {number} [signaturesRequired] - number of signatures required, default value its 2
|
|
117
|
-
* @returns {address: string, hash160: string} - a multisig address
|
|
118
|
-
*/
|
|
119
|
-
export declare function getSTXAddressFromPubKeys(pubKeys: string[], addressVersion?: AddressVersion, addressHashMode?: AddressHashMode, signaturesRequired?: number): {
|
|
120
|
-
address: string;
|
|
121
|
-
hash160: string;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* signs a string message
|
|
125
|
-
*
|
|
126
|
-
* @param keyPair
|
|
127
|
-
* @param data - message to be signed
|
|
128
|
-
* @returns signed message string
|
|
129
|
-
*/
|
|
130
|
-
export declare function signMessage(keyPair: KeyPair, data: string): string;
|
|
131
|
-
/**
|
|
132
|
-
* Verifies a signed message
|
|
133
|
-
*
|
|
134
|
-
* The signature must be 130 bytes long -- see RECOVERABLE_ECDSA_SIG_LENGTH_BYTES
|
|
135
|
-
* in @stacks/transactions/src/constants.ts
|
|
136
|
-
*
|
|
137
|
-
* @param {string} message - message to verify the signature
|
|
138
|
-
* @param {string} signature - signature to verify
|
|
139
|
-
* @param {string} publicKey - public key as hex string used to verify the signature
|
|
140
|
-
* @returns {boolean} - verification result
|
|
141
|
-
*/
|
|
142
|
-
export declare function verifySignature(message: string, signature: string, publicKey: string): boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Process address into address and memo id
|
|
145
|
-
*
|
|
146
|
-
* @param {string} address the address to process
|
|
147
|
-
* @returns {Object} object containing address and memo id
|
|
148
|
-
*/
|
|
149
|
-
export declare function getAddressDetails(address: string): AddressDetails;
|
|
150
|
-
/**
|
|
151
|
-
* Validate and return address with appended memo id
|
|
152
|
-
*
|
|
153
|
-
* @param {AddressDetails} addressDetails
|
|
154
|
-
* @returns {string} address with memo id
|
|
155
|
-
*/
|
|
156
|
-
export declare function normalizeAddress({ address, memoId }: AddressDetails): string;
|
|
157
|
-
/**
|
|
158
|
-
* Return boolean indicating whether input is a valid address with memo id
|
|
159
|
-
*
|
|
160
|
-
* @param {string} address address in the form <address>?memoId=<memoId>
|
|
161
|
-
* @returns {boolean} true is input is a valid address
|
|
162
|
-
*/
|
|
163
|
-
export declare function isValidAddressWithPaymentId(address: string): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Return string representation of clarity value input
|
|
166
|
-
*
|
|
167
|
-
* @param {ClarityValue} cv clarity value function argument
|
|
168
|
-
* @returns {String} stringified clarity value
|
|
169
|
-
*/
|
|
170
|
-
export declare function stringifyCv(cv: ClarityValue): any;
|
|
171
|
-
/**
|
|
172
|
-
* Parse functionArgs into send params for send-many-memo contract calls
|
|
173
|
-
*
|
|
174
|
-
* @param {ClarityValue[]} args functionArgs from a contract call payload
|
|
175
|
-
* @returns {SendParams[]} An array of sendParams
|
|
176
|
-
*/
|
|
177
|
-
export declare function functionArgsToSendParams(args: ClarityValue[]): SendParams[];
|
|
178
|
-
/**
|
|
179
|
-
* Gets the version of an address
|
|
180
|
-
*
|
|
181
|
-
* @param {String} address the address with or without the memoId
|
|
182
|
-
* @returns {AddressVersion} A number that represent the Address Version
|
|
183
|
-
*/
|
|
184
|
-
export declare function getAddressVersion(address: string): AddressVersion;
|
|
185
|
-
/**
|
|
186
|
-
* Returns a STX pub key from an xpub
|
|
187
|
-
*
|
|
188
|
-
* @param {String} xpub an xpub
|
|
189
|
-
* @returns {String} a compressed STX pub key
|
|
190
|
-
*/
|
|
191
|
-
export declare function xpubToSTXPubkey(xpub: string, compressed?: boolean): string;
|
|
192
|
-
/**
|
|
193
|
-
* Returns the base address portion of an address
|
|
194
|
-
*
|
|
195
|
-
* @param {String} address - an address
|
|
196
|
-
* @returns {String} - the base address
|
|
197
|
-
*/
|
|
198
|
-
export declare function getBaseAddress(address: string): string;
|
|
199
|
-
/**
|
|
200
|
-
* Compares an address to the base address to check if matchs.
|
|
201
|
-
*
|
|
202
|
-
* @param {String} address - an address
|
|
203
|
-
* @param {String} baseAddress - a base address
|
|
204
|
-
* @returns {boolean}
|
|
205
|
-
*/
|
|
206
|
-
export declare function isSameBaseAddress(address: string, baseAddress: string): boolean;
|
|
207
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/coin/stx/utils.ts"],"names":[],"mappings":";AAIA,OAAO,EAGL,eAAe,EAGf,cAAc,EAGd,YAAY,EAYZ,iBAAiB,EAGlB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAC5B,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGrE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAyBD;;GAEG;AACH,wB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