@ledgerhq/coin-solana 0.7.0-nightly.0
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/.eslintrc.js +20 -0
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +16 -0
- package/CHANGELOG.md +13 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +9 -0
- package/lib/api/cached.d.ts +3 -0
- package/lib/api/cached.d.ts.map +1 -0
- package/lib/api/cached.js +40 -0
- package/lib/api/cached.js.map +1 -0
- package/lib/api/chain/account/index.d.ts +2 -0
- package/lib/api/chain/account/index.d.ts.map +1 -0
- package/lib/api/chain/account/index.js +8 -0
- package/lib/api/chain/account/index.js.map +1 -0
- package/lib/api/chain/account/parser.d.ts +10 -0
- package/lib/api/chain/account/parser.d.ts.map +1 -0
- package/lib/api/chain/account/parser.js +56 -0
- package/lib/api/chain/account/parser.js.map +1 -0
- package/lib/api/chain/account/stake.d.ts +237 -0
- package/lib/api/chain/account/stake.d.ts.map +1 -0
- package/lib/api/chain/account/stake.js +38 -0
- package/lib/api/chain/account/stake.js.map +1 -0
- package/lib/api/chain/account/token.d.ts +116 -0
- package/lib/api/chain/account/token.d.ts.map +1 -0
- package/lib/api/chain/account/token.js +42 -0
- package/lib/api/chain/account/token.js.map +1 -0
- package/lib/api/chain/account/vote.d.ts +252 -0
- package/lib/api/chain/account/vote.d.ts.map +1 -0
- package/lib/api/chain/account/vote.js +44 -0
- package/lib/api/chain/account/vote.js.map +1 -0
- package/lib/api/chain/index.d.ts +29 -0
- package/lib/api/chain/index.d.ts.map +1 -0
- package/lib/api/chain/index.js +99 -0
- package/lib/api/chain/index.js.map +1 -0
- package/lib/api/chain/instruction/associated-token-account/index.d.ts +15 -0
- package/lib/api/chain/instruction/associated-token-account/index.d.ts.map +1 -0
- package/lib/api/chain/instruction/associated-token-account/index.js +21 -0
- package/lib/api/chain/instruction/associated-token-account/index.js.map +1 -0
- package/lib/api/chain/instruction/associated-token-account/types.d.ts +30 -0
- package/lib/api/chain/instruction/associated-token-account/types.d.ts.map +1 -0
- package/lib/api/chain/instruction/associated-token-account/types.js +19 -0
- package/lib/api/chain/instruction/associated-token-account/types.js.map +1 -0
- package/lib/api/chain/instruction/memo/index.d.ts +15 -0
- package/lib/api/chain/instruction/memo/index.d.ts.map +1 -0
- package/lib/api/chain/instruction/memo/index.js +14 -0
- package/lib/api/chain/instruction/memo/index.js.map +1 -0
- package/lib/api/chain/instruction/memo/types.d.ts +21 -0
- package/lib/api/chain/instruction/memo/types.d.ts.map +1 -0
- package/lib/api/chain/instruction/memo/types.js +16 -0
- package/lib/api/chain/instruction/memo/types.js.map +1 -0
- package/lib/api/chain/instruction/stake/index.d.ts +15 -0
- package/lib/api/chain/instruction/stake/index.d.ts.map +1 -0
- package/lib/api/chain/instruction/stake/index.js +20 -0
- package/lib/api/chain/instruction/stake/index.js.map +1 -0
- package/lib/api/chain/instruction/stake/types.d.ts +215 -0
- package/lib/api/chain/instruction/stake/types.d.ts.map +1 -0
- package/lib/api/chain/instruction/stake/types.js +80 -0
- package/lib/api/chain/instruction/stake/types.js.map +1 -0
- package/lib/api/chain/instruction/system/index.d.ts +15 -0
- package/lib/api/chain/instruction/system/index.d.ts.map +1 -0
- package/lib/api/chain/instruction/system/index.js +20 -0
- package/lib/api/chain/instruction/system/index.js.map +1 -0
- package/lib/api/chain/instruction/system/types.d.ts +298 -0
- package/lib/api/chain/instruction/system/types.d.ts.map +1 -0
- package/lib/api/chain/instruction/system/types.js +117 -0
- package/lib/api/chain/instruction/system/types.js.map +1 -0
- package/lib/api/chain/instruction/token/index.d.ts +15 -0
- package/lib/api/chain/instruction/token/index.d.ts.map +1 -0
- package/lib/api/chain/instruction/token/index.js +20 -0
- package/lib/api/chain/instruction/token/index.js.map +1 -0
- package/lib/api/chain/instruction/token/types.d.ts +497 -0
- package/lib/api/chain/instruction/token/types.d.ts.map +1 -0
- package/lib/api/chain/instruction/token/types.js +200 -0
- package/lib/api/chain/instruction/token/types.js.map +1 -0
- package/lib/api/chain/program/constants.d.ts +11 -0
- package/lib/api/chain/program/constants.d.ts.map +1 -0
- package/lib/api/chain/program/constants.js +14 -0
- package/lib/api/chain/program/constants.js.map +1 -0
- package/lib/api/chain/program/index.d.ts +2 -0
- package/lib/api/chain/program/index.d.ts.map +1 -0
- package/lib/api/chain/program/index.js +7 -0
- package/lib/api/chain/program/index.js.map +1 -0
- package/lib/api/chain/program/parser.d.ts +35 -0
- package/lib/api/chain/program/parser.d.ts.map +1 -0
- package/lib/api/chain/program/parser.js +66 -0
- package/lib/api/chain/program/parser.js.map +1 -0
- package/lib/api/chain/validators/bignum.d.ts +3 -0
- package/lib/api/chain/validators/bignum.d.ts.map +1 -0
- package/lib/api/chain/validators/bignum.js +11 -0
- package/lib/api/chain/validators/bignum.js.map +1 -0
- package/lib/api/chain/validators/index.d.ts +10 -0
- package/lib/api/chain/validators/index.d.ts.map +1 -0
- package/lib/api/chain/validators/index.js +10 -0
- package/lib/api/chain/validators/index.js.map +1 -0
- package/lib/api/chain/validators/pubkey.d.ts +3 -0
- package/lib/api/chain/validators/pubkey.d.ts.map +1 -0
- package/lib/api/chain/validators/pubkey.js +7 -0
- package/lib/api/chain/validators/pubkey.js.map +1 -0
- package/lib/api/chain/web3.d.ts +43 -0
- package/lib/api/chain/web3.d.ts.map +1 -0
- package/lib/api/chain/web3.js +274 -0
- package/lib/api/chain/web3.js.map +1 -0
- package/lib/api/index.d.ts +5 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +25 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/logged.d.ts +3 -0
- package/lib/api/logged.d.ts.map +1 -0
- package/lib/api/logged.js +69 -0
- package/lib/api/logged.js.map +1 -0
- package/lib/api/queued.d.ts +3 -0
- package/lib/api/queued.d.ts.map +1 -0
- package/lib/api/queued.js +27 -0
- package/lib/api/queued.js.map +1 -0
- package/lib/api/traced.d.ts +3 -0
- package/lib/api/traced.d.ts.map +1 -0
- package/lib/api/traced.js +80 -0
- package/lib/api/traced.js.map +1 -0
- package/lib/bridge/bridge.d.ts +15 -0
- package/lib/bridge/bridge.d.ts.map +1 -0
- package/lib/bridge/bridge.js +139 -0
- package/lib/bridge/bridge.js.map +1 -0
- package/lib/bridge/js.d.ts +7 -0
- package/lib/bridge/js.d.ts.map +1 -0
- package/lib/bridge/js.js +28 -0
- package/lib/bridge/js.js.map +1 -0
- package/lib/bridge.integration.test.d.ts +4 -0
- package/lib/bridge.integration.test.d.ts.map +1 -0
- package/lib/bridge.integration.test.js +990 -0
- package/lib/bridge.integration.test.js.map +1 -0
- package/lib/cli-transaction.d.ts +19 -0
- package/lib/cli-transaction.d.ts.map +1 -0
- package/lib/cli-transaction.js +196 -0
- package/lib/cli-transaction.js.map +1 -0
- package/lib/datasets/solana.scanAccounts.1.d.ts +6 -0
- package/lib/datasets/solana.scanAccounts.1.d.ts.map +1 -0
- package/lib/datasets/solana.scanAccounts.1.js +12 -0
- package/lib/datasets/solana.scanAccounts.1.js.map +1 -0
- package/lib/deviceTransactionConfig.d.ts +10 -0
- package/lib/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/deviceTransactionConfig.js +228 -0
- package/lib/deviceTransactionConfig.js.map +1 -0
- package/lib/errors.d.ts +61 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +25 -0
- package/lib/errors.js.map +1 -0
- package/lib/hw-getAddress.d.ts +6 -0
- package/lib/hw-getAddress.d.ts.map +1 -0
- package/lib/hw-getAddress.js +28 -0
- package/lib/hw-getAddress.js.map +1 -0
- package/lib/js-broadcast.d.ts +7 -0
- package/lib/js-broadcast.d.ts.map +1 -0
- package/lib/js-broadcast.js +37 -0
- package/lib/js-broadcast.js.map +1 -0
- package/lib/js-buildTransaction.d.ts +5 -0
- package/lib/js-buildTransaction.d.ts.map +1 -0
- package/lib/js-buildTransaction.js +67 -0
- package/lib/js-buildTransaction.js.map +1 -0
- package/lib/js-createTransaction.d.ts +5 -0
- package/lib/js-createTransaction.d.ts.map +1 -0
- package/lib/js-createTransaction.js +19 -0
- package/lib/js-createTransaction.js.map +1 -0
- package/lib/js-estimateMaxSpendable.d.ts +11 -0
- package/lib/js-estimateMaxSpendable.d.ts.map +1 -0
- package/lib/js-estimateMaxSpendable.js +62 -0
- package/lib/js-estimateMaxSpendable.js.map +1 -0
- package/lib/js-getTransactionStatus.d.ts +5 -0
- package/lib/js-getTransactionStatus.d.ts.map +1 -0
- package/lib/js-getTransactionStatus.js +71 -0
- package/lib/js-getTransactionStatus.js.map +1 -0
- package/lib/js-preload-data.d.ts +7 -0
- package/lib/js-preload-data.d.ts.map +1 -0
- package/lib/js-preload-data.js +45 -0
- package/lib/js-preload-data.js.map +1 -0
- package/lib/js-preload.d.ts +7 -0
- package/lib/js-preload.d.ts.map +1 -0
- package/lib/js-preload.js +67 -0
- package/lib/js-preload.js.map +1 -0
- package/lib/js-preload.test.d.ts +2 -0
- package/lib/js-preload.test.d.ts.map +1 -0
- package/lib/js-preload.test.js +9 -0
- package/lib/js-preload.test.js.map +1 -0
- package/lib/js-prepareTransaction.d.ts +5 -0
- package/lib/js-prepareTransaction.d.ts.map +1 -0
- package/lib/js-prepareTransaction.js +500 -0
- package/lib/js-prepareTransaction.js.map +1 -0
- package/lib/js-signOperation.d.ts +7 -0
- package/lib/js-signOperation.d.ts.map +1 -0
- package/lib/js-signOperation.js +153 -0
- package/lib/js-signOperation.js.map +1 -0
- package/lib/js-synchronization.d.ts +5 -0
- package/lib/js-synchronization.d.ts.map +1 -0
- package/lib/js-synchronization.js +464 -0
- package/lib/js-synchronization.js.map +1 -0
- package/lib/logic.d.ts +29 -0
- package/lib/logic.d.ts.map +1 -0
- package/lib/logic.js +102 -0
- package/lib/logic.js.map +1 -0
- package/lib/serialization.d.ts +9 -0
- package/lib/serialization.d.ts.map +1 -0
- package/lib/serialization.js +69 -0
- package/lib/serialization.js.map +1 -0
- package/lib/signer.d.ts +11 -0
- package/lib/signer.d.ts.map +1 -0
- package/lib/signer.js +3 -0
- package/lib/signer.js.map +1 -0
- package/lib/specs.d.ts +7 -0
- package/lib/specs.d.ts.map +1 -0
- package/lib/specs.js +409 -0
- package/lib/specs.js.map +1 -0
- package/lib/speculos-deviceActions.d.ts +8 -0
- package/lib/speculos-deviceActions.d.ts.map +1 -0
- package/lib/speculos-deviceActions.js +217 -0
- package/lib/speculos-deviceActions.js.map +1 -0
- package/lib/transaction.d.ts +15 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +153 -0
- package/lib/transaction.js.map +1 -0
- package/lib/tx-fees.d.ts +4 -0
- package/lib/tx-fees.d.ts.map +1 -0
- package/lib/tx-fees.js +167 -0
- package/lib/tx-fees.js.map +1 -0
- package/lib/types.d.ts +222 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts +24 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +172 -0
- package/lib/utils.js.map +1 -0
- package/lib/validator-app/index.d.ts +22 -0
- package/lib/validator-app/index.d.ts.map +1 -0
- package/lib/validator-app/index.js +62 -0
- package/lib/validator-app/index.js.map +1 -0
- package/lib-es/api/cached.d.ts +3 -0
- package/lib-es/api/cached.d.ts.map +1 -0
- package/lib-es/api/cached.js +33 -0
- package/lib-es/api/cached.js.map +1 -0
- package/lib-es/api/chain/account/index.d.ts +2 -0
- package/lib-es/api/chain/account/index.d.ts.map +1 -0
- package/lib-es/api/chain/account/index.js +2 -0
- package/lib-es/api/chain/account/index.js.map +1 -0
- package/lib-es/api/chain/account/parser.d.ts +10 -0
- package/lib-es/api/chain/account/parser.d.ts.map +1 -0
- package/lib-es/api/chain/account/parser.js +48 -0
- package/lib-es/api/chain/account/parser.js.map +1 -0
- package/lib-es/api/chain/account/stake.d.ts +237 -0
- package/lib-es/api/chain/account/stake.d.ts.map +1 -0
- package/lib-es/api/chain/account/stake.js +35 -0
- package/lib-es/api/chain/account/stake.js.map +1 -0
- package/lib-es/api/chain/account/token.d.ts +116 -0
- package/lib-es/api/chain/account/token.d.ts.map +1 -0
- package/lib-es/api/chain/account/token.js +39 -0
- package/lib-es/api/chain/account/token.js.map +1 -0
- package/lib-es/api/chain/account/vote.d.ts +252 -0
- package/lib-es/api/chain/account/vote.d.ts.map +1 -0
- package/lib-es/api/chain/account/vote.js +41 -0
- package/lib-es/api/chain/account/vote.js.map +1 -0
- package/lib-es/api/chain/index.d.ts +29 -0
- package/lib-es/api/chain/index.d.ts.map +1 -0
- package/lib-es/api/chain/index.js +95 -0
- package/lib-es/api/chain/index.js.map +1 -0
- package/lib-es/api/chain/instruction/associated-token-account/index.d.ts +15 -0
- package/lib-es/api/chain/instruction/associated-token-account/index.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/associated-token-account/index.js +17 -0
- package/lib-es/api/chain/instruction/associated-token-account/index.js.map +1 -0
- package/lib-es/api/chain/instruction/associated-token-account/types.d.ts +30 -0
- package/lib-es/api/chain/instruction/associated-token-account/types.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/associated-token-account/types.js +16 -0
- package/lib-es/api/chain/instruction/associated-token-account/types.js.map +1 -0
- package/lib-es/api/chain/instruction/memo/index.d.ts +15 -0
- package/lib-es/api/chain/instruction/memo/index.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/memo/index.js +10 -0
- package/lib-es/api/chain/instruction/memo/index.js.map +1 -0
- package/lib-es/api/chain/instruction/memo/types.d.ts +21 -0
- package/lib-es/api/chain/instruction/memo/types.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/memo/types.js +13 -0
- package/lib-es/api/chain/instruction/memo/types.js.map +1 -0
- package/lib-es/api/chain/instruction/stake/index.d.ts +15 -0
- package/lib-es/api/chain/instruction/stake/index.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/stake/index.js +16 -0
- package/lib-es/api/chain/instruction/stake/index.js.map +1 -0
- package/lib-es/api/chain/instruction/stake/types.d.ts +215 -0
- package/lib-es/api/chain/instruction/stake/types.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/stake/types.js +77 -0
- package/lib-es/api/chain/instruction/stake/types.js.map +1 -0
- package/lib-es/api/chain/instruction/system/index.d.ts +15 -0
- package/lib-es/api/chain/instruction/system/index.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/system/index.js +16 -0
- package/lib-es/api/chain/instruction/system/index.js.map +1 -0
- package/lib-es/api/chain/instruction/system/types.d.ts +298 -0
- package/lib-es/api/chain/instruction/system/types.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/system/types.js +114 -0
- package/lib-es/api/chain/instruction/system/types.js.map +1 -0
- package/lib-es/api/chain/instruction/token/index.d.ts +15 -0
- package/lib-es/api/chain/instruction/token/index.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/token/index.js +16 -0
- package/lib-es/api/chain/instruction/token/index.js.map +1 -0
- package/lib-es/api/chain/instruction/token/types.d.ts +497 -0
- package/lib-es/api/chain/instruction/token/types.d.ts.map +1 -0
- package/lib-es/api/chain/instruction/token/types.js +197 -0
- package/lib-es/api/chain/instruction/token/types.js.map +1 -0
- package/lib-es/api/chain/program/constants.d.ts +11 -0
- package/lib-es/api/chain/program/constants.d.ts.map +1 -0
- package/lib-es/api/chain/program/constants.js +11 -0
- package/lib-es/api/chain/program/constants.js.map +1 -0
- package/lib-es/api/chain/program/index.d.ts +2 -0
- package/lib-es/api/chain/program/index.d.ts.map +1 -0
- package/lib-es/api/chain/program/index.js +2 -0
- package/lib-es/api/chain/program/index.js.map +1 -0
- package/lib-es/api/chain/program/parser.d.ts +35 -0
- package/lib-es/api/chain/program/parser.d.ts.map +1 -0
- package/lib-es/api/chain/program/parser.js +61 -0
- package/lib-es/api/chain/program/parser.js.map +1 -0
- package/lib-es/api/chain/validators/bignum.d.ts +3 -0
- package/lib-es/api/chain/validators/bignum.d.ts.map +1 -0
- package/lib-es/api/chain/validators/bignum.js +8 -0
- package/lib-es/api/chain/validators/bignum.js.map +1 -0
- package/lib-es/api/chain/validators/index.d.ts +10 -0
- package/lib-es/api/chain/validators/index.d.ts.map +1 -0
- package/lib-es/api/chain/validators/index.js +7 -0
- package/lib-es/api/chain/validators/index.js.map +1 -0
- package/lib-es/api/chain/validators/pubkey.d.ts +3 -0
- package/lib-es/api/chain/validators/pubkey.d.ts.map +1 -0
- package/lib-es/api/chain/validators/pubkey.js +4 -0
- package/lib-es/api/chain/validators/pubkey.js.map +1 -0
- package/lib-es/api/chain/web3.d.ts +43 -0
- package/lib-es/api/chain/web3.d.ts.map +1 -0
- package/lib-es/api/chain/web3.js +251 -0
- package/lib-es/api/chain/web3.js.map +1 -0
- package/lib-es/api/index.d.ts +5 -0
- package/lib-es/api/index.d.ts.map +1 -0
- package/lib-es/api/index.js +5 -0
- package/lib-es/api/index.js.map +1 -0
- package/lib-es/api/logged.d.ts +3 -0
- package/lib-es/api/logged.d.ts.map +1 -0
- package/lib-es/api/logged.js +65 -0
- package/lib-es/api/logged.js.map +1 -0
- package/lib-es/api/queued.d.ts +3 -0
- package/lib-es/api/queued.d.ts.map +1 -0
- package/lib-es/api/queued.js +23 -0
- package/lib-es/api/queued.js.map +1 -0
- package/lib-es/api/traced.d.ts +3 -0
- package/lib-es/api/traced.d.ts.map +1 -0
- package/lib-es/api/traced.js +76 -0
- package/lib-es/api/traced.js.map +1 -0
- package/lib-es/bridge/bridge.d.ts +15 -0
- package/lib-es/bridge/bridge.d.ts.map +1 -0
- package/lib-es/bridge/bridge.js +132 -0
- package/lib-es/bridge/bridge.js.map +1 -0
- package/lib-es/bridge/js.d.ts +7 -0
- package/lib-es/bridge/js.d.ts.map +1 -0
- package/lib-es/bridge/js.js +24 -0
- package/lib-es/bridge/js.js.map +1 -0
- package/lib-es/bridge.integration.test.d.ts +4 -0
- package/lib-es/bridge.integration.test.d.ts.map +1 -0
- package/lib-es/bridge.integration.test.js +988 -0
- package/lib-es/bridge.integration.test.js.map +1 -0
- package/lib-es/cli-transaction.d.ts +19 -0
- package/lib-es/cli-transaction.d.ts.map +1 -0
- package/lib-es/cli-transaction.js +190 -0
- package/lib-es/cli-transaction.js.map +1 -0
- package/lib-es/datasets/solana.scanAccounts.1.d.ts +6 -0
- package/lib-es/datasets/solana.scanAccounts.1.d.ts.map +1 -0
- package/lib-es/datasets/solana.scanAccounts.1.js +10 -0
- package/lib-es/datasets/solana.scanAccounts.1.js.map +1 -0
- package/lib-es/deviceTransactionConfig.d.ts +10 -0
- package/lib-es/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/deviceTransactionConfig.js +223 -0
- package/lib-es/deviceTransactionConfig.js.map +1 -0
- package/lib-es/errors.d.ts +61 -0
- package/lib-es/errors.d.ts.map +1 -0
- package/lib-es/errors.js +22 -0
- package/lib-es/errors.js.map +1 -0
- package/lib-es/hw-getAddress.d.ts +6 -0
- package/lib-es/hw-getAddress.d.ts.map +1 -0
- package/lib-es/hw-getAddress.js +23 -0
- package/lib-es/hw-getAddress.js.map +1 -0
- package/lib-es/js-broadcast.d.ts +7 -0
- package/lib-es/js-broadcast.d.ts.map +1 -0
- package/lib-es/js-broadcast.js +33 -0
- package/lib-es/js-broadcast.js.map +1 -0
- package/lib-es/js-buildTransaction.d.ts +5 -0
- package/lib-es/js-buildTransaction.d.ts.map +1 -0
- package/lib-es/js-buildTransaction.js +63 -0
- package/lib-es/js-buildTransaction.js.map +1 -0
- package/lib-es/js-createTransaction.d.ts +5 -0
- package/lib-es/js-createTransaction.d.ts.map +1 -0
- package/lib-es/js-createTransaction.js +17 -0
- package/lib-es/js-createTransaction.js.map +1 -0
- package/lib-es/js-estimateMaxSpendable.d.ts +11 -0
- package/lib-es/js-estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/js-estimateMaxSpendable.js +55 -0
- package/lib-es/js-estimateMaxSpendable.js.map +1 -0
- package/lib-es/js-getTransactionStatus.d.ts +5 -0
- package/lib-es/js-getTransactionStatus.d.ts.map +1 -0
- package/lib-es/js-getTransactionStatus.js +69 -0
- package/lib-es/js-getTransactionStatus.js.map +1 -0
- package/lib-es/js-preload-data.d.ts +7 -0
- package/lib-es/js-preload-data.d.ts.map +1 -0
- package/lib-es/js-preload-data.js +39 -0
- package/lib-es/js-preload-data.js.map +1 -0
- package/lib-es/js-preload.d.ts +7 -0
- package/lib-es/js-preload.d.ts.map +1 -0
- package/lib-es/js-preload.js +62 -0
- package/lib-es/js-preload.js.map +1 -0
- package/lib-es/js-preload.test.d.ts +2 -0
- package/lib-es/js-preload.test.d.ts.map +1 -0
- package/lib-es/js-preload.test.js +7 -0
- package/lib-es/js-preload.test.js.map +1 -0
- package/lib-es/js-prepareTransaction.d.ts +5 -0
- package/lib-es/js-prepareTransaction.d.ts.map +1 -0
- package/lib-es/js-prepareTransaction.js +497 -0
- package/lib-es/js-prepareTransaction.js.map +1 -0
- package/lib-es/js-signOperation.d.ts +7 -0
- package/lib-es/js-signOperation.d.ts.map +1 -0
- package/lib-es/js-signOperation.js +146 -0
- package/lib-es/js-signOperation.js.map +1 -0
- package/lib-es/js-synchronization.d.ts +5 -0
- package/lib-es/js-synchronization.d.ts.map +1 -0
- package/lib-es/js-synchronization.js +457 -0
- package/lib-es/js-synchronization.js.map +1 -0
- package/lib-es/logic.d.ts +29 -0
- package/lib-es/logic.d.ts.map +1 -0
- package/lib-es/logic.js +87 -0
- package/lib-es/logic.js.map +1 -0
- package/lib-es/serialization.d.ts +9 -0
- package/lib-es/serialization.d.ts.map +1 -0
- package/lib-es/serialization.js +60 -0
- package/lib-es/serialization.js.map +1 -0
- package/lib-es/signer.d.ts +11 -0
- package/lib-es/signer.d.ts.map +1 -0
- package/lib-es/signer.js +2 -0
- package/lib-es/signer.js.map +1 -0
- package/lib-es/specs.d.ts +7 -0
- package/lib-es/specs.d.ts.map +1 -0
- package/lib-es/specs.js +404 -0
- package/lib-es/specs.js.map +1 -0
- package/lib-es/speculos-deviceActions.d.ts +8 -0
- package/lib-es/speculos-deviceActions.d.ts.map +1 -0
- package/lib-es/speculos-deviceActions.js +211 -0
- package/lib-es/speculos-deviceActions.js.map +1 -0
- package/lib-es/transaction.d.ts +15 -0
- package/lib-es/transaction.d.ts.map +1 -0
- package/lib-es/transaction.js +147 -0
- package/lib-es/transaction.js.map +1 -0
- package/lib-es/tx-fees.d.ts +4 -0
- package/lib-es/tx-fees.d.ts.map +1 -0
- package/lib-es/tx-fees.js +160 -0
- package/lib-es/tx-fees.js.map +1 -0
- package/lib-es/types.d.ts +222 -0
- package/lib-es/types.d.ts.map +1 -0
- package/lib-es/types.js +2 -0
- package/lib-es/types.js.map +1 -0
- package/lib-es/utils.d.ts +24 -0
- package/lib-es/utils.d.ts.map +1 -0
- package/lib-es/utils.js +157 -0
- package/lib-es/utils.js.map +1 -0
- package/lib-es/validator-app/index.d.ts +22 -0
- package/lib-es/validator-app/index.d.ts.map +1 -0
- package/lib-es/validator-app/index.js +55 -0
- package/lib-es/validator-app/index.js.map +1 -0
- package/package.json +89 -0
- package/src/api/cached.ts +87 -0
- package/src/api/chain/account/index.ts +1 -0
- package/src/api/chain/account/parser.ts +63 -0
- package/src/api/chain/account/stake.ts +45 -0
- package/src/api/chain/account/token.ts +63 -0
- package/src/api/chain/account/vote.ts +55 -0
- package/src/api/chain/index.ts +203 -0
- package/src/api/chain/instruction/associated-token-account/index.ts +33 -0
- package/src/api/chain/instruction/associated-token-account/types.ts +23 -0
- package/src/api/chain/instruction/memo/index.ts +24 -0
- package/src/api/chain/instruction/memo/types.ts +18 -0
- package/src/api/chain/instruction/stake/index.ts +29 -0
- package/src/api/chain/instruction/stake/types.ts +95 -0
- package/src/api/chain/instruction/system/index.ts +30 -0
- package/src/api/chain/instruction/system/types.ts +141 -0
- package/src/api/chain/instruction/token/index.ts +30 -0
- package/src/api/chain/instruction/token/types.ts +222 -0
- package/src/api/chain/program/constants.ts +10 -0
- package/src/api/chain/program/index.ts +1 -0
- package/src/api/chain/program/parser.ts +120 -0
- package/src/api/chain/validators/bignum.ts +7 -0
- package/src/api/chain/validators/index.ts +9 -0
- package/src/api/chain/validators/pubkey.ts +8 -0
- package/src/api/chain/web3.ts +399 -0
- package/src/api/index.ts +4 -0
- package/src/api/logged.ts +70 -0
- package/src/api/queued.ts +25 -0
- package/src/api/traced.ts +89 -0
- package/src/bridge/bridge.ts +195 -0
- package/src/bridge/js.ts +44 -0
- package/src/bridge.integration.test.ts +1106 -0
- package/src/cli-transaction.ts +246 -0
- package/src/datasets/solana.scanAccounts.1.ts +9 -0
- package/src/deviceTransactionConfig.ts +302 -0
- package/src/errors.ts +61 -0
- package/src/hw-getAddress.ts +26 -0
- package/src/js-broadcast.ts +38 -0
- package/src/js-buildTransaction.ts +81 -0
- package/src/js-createTransaction.ts +20 -0
- package/src/js-estimateMaxSpendable.ts +72 -0
- package/src/js-getTransactionStatus.ts +72 -0
- package/src/js-preload-data.ts +46 -0
- package/src/js-preload.test.ts +14 -0
- package/src/js-preload.ts +74 -0
- package/src/js-prepareTransaction.ts +686 -0
- package/src/js-signOperation.ts +329 -0
- package/src/js-synchronization.ts +729 -0
- package/src/logic.ts +123 -0
- package/src/serialization.ts +81 -0
- package/src/signer.ts +21 -0
- package/src/specs.ts +514 -0
- package/src/speculos-deviceActions.ts +229 -0
- package/src/transaction.ts +194 -0
- package/src/tx-fees.ts +206 -0
- package/src/types.ts +284 -0
- package/src/utils.ts +176 -0
- package/src/validator-app/index.ts +79 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IX_TITLES = exports.IX_STRUCTS = exports.TokenInstructionType = exports.TransferChecked = exports.Transfer = exports.TokenAmountUi = void 0;
|
|
5
|
+
const superstruct_1 = require("superstruct");
|
|
6
|
+
const pubkey_1 = require("../../validators/pubkey");
|
|
7
|
+
exports.TokenAmountUi = (0, superstruct_1.type)({
|
|
8
|
+
amount: (0, superstruct_1.string)(),
|
|
9
|
+
decimals: (0, superstruct_1.number)(),
|
|
10
|
+
uiAmountString: (0, superstruct_1.string)(),
|
|
11
|
+
});
|
|
12
|
+
const InitializeMint = (0, superstruct_1.type)({
|
|
13
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
14
|
+
decimals: (0, superstruct_1.number)(),
|
|
15
|
+
mintAuthority: pubkey_1.PublicKeyFromString,
|
|
16
|
+
rentSysvar: pubkey_1.PublicKeyFromString,
|
|
17
|
+
freezeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
18
|
+
});
|
|
19
|
+
const InitializeAccount = (0, superstruct_1.type)({
|
|
20
|
+
account: pubkey_1.PublicKeyFromString,
|
|
21
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
22
|
+
owner: pubkey_1.PublicKeyFromString,
|
|
23
|
+
rentSysvar: pubkey_1.PublicKeyFromString,
|
|
24
|
+
});
|
|
25
|
+
const InitializeMultisig = (0, superstruct_1.type)({
|
|
26
|
+
multisig: pubkey_1.PublicKeyFromString,
|
|
27
|
+
rentSysvar: pubkey_1.PublicKeyFromString,
|
|
28
|
+
signers: (0, superstruct_1.array)(pubkey_1.PublicKeyFromString),
|
|
29
|
+
m: (0, superstruct_1.number)(),
|
|
30
|
+
});
|
|
31
|
+
exports.Transfer = (0, superstruct_1.type)({
|
|
32
|
+
source: pubkey_1.PublicKeyFromString,
|
|
33
|
+
destination: pubkey_1.PublicKeyFromString,
|
|
34
|
+
amount: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)()]),
|
|
35
|
+
authority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
36
|
+
multisigAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
37
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
38
|
+
});
|
|
39
|
+
const Approve = (0, superstruct_1.type)({
|
|
40
|
+
source: pubkey_1.PublicKeyFromString,
|
|
41
|
+
delegate: pubkey_1.PublicKeyFromString,
|
|
42
|
+
amount: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)()]),
|
|
43
|
+
owner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
44
|
+
multisigOwner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
45
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
46
|
+
});
|
|
47
|
+
const Revoke = (0, superstruct_1.type)({
|
|
48
|
+
source: pubkey_1.PublicKeyFromString,
|
|
49
|
+
owner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
50
|
+
multisigOwner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
51
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
52
|
+
});
|
|
53
|
+
const AuthorityType = (0, superstruct_1.enums)(["mintTokens", "freezeAccount", "accountOwner", "closeAccount"]);
|
|
54
|
+
const SetAuthority = (0, superstruct_1.type)({
|
|
55
|
+
mint: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
56
|
+
account: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
57
|
+
authorityType: AuthorityType,
|
|
58
|
+
newAuthority: (0, superstruct_1.nullable)(pubkey_1.PublicKeyFromString),
|
|
59
|
+
authority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
60
|
+
multisigAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
61
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
62
|
+
});
|
|
63
|
+
const MintTo = (0, superstruct_1.type)({
|
|
64
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
65
|
+
account: pubkey_1.PublicKeyFromString,
|
|
66
|
+
amount: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)()]),
|
|
67
|
+
mintAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
68
|
+
multisigMintAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
69
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
70
|
+
});
|
|
71
|
+
const Burn = (0, superstruct_1.type)({
|
|
72
|
+
account: pubkey_1.PublicKeyFromString,
|
|
73
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
74
|
+
amount: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)()]),
|
|
75
|
+
authority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
76
|
+
multisigAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
77
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
78
|
+
});
|
|
79
|
+
const CloseAccount = (0, superstruct_1.type)({
|
|
80
|
+
account: pubkey_1.PublicKeyFromString,
|
|
81
|
+
destination: pubkey_1.PublicKeyFromString,
|
|
82
|
+
owner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
83
|
+
multisigOwner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
84
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
85
|
+
});
|
|
86
|
+
const FreezeAccount = (0, superstruct_1.type)({
|
|
87
|
+
account: pubkey_1.PublicKeyFromString,
|
|
88
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
89
|
+
freezeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
90
|
+
multisigFreezeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
91
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
92
|
+
});
|
|
93
|
+
const ThawAccount = (0, superstruct_1.type)({
|
|
94
|
+
account: pubkey_1.PublicKeyFromString,
|
|
95
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
96
|
+
freezeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
97
|
+
multisigFreezeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
98
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
99
|
+
});
|
|
100
|
+
exports.TransferChecked = (0, superstruct_1.type)({
|
|
101
|
+
source: pubkey_1.PublicKeyFromString,
|
|
102
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
103
|
+
destination: pubkey_1.PublicKeyFromString,
|
|
104
|
+
authority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
105
|
+
multisigAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
106
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
107
|
+
tokenAmount: exports.TokenAmountUi,
|
|
108
|
+
});
|
|
109
|
+
const ApproveChecked = (0, superstruct_1.type)({
|
|
110
|
+
source: pubkey_1.PublicKeyFromString,
|
|
111
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
112
|
+
delegate: pubkey_1.PublicKeyFromString,
|
|
113
|
+
owner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
114
|
+
multisigOwner: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
115
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
116
|
+
tokenAmount: exports.TokenAmountUi,
|
|
117
|
+
});
|
|
118
|
+
const MintToChecked = (0, superstruct_1.type)({
|
|
119
|
+
account: pubkey_1.PublicKeyFromString,
|
|
120
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
121
|
+
mintAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
122
|
+
multisigMintAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
123
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
124
|
+
tokenAmount: exports.TokenAmountUi,
|
|
125
|
+
});
|
|
126
|
+
const BurnChecked = (0, superstruct_1.type)({
|
|
127
|
+
account: pubkey_1.PublicKeyFromString,
|
|
128
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
129
|
+
authority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
130
|
+
multisigAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
131
|
+
signers: (0, superstruct_1.optional)((0, superstruct_1.array)(pubkey_1.PublicKeyFromString)),
|
|
132
|
+
tokenAmount: exports.TokenAmountUi,
|
|
133
|
+
});
|
|
134
|
+
exports.TokenInstructionType = (0, superstruct_1.enums)([
|
|
135
|
+
"initializeMint",
|
|
136
|
+
"initializeAccount",
|
|
137
|
+
"initializeMultisig",
|
|
138
|
+
"transfer",
|
|
139
|
+
"approve",
|
|
140
|
+
"revoke",
|
|
141
|
+
"setAuthority",
|
|
142
|
+
"mintTo",
|
|
143
|
+
"burn",
|
|
144
|
+
"closeAccount",
|
|
145
|
+
"freezeAccount",
|
|
146
|
+
"thawAccount",
|
|
147
|
+
"transfer2",
|
|
148
|
+
"approve2",
|
|
149
|
+
"mintTo2",
|
|
150
|
+
"burn2",
|
|
151
|
+
"transferChecked",
|
|
152
|
+
"approveChecked",
|
|
153
|
+
"mintToChecked",
|
|
154
|
+
"burnChecked",
|
|
155
|
+
]);
|
|
156
|
+
exports.IX_STRUCTS = {
|
|
157
|
+
initializeMint: InitializeMint,
|
|
158
|
+
initializeAccount: InitializeAccount,
|
|
159
|
+
initializeMultisig: InitializeMultisig,
|
|
160
|
+
transfer: exports.Transfer,
|
|
161
|
+
approve: Approve,
|
|
162
|
+
revoke: Revoke,
|
|
163
|
+
setAuthority: SetAuthority,
|
|
164
|
+
mintTo: MintTo,
|
|
165
|
+
burn: Burn,
|
|
166
|
+
closeAccount: CloseAccount,
|
|
167
|
+
freezeAccount: FreezeAccount,
|
|
168
|
+
thawAccount: ThawAccount,
|
|
169
|
+
transfer2: exports.TransferChecked,
|
|
170
|
+
approve2: ApproveChecked,
|
|
171
|
+
mintTo2: MintToChecked,
|
|
172
|
+
burn2: BurnChecked,
|
|
173
|
+
transferChecked: exports.TransferChecked,
|
|
174
|
+
approveChecked: ApproveChecked,
|
|
175
|
+
mintToChecked: MintToChecked,
|
|
176
|
+
burnChecked: BurnChecked,
|
|
177
|
+
};
|
|
178
|
+
exports.IX_TITLES = {
|
|
179
|
+
initializeMint: "Initialize Mint",
|
|
180
|
+
initializeAccount: "Initialize Account",
|
|
181
|
+
initializeMultisig: "Initialize Multisig",
|
|
182
|
+
transfer: "Transfer",
|
|
183
|
+
approve: "Approve",
|
|
184
|
+
revoke: "Revoke",
|
|
185
|
+
setAuthority: "Set Authority",
|
|
186
|
+
mintTo: "Mint To",
|
|
187
|
+
burn: "Burn",
|
|
188
|
+
closeAccount: "Close Account",
|
|
189
|
+
freezeAccount: "Freeze Account",
|
|
190
|
+
thawAccount: "Thaw Account",
|
|
191
|
+
transfer2: "Transfer (Checked)",
|
|
192
|
+
approve2: "Approve (Checked)",
|
|
193
|
+
mintTo2: "Mint To (Checked)",
|
|
194
|
+
burn2: "Burn (Checked)",
|
|
195
|
+
transferChecked: "Transfer (Checked)",
|
|
196
|
+
approveChecked: "Approve (Checked)",
|
|
197
|
+
mintToChecked: "Mint To (Checked)",
|
|
198
|
+
burnChecked: "Burn (Checked)",
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/api/chain/instruction/token/types.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAAmG;AACnG,oD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AAS,EAAE,uBAAe;IAC1B,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,eAAe,EAAE,uBAAe;IAChC,cAAc,EAAE,cAAc;IAC9B,aAAa,EAAE,aAAa;IAC5B,WAAW,EAAE,WAAW;CACzB,CAAC;AAEW,QAAA,SAAS,GAAG;IACvB,cAAc,EAAE,iBAAiB;IACjC,iBAAiB,EAAE,oBAAoB;IACvC,kBAAkB,EAAE,qBAAqB;IACzC,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,gBAAgB;IAC/B,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,gBAAgB;IACvB,eAAe,EAAE,oBAAoB;IACrC,cAAc,EAAE,mBAAmB;IACnC,aAAa,EAAE,mBAAmB;IAClC,WAAW,EAAE,gBAAgB;CAC9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PARSED_PROGRAMS: {
|
|
2
|
+
readonly SPL_ASSOCIATED_TOKEN_ACCOUNT: "spl-associated-token-account";
|
|
3
|
+
readonly BPF_LOADER: "bpf-loader";
|
|
4
|
+
readonly BPF_UPGRADEABLE_LOADER: "bpf-upgradeable-loader";
|
|
5
|
+
readonly SPL_MEMO: "spl-memo";
|
|
6
|
+
readonly STAKE: "stake";
|
|
7
|
+
readonly SYSTEM: "system";
|
|
8
|
+
readonly SPL_TOKEN: "spl-token";
|
|
9
|
+
readonly VOTE: "vote";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/program/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PARSED_PROGRAMS = void 0;
|
|
4
|
+
exports.PARSED_PROGRAMS = {
|
|
5
|
+
SPL_ASSOCIATED_TOKEN_ACCOUNT: "spl-associated-token-account",
|
|
6
|
+
BPF_LOADER: "bpf-loader",
|
|
7
|
+
BPF_UPGRADEABLE_LOADER: "bpf-upgradeable-loader",
|
|
8
|
+
SPL_MEMO: "spl-memo",
|
|
9
|
+
STAKE: "stake",
|
|
10
|
+
SYSTEM: "system",
|
|
11
|
+
SPL_TOKEN: "spl-token",
|
|
12
|
+
VOTE: "vote",
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/api/chain/program/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,4BAA4B,EAAE,8BAA8B;IAC5D,UAAU,EAAE,YAAY;IACxB,sBAAsB,EAAE,wBAAwB;IAChD,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/program/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuiet = exports.parse = void 0;
|
|
4
|
+
var parser_1 = require("./parser");
|
|
5
|
+
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } });
|
|
6
|
+
Object.defineProperty(exports, "parseQuiet", { enumerable: true, get: function () { return parser_1.parseQuiet; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/chain/program/index.ts"],"names":[],"mappings":";;;AAAA,mCAA6C;AAApC,+FAAA,KAAK,OAAA;AAAE,oGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ParsedInstruction, PartiallyDecodedInstruction } from "@solana/web3.js";
|
|
2
|
+
import { TokenInstructionDescriptor } from "../instruction/token";
|
|
3
|
+
import { AssociatedTokenAccountInstructionDescriptor } from "../instruction/associated-token-account";
|
|
4
|
+
import { MemoInstructionDescriptor } from "../instruction/memo";
|
|
5
|
+
import { StakeInstructionDescriptor } from "../instruction/stake";
|
|
6
|
+
import { SystemInstructionDescriptor } from "../instruction/system";
|
|
7
|
+
type ParsedProgram = {
|
|
8
|
+
program: "system";
|
|
9
|
+
title: string;
|
|
10
|
+
instruction: SystemInstructionDescriptor;
|
|
11
|
+
} | {
|
|
12
|
+
program: "spl-associated-token-account";
|
|
13
|
+
title: string;
|
|
14
|
+
instruction: AssociatedTokenAccountInstructionDescriptor;
|
|
15
|
+
} | {
|
|
16
|
+
program: "spl-memo";
|
|
17
|
+
title: string;
|
|
18
|
+
instruction: MemoInstructionDescriptor;
|
|
19
|
+
} | {
|
|
20
|
+
program: "stake";
|
|
21
|
+
title: string;
|
|
22
|
+
instruction: StakeInstructionDescriptor;
|
|
23
|
+
} | {
|
|
24
|
+
program: "spl-token";
|
|
25
|
+
title: string;
|
|
26
|
+
instruction: TokenInstructionDescriptor;
|
|
27
|
+
} | {
|
|
28
|
+
program: "unknown";
|
|
29
|
+
title: "Unknown";
|
|
30
|
+
instruction: undefined;
|
|
31
|
+
};
|
|
32
|
+
export declare const parse: (ix: ParsedInstruction | PartiallyDecodedInstruction) => ParsedProgram;
|
|
33
|
+
export declare const parseQuiet: (ix: ParsedInstruction | PartiallyDecodedInstruction) => ParsedProgram;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/program/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAA4B,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,EACL,2CAA2C,EAE5C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAA2B,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAyB,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAA0B,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAE5F,KAAK,aAAa,GACd;IACE,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,2BAA2B,CAAC;CAC1C,GACD;IACE,OAAO,EAAE,8BAA8B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,2CAA2C,CAAC;CAC1D,GACD;IACE,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,yBAAyB,CAAC;CACxC,GACD;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,0BAA0B,CAAC;CACzC,GACD;IACE,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,0BAA0B,CAAC;CACzC,GACD;IACE,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,SAAS,CAAC;CACxB,CAAC;AAEN,eAAO,MAAM,KAAK,OAAQ,iBAAiB,GAAG,2BAA2B,KAAG,aAwD3E,CAAC;AAEF,eAAO,MAAM,UAAU,OAAQ,iBAAiB,GAAG,2BAA2B,KAAG,aAMhF,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuiet = exports.parse = void 0;
|
|
4
|
+
const token_1 = require("../instruction/token");
|
|
5
|
+
const associated_token_account_1 = require("../instruction/associated-token-account");
|
|
6
|
+
const memo_1 = require("../instruction/memo");
|
|
7
|
+
const stake_1 = require("../instruction/stake");
|
|
8
|
+
const system_1 = require("../instruction/system");
|
|
9
|
+
const parse = (ix) => {
|
|
10
|
+
if ("parsed" in ix) {
|
|
11
|
+
const program = ix.program;
|
|
12
|
+
switch (program) {
|
|
13
|
+
case "system":
|
|
14
|
+
return {
|
|
15
|
+
program,
|
|
16
|
+
title: "System",
|
|
17
|
+
instruction: (0, system_1.parseSystemInstruction)(Object.assign(Object.assign({}, ix), { program })),
|
|
18
|
+
};
|
|
19
|
+
case "spl-associated-token-account":
|
|
20
|
+
return {
|
|
21
|
+
program,
|
|
22
|
+
title: "Associated Token Account",
|
|
23
|
+
instruction: (0, associated_token_account_1.parseAssociatedTokenAccountInstruction)(Object.assign(Object.assign({}, ix), { program })),
|
|
24
|
+
};
|
|
25
|
+
case "spl-memo":
|
|
26
|
+
return {
|
|
27
|
+
program,
|
|
28
|
+
title: "Memo",
|
|
29
|
+
instruction: (0, memo_1.parseSplMemoInstruction)(Object.assign(Object.assign({}, ix), { program })),
|
|
30
|
+
};
|
|
31
|
+
case "stake":
|
|
32
|
+
return {
|
|
33
|
+
program,
|
|
34
|
+
title: "Stake",
|
|
35
|
+
instruction: (0, stake_1.parseStakeInstruction)(Object.assign(Object.assign({}, ix), { program })),
|
|
36
|
+
};
|
|
37
|
+
case "spl-token":
|
|
38
|
+
return {
|
|
39
|
+
program,
|
|
40
|
+
title: "Token",
|
|
41
|
+
instruction: (0, token_1.parseSplTokenInstruction)(Object.assign(Object.assign({}, ix), { program })),
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
return unknown();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return unknown();
|
|
48
|
+
};
|
|
49
|
+
exports.parse = parse;
|
|
50
|
+
const parseQuiet = (ix) => {
|
|
51
|
+
try {
|
|
52
|
+
return (0, exports.parse)(ix);
|
|
53
|
+
}
|
|
54
|
+
catch (_) {
|
|
55
|
+
return unknown();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.parseQuiet = parseQuiet;
|
|
59
|
+
function unknown() {
|
|
60
|
+
return {
|
|
61
|
+
program: "unknown",
|
|
62
|
+
title: "Unknown",
|
|
63
|
+
instruction: undefined,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/api/chain/program/parser.ts"],"names":[],"mappings":";;;AACA,gDAA4F;AAE5F,sFAGiD;AACjD,8CAAyF;AACzF,gDAAyF;AACzF,kDAA4F;AAkCrF,MAAM,KAAK,GAAG,CAAC,EAAmD,EAAiB,EAAE;IAC1F,IAAI,QAAQ,IAAI,EAAE,EAAE;QAClB,MAAM,OAAO,GAA2D,EAAE,CAAC,OAAc,CAAC;QAE1F,QAAQ,OAAO,EAAE;YACf,KAAK,QAAQ;gBACX,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,IAAA,+BAAsB,kCAC9B,EAAE,KACL,OAAO,IACP;iBACH,CAAC;YACJ,KAAK,8BAA8B;gBACjC,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,0BAA0B;oBACjC,WAAW,EAAE,IAAA,iEAAsC,kCAC9C,EAAE,KACL,OAAO,IACP;iBACH,CAAC;YACJ,KAAK,UAAU;gBACb,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,IAAA,8BAAuB,kCAC/B,EAAE,KACL,OAAO,IACP;iBACH,CAAC;YACJ,KAAK,OAAO;gBACV,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,IAAA,6BAAqB,kCAC7B,EAAE,KACL,OAAO,IACP;iBACH,CAAC;YACJ,KAAK,WAAW;gBACd,OAAO;oBACL,OAAO;oBACP,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,IAAA,gCAAwB,kCAChC,EAAE,KACL,OAAO,IACP;iBACH,CAAC;YACJ;gBACE,OAAO,OAAO,EAAE,CAAC;SACpB;KACF;IAED,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC,CAAC;AAxDW,QAAA,KAAK,SAwDhB;AAEK,MAAM,UAAU,GAAG,CAAC,EAAmD,EAAiB,EAAE;IAC/F,IAAI;QACF,OAAO,IAAA,aAAK,EAAC,EAAE,CAAC,CAAC;KAClB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,OAAO,EAAE,CAAC;KAClB;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEF,SAAS,OAAO;IAKd,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,SAAS;KACd,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bignum.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/validators/bignum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,gBAAgB,+CAG3B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BigNumFromString = void 0;
|
|
4
|
+
const superstruct_1 = require("superstruct");
|
|
5
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
6
|
+
exports.BigNumFromString = (0, superstruct_1.coerce)((0, superstruct_1.instance)(bignumber_js_1.BigNumber), (0, superstruct_1.string)(), value => {
|
|
7
|
+
if (typeof value === "string")
|
|
8
|
+
return new bignumber_js_1.BigNumber(value, 10);
|
|
9
|
+
throw new Error("invalid big num");
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=bignum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bignum.js","sourceRoot":"","sources":["../../../../src/api/chain/validators/bignum.ts"],"names":[],"mappings":";;;AAAA,6CAAuD;AACvD,+CAAyC;AAE5B,QAAA,gBAAgB,GAAG,IAAA,oBAAM,EAAC,IAAA,sBAAQ,EAAC,wBAAS,CAAC,EAAE,IAAA,oBAAM,GAAE,EAAE,KAAK,CAAC,EAAE;IAC5E,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,wBAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Infer } from "superstruct";
|
|
2
|
+
export type ParsedInfo = Infer<typeof ParsedInfo>;
|
|
3
|
+
export declare const ParsedInfo: import("superstruct").Struct<{
|
|
4
|
+
type: string;
|
|
5
|
+
info?: any;
|
|
6
|
+
}, {
|
|
7
|
+
type: import("superstruct").Struct<string, null>;
|
|
8
|
+
info: import("superstruct").Struct<any, null>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/validators/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,EAAU,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAClD,eAAO,MAAM,UAAU;;;;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ParsedInfo = void 0;
|
|
5
|
+
const superstruct_1 = require("superstruct");
|
|
6
|
+
exports.ParsedInfo = (0, superstruct_1.type)({
|
|
7
|
+
type: (0, superstruct_1.string)(),
|
|
8
|
+
info: (0, superstruct_1.any)(),
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/chain/validators/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAAuD;AAG1C,QAAA,UAAU,GAAG,IAAA,kBAAI,EAAC;IAC7B,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,IAAI,EAAE,IAAA,iBAAG,GAAE;CACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pubkey.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/validators/pubkey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,eAAO,MAAM,mBAAmB,+CAI/B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicKeyFromString = void 0;
|
|
4
|
+
const superstruct_1 = require("superstruct");
|
|
5
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
6
|
+
exports.PublicKeyFromString = (0, superstruct_1.coerce)((0, superstruct_1.instance)(web3_js_1.PublicKey), (0, superstruct_1.string)(), value => new web3_js_1.PublicKey(value));
|
|
7
|
+
//# sourceMappingURL=pubkey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pubkey.js","sourceRoot":"","sources":["../../../../src/api/chain/validators/pubkey.ts"],"names":[],"mappings":";;;AAAA,6CAAuD;AACvD,6CAA4C;AAE/B,QAAA,mBAAmB,GAAG,IAAA,oBAAM,EACvC,IAAA,sBAAQ,EAAC,mBAAS,CAAC,EACnB,IAAA,oBAAM,GAAE,EACR,KAAK,CAAC,EAAE,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAC9B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ConfirmedSignatureInfo, Connection, ParsedTransactionWithMeta, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
+
import { ChainAPI } from ".";
|
|
3
|
+
import { Awaited } from "../../logic";
|
|
4
|
+
import { StakeCreateAccountCommand, StakeDelegateCommand, StakeSplitCommand, StakeUndelegateCommand, StakeWithdrawCommand, TokenCreateATACommand, TokenTransferCommand, TransferCommand } from "../../types";
|
|
5
|
+
import { StakeAccountInfo } from "./account/stake";
|
|
6
|
+
import { TokenAccountInfo } from "./account/token";
|
|
7
|
+
import { VoteAccountInfo } from "./account/vote";
|
|
8
|
+
type ParsedOnChainTokenAccount = Awaited<ReturnType<Connection["getParsedTokenAccountsByOwner"]>>["value"][number];
|
|
9
|
+
type ParsedOnChainStakeAccount = Awaited<ReturnType<Connection["getParsedProgramAccounts"]>>[number];
|
|
10
|
+
export type ParsedOnChainTokenAccountWithInfo = {
|
|
11
|
+
onChainAcc: ParsedOnChainTokenAccount;
|
|
12
|
+
info: TokenAccountInfo;
|
|
13
|
+
};
|
|
14
|
+
export type ParsedOnChainStakeAccountWithInfo = {
|
|
15
|
+
onChainAcc: ParsedOnChainStakeAccount;
|
|
16
|
+
info: StakeAccountInfo;
|
|
17
|
+
};
|
|
18
|
+
export declare function toTokenAccountWithInfo(onChainAcc: ParsedOnChainTokenAccount): ParsedOnChainTokenAccountWithInfo;
|
|
19
|
+
export declare function toStakeAccountWithInfo(onChainAcc: ParsedOnChainStakeAccount): ParsedOnChainStakeAccountWithInfo | undefined;
|
|
20
|
+
export type TransactionDescriptor = {
|
|
21
|
+
parsed: ParsedTransactionWithMeta;
|
|
22
|
+
info: ConfirmedSignatureInfo;
|
|
23
|
+
};
|
|
24
|
+
export declare function getTransactions(address: string, untilTxSignature: string | undefined, api: ChainAPI): Promise<TransactionDescriptor[]>;
|
|
25
|
+
export declare const buildTransferInstructions: ({ sender, recipient, amount, memo, }: TransferCommand) => TransactionInstruction[];
|
|
26
|
+
export declare const buildTokenTransferInstructions: (command: TokenTransferCommand) => TransactionInstruction[];
|
|
27
|
+
export declare function findAssociatedTokenAccountPubkey(ownerAddress: string, mintAddress: string): Promise<PublicKey>;
|
|
28
|
+
export declare const getMaybeTokenAccount: (address: string, api: ChainAPI) => Promise<TokenAccountInfo | undefined | Error>;
|
|
29
|
+
export declare function getMaybeVoteAccount(address: string, api: ChainAPI): Promise<VoteAccountInfo | undefined | Error>;
|
|
30
|
+
export declare function getStakeAccountMinimumBalanceForRentExemption(api: ChainAPI): Promise<number>;
|
|
31
|
+
export declare function getAccountMinimumBalanceForRentExemption(api: ChainAPI, address: string): Promise<number>;
|
|
32
|
+
export declare function getStakeAccountAddressWithSeed({ fromAddress, seed, }: {
|
|
33
|
+
fromAddress: string;
|
|
34
|
+
seed: string;
|
|
35
|
+
}): Promise<string>;
|
|
36
|
+
export declare function buildCreateAssociatedTokenAccountInstruction({ mint, owner, associatedTokenAccountAddress, }: TokenCreateATACommand): TransactionInstruction[];
|
|
37
|
+
export declare function buildStakeDelegateInstructions({ authorizedAccAddr, stakeAccAddr, voteAccAddr, }: StakeDelegateCommand): TransactionInstruction[];
|
|
38
|
+
export declare function buildStakeUndelegateInstructions({ authorizedAccAddr, stakeAccAddr, }: StakeUndelegateCommand): TransactionInstruction[];
|
|
39
|
+
export declare function buildStakeWithdrawInstructions({ authorizedAccAddr, stakeAccAddr, amount, toAccAddr, }: StakeWithdrawCommand): TransactionInstruction[];
|
|
40
|
+
export declare function buildStakeSplitInstructions({ authorizedAccAddr, stakeAccAddr, seed, amount, splitStakeAccAddr, }: StakeSplitCommand): TransactionInstruction[];
|
|
41
|
+
export declare function buildStakeCreateAccountInstructions({ fromAccAddress, stakeAccAddress, seed, amount, stakeAccRentExemptAmount, delegate, }: StakeCreateAccountCommand): TransactionInstruction[];
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=web3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3.d.ts","sourceRoot":"","sources":["../../../src/api/chain/web3.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,yBAAyB,EACzB,SAAS,EAGT,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EAChB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD,KAAK,yBAAyB,GAAG,OAAO,CACtC,UAAU,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC,CACxD,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnB,KAAK,yBAAyB,GAAG,OAAO,CACtC,UAAU,CAAC,UAAU,C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