@ledgerhq/coin-solana 0.7.0-next.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 +27 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +8 -0
- package/lib/api/cached.d.ts +3 -0
- package/lib/api/cached.d.ts.map +1 -0
- package/lib/api/cached.js +41 -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 +96 -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 +272 -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 +134 -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 +988 -0
- package/lib/bridge.integration.test.js.map +1 -0
- package/lib/broadcast.d.ts +7 -0
- package/lib/broadcast.d.ts.map +1 -0
- package/lib/broadcast.js +37 -0
- package/lib/broadcast.js.map +1 -0
- package/lib/buildTransaction.d.ts +5 -0
- package/lib/buildTransaction.d.ts.map +1 -0
- package/lib/buildTransaction.js +67 -0
- package/lib/buildTransaction.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/createTransaction.d.ts +5 -0
- package/lib/createTransaction.d.ts.map +1 -0
- package/lib/createTransaction.js +19 -0
- package/lib/createTransaction.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/estimateMaxSpendable.d.ts +11 -0
- package/lib/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/estimateMaxSpendable.js +63 -0
- package/lib/estimateMaxSpendable.js.map +1 -0
- package/lib/getTransactionStatus.d.ts +5 -0
- package/lib/getTransactionStatus.d.ts.map +1 -0
- package/lib/getTransactionStatus.js +73 -0
- package/lib/getTransactionStatus.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/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/preload-data.d.ts +7 -0
- package/lib/preload-data.d.ts.map +1 -0
- package/lib/preload-data.js +45 -0
- package/lib/preload-data.js.map +1 -0
- package/lib/preload.d.ts +7 -0
- package/lib/preload.d.ts.map +1 -0
- package/lib/preload.js +67 -0
- package/lib/preload.js.map +1 -0
- package/lib/preload.test.d.ts +2 -0
- package/lib/preload.test.d.ts.map +1 -0
- package/lib/preload.test.js +9 -0
- package/lib/preload.test.js.map +1 -0
- package/lib/prepareTransaction.d.ts +5 -0
- package/lib/prepareTransaction.d.ts.map +1 -0
- package/lib/prepareTransaction.js +500 -0
- package/lib/prepareTransaction.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/signOperation.d.ts +7 -0
- package/lib/signOperation.d.ts.map +1 -0
- package/lib/signOperation.js +153 -0
- package/lib/signOperation.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/synchronization.d.ts +5 -0
- package/lib/synchronization.d.ts.map +1 -0
- package/lib/synchronization.js +463 -0
- package/lib/synchronization.js.map +1 -0
- package/lib/transaction.d.ts +15 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +154 -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 +225 -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 +34 -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 +92 -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 +249 -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 +127 -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 +986 -0
- package/lib-es/bridge.integration.test.js.map +1 -0
- package/lib-es/broadcast.d.ts +7 -0
- package/lib-es/broadcast.d.ts.map +1 -0
- package/lib-es/broadcast.js +33 -0
- package/lib-es/broadcast.js.map +1 -0
- package/lib-es/buildTransaction.d.ts +5 -0
- package/lib-es/buildTransaction.d.ts.map +1 -0
- package/lib-es/buildTransaction.js +63 -0
- package/lib-es/buildTransaction.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/createTransaction.d.ts +5 -0
- package/lib-es/createTransaction.d.ts.map +1 -0
- package/lib-es/createTransaction.js +15 -0
- package/lib-es/createTransaction.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/estimateMaxSpendable.d.ts +11 -0
- package/lib-es/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/estimateMaxSpendable.js +55 -0
- package/lib-es/estimateMaxSpendable.js.map +1 -0
- package/lib-es/getTransactionStatus.d.ts +5 -0
- package/lib-es/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/getTransactionStatus.js +69 -0
- package/lib-es/getTransactionStatus.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/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/preload-data.d.ts +7 -0
- package/lib-es/preload-data.d.ts.map +1 -0
- package/lib-es/preload-data.js +39 -0
- package/lib-es/preload-data.js.map +1 -0
- package/lib-es/preload.d.ts +7 -0
- package/lib-es/preload.d.ts.map +1 -0
- package/lib-es/preload.js +62 -0
- package/lib-es/preload.js.map +1 -0
- package/lib-es/preload.test.d.ts +2 -0
- package/lib-es/preload.test.d.ts.map +1 -0
- package/lib-es/preload.test.js +7 -0
- package/lib-es/preload.test.js.map +1 -0
- package/lib-es/prepareTransaction.d.ts +5 -0
- package/lib-es/prepareTransaction.d.ts.map +1 -0
- package/lib-es/prepareTransaction.js +497 -0
- package/lib-es/prepareTransaction.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/signOperation.d.ts +7 -0
- package/lib-es/signOperation.d.ts.map +1 -0
- package/lib-es/signOperation.js +146 -0
- package/lib-es/signOperation.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/synchronization.d.ts +5 -0
- package/lib-es/synchronization.d.ts.map +1 -0
- package/lib-es/synchronization.js +456 -0
- package/lib-es/synchronization.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 +148 -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 +225 -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 +90 -0
- package/src/api/cached.ts +79 -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 +212 -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 +192 -0
- package/src/bridge/js.ts +42 -0
- package/src/bridge.integration.test.ts +1104 -0
- package/src/broadcast.ts +38 -0
- package/src/buildTransaction.ts +81 -0
- package/src/cli-transaction.ts +246 -0
- package/src/createTransaction.ts +18 -0
- package/src/datasets/solana.scanAccounts.1.ts +9 -0
- package/src/deviceTransactionConfig.ts +302 -0
- package/src/errors.ts +61 -0
- package/src/estimateMaxSpendable.ts +72 -0
- package/src/getTransactionStatus.ts +79 -0
- package/src/hw-getAddress.ts +22 -0
- package/src/logic.ts +123 -0
- package/src/preload-data.ts +46 -0
- package/src/preload.test.ts +14 -0
- package/src/preload.ts +74 -0
- package/src/prepareTransaction.ts +686 -0
- package/src/serialization.ts +81 -0
- package/src/signOperation.ts +315 -0
- package/src/signer.ts +10 -0
- package/src/specs.ts +514 -0
- package/src/speculos-deviceActions.ts +229 -0
- package/src/synchronization.ts +729 -0
- package/src/transaction.ts +199 -0
- package/src/tx-fees.ts +206 -0
- package/src/types.ts +291 -0
- package/src/utils.ts +176 -0
- package/src/validator-app/index.ts +79 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/stake.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAiC,MAAM,aAAa,CAAC;AAInE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;EAAsE,CAAC;AAEpG,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAChD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
2
|
+
import { number, nullable, enums, type } from "superstruct";
|
|
3
|
+
import { PublicKeyFromString } from "../validators/pubkey";
|
|
4
|
+
import { BigNumFromString } from "../validators/bignum";
|
|
5
|
+
export const StakeAccountType = enums(["uninitialized", "initialized", "delegated", "rewardsPool"]);
|
|
6
|
+
export const StakeMeta = type({
|
|
7
|
+
rentExemptReserve: BigNumFromString,
|
|
8
|
+
authorized: type({
|
|
9
|
+
staker: PublicKeyFromString,
|
|
10
|
+
withdrawer: PublicKeyFromString,
|
|
11
|
+
}),
|
|
12
|
+
lockup: type({
|
|
13
|
+
unixTimestamp: number(),
|
|
14
|
+
epoch: number(),
|
|
15
|
+
custodian: PublicKeyFromString,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
export const StakeAccountInfo = type({
|
|
19
|
+
meta: StakeMeta,
|
|
20
|
+
stake: nullable(type({
|
|
21
|
+
delegation: type({
|
|
22
|
+
voter: PublicKeyFromString,
|
|
23
|
+
stake: BigNumFromString,
|
|
24
|
+
activationEpoch: BigNumFromString,
|
|
25
|
+
deactivationEpoch: BigNumFromString,
|
|
26
|
+
warmupCooldownRate: number(),
|
|
27
|
+
}),
|
|
28
|
+
creditsObserved: number(),
|
|
29
|
+
})),
|
|
30
|
+
});
|
|
31
|
+
export const StakeAccount = type({
|
|
32
|
+
type: StakeAccountType,
|
|
33
|
+
info: StakeAccountInfo,
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=stake.js.map
|
|
@@ -0,0 +1 @@
|
|
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
|
|
|
1
|
+
/// <reference types="@solana/web3.js" />
|
|
2
|
+
import { Infer } from "superstruct";
|
|
3
|
+
export type TokenAccountType = Infer<typeof TokenAccountType>;
|
|
4
|
+
export declare const TokenAccountType: import("superstruct").Struct<"mint" | "account" | "multisig", {
|
|
5
|
+
mint: "mint";
|
|
6
|
+
account: "account";
|
|
7
|
+
multisig: "multisig";
|
|
8
|
+
}>;
|
|
9
|
+
export type TokenAccountState = Infer<typeof AccountState>;
|
|
10
|
+
declare const AccountState: import("superstruct").Struct<"uninitialized" | "initialized" | "frozen", {
|
|
11
|
+
uninitialized: "uninitialized";
|
|
12
|
+
initialized: "initialized";
|
|
13
|
+
frozen: "frozen";
|
|
14
|
+
}>;
|
|
15
|
+
export type TokenAccountInfo = Infer<typeof TokenAccountInfo>;
|
|
16
|
+
export declare const TokenAccountInfo: import("superstruct").Struct<{
|
|
17
|
+
mint: import("@solana/web3.js").PublicKey;
|
|
18
|
+
owner: import("@solana/web3.js").PublicKey;
|
|
19
|
+
tokenAmount: {
|
|
20
|
+
amount: string;
|
|
21
|
+
decimals: number;
|
|
22
|
+
uiAmountString: string;
|
|
23
|
+
};
|
|
24
|
+
state: "uninitialized" | "initialized" | "frozen";
|
|
25
|
+
isNative: boolean;
|
|
26
|
+
rentExemptReserve?: {
|
|
27
|
+
amount: string;
|
|
28
|
+
decimals: number;
|
|
29
|
+
uiAmountString: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
delegate?: import("@solana/web3.js").PublicKey | undefined;
|
|
32
|
+
delegatedAmount?: {
|
|
33
|
+
amount: string;
|
|
34
|
+
decimals: number;
|
|
35
|
+
uiAmountString: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
closeAuthority?: import("@solana/web3.js").PublicKey | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
40
|
+
owner: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
41
|
+
tokenAmount: import("superstruct").Struct<{
|
|
42
|
+
amount: string;
|
|
43
|
+
decimals: number;
|
|
44
|
+
uiAmountString: string;
|
|
45
|
+
}, {
|
|
46
|
+
decimals: import("superstruct").Struct<number, null>;
|
|
47
|
+
uiAmountString: import("superstruct").Struct<string, null>;
|
|
48
|
+
amount: import("superstruct").Struct<string, null>;
|
|
49
|
+
}>;
|
|
50
|
+
delegate: import("superstruct").Struct<import("@solana/web3.js").PublicKey | undefined, null>;
|
|
51
|
+
state: import("superstruct").Struct<"uninitialized" | "initialized" | "frozen", {
|
|
52
|
+
uninitialized: "uninitialized";
|
|
53
|
+
initialized: "initialized";
|
|
54
|
+
frozen: "frozen";
|
|
55
|
+
}>;
|
|
56
|
+
isNative: import("superstruct").Struct<boolean, null>;
|
|
57
|
+
rentExemptReserve: import("superstruct").Struct<{
|
|
58
|
+
amount: string;
|
|
59
|
+
decimals: number;
|
|
60
|
+
uiAmountString: string;
|
|
61
|
+
} | undefined, {
|
|
62
|
+
decimals: import("superstruct").Struct<number, null>;
|
|
63
|
+
uiAmountString: import("superstruct").Struct<string, null>;
|
|
64
|
+
amount: import("superstruct").Struct<string, null>;
|
|
65
|
+
}>;
|
|
66
|
+
delegatedAmount: import("superstruct").Struct<{
|
|
67
|
+
amount: string;
|
|
68
|
+
decimals: number;
|
|
69
|
+
uiAmountString: string;
|
|
70
|
+
} | undefined, {
|
|
71
|
+
decimals: import("superstruct").Struct<number, null>;
|
|
72
|
+
uiAmountString: import("superstruct").Struct<string, null>;
|
|
73
|
+
amount: import("superstruct").Struct<string, null>;
|
|
74
|
+
}>;
|
|
75
|
+
closeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | undefined, null>;
|
|
76
|
+
}>;
|
|
77
|
+
export type MintAccountInfo = Infer<typeof MintAccountInfo>;
|
|
78
|
+
export declare const MintAccountInfo: import("superstruct").Struct<{
|
|
79
|
+
decimals: number;
|
|
80
|
+
mintAuthority: import("@solana/web3.js").PublicKey | null;
|
|
81
|
+
supply: string;
|
|
82
|
+
isInitialized: boolean;
|
|
83
|
+
freezeAuthority: import("@solana/web3.js").PublicKey | null;
|
|
84
|
+
}, {
|
|
85
|
+
mintAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | null, null>;
|
|
86
|
+
supply: import("superstruct").Struct<string, null>;
|
|
87
|
+
decimals: import("superstruct").Struct<number, null>;
|
|
88
|
+
isInitialized: import("superstruct").Struct<boolean, null>;
|
|
89
|
+
freezeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey | null, null>;
|
|
90
|
+
}>;
|
|
91
|
+
export type MultisigAccountInfo = Infer<typeof MultisigAccountInfo>;
|
|
92
|
+
export declare const MultisigAccountInfo: import("superstruct").Struct<{
|
|
93
|
+
isInitialized: boolean;
|
|
94
|
+
numRequiredSigners: number;
|
|
95
|
+
numValidSigners: number;
|
|
96
|
+
signers: import("@solana/web3.js").PublicKey[];
|
|
97
|
+
}, {
|
|
98
|
+
numRequiredSigners: import("superstruct").Struct<number, null>;
|
|
99
|
+
numValidSigners: import("superstruct").Struct<number, null>;
|
|
100
|
+
isInitialized: import("superstruct").Struct<boolean, null>;
|
|
101
|
+
signers: import("superstruct").Struct<import("@solana/web3.js").PublicKey[], import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>>;
|
|
102
|
+
}>;
|
|
103
|
+
export type TokenAccount = Infer<typeof TokenAccount>;
|
|
104
|
+
export declare const TokenAccount: import("superstruct").Struct<{
|
|
105
|
+
type: "mint" | "account" | "multisig";
|
|
106
|
+
info?: any;
|
|
107
|
+
}, {
|
|
108
|
+
type: import("superstruct").Struct<"mint" | "account" | "multisig", {
|
|
109
|
+
mint: "mint";
|
|
110
|
+
account: "account";
|
|
111
|
+
multisig: "multisig";
|
|
112
|
+
}>;
|
|
113
|
+
info: import("superstruct").Struct<any, null>;
|
|
114
|
+
}>;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/token.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,KAAK,EAUN,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;EAAyC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3D,QAAA,MAAM,YAAY;;;;EAAoD,CAAC;AAQvE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;EAM1B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,mBAAmB;;;;;;;;;;EAK9B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;EAGvB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
2
|
+
import { number, optional, enums, any, boolean, string, array, type, nullable, } from "superstruct";
|
|
3
|
+
import { PublicKeyFromString } from "../validators/pubkey";
|
|
4
|
+
export const TokenAccountType = enums(["mint", "account", "multisig"]);
|
|
5
|
+
const AccountState = enums(["initialized", "uninitialized", "frozen"]);
|
|
6
|
+
const TokenAmount = type({
|
|
7
|
+
decimals: number(),
|
|
8
|
+
uiAmountString: string(),
|
|
9
|
+
amount: string(),
|
|
10
|
+
});
|
|
11
|
+
export const TokenAccountInfo = type({
|
|
12
|
+
mint: PublicKeyFromString,
|
|
13
|
+
owner: PublicKeyFromString,
|
|
14
|
+
tokenAmount: TokenAmount,
|
|
15
|
+
delegate: optional(PublicKeyFromString),
|
|
16
|
+
state: AccountState,
|
|
17
|
+
isNative: boolean(),
|
|
18
|
+
rentExemptReserve: optional(TokenAmount),
|
|
19
|
+
delegatedAmount: optional(TokenAmount),
|
|
20
|
+
closeAuthority: optional(PublicKeyFromString),
|
|
21
|
+
});
|
|
22
|
+
export const MintAccountInfo = type({
|
|
23
|
+
mintAuthority: nullable(PublicKeyFromString),
|
|
24
|
+
supply: string(),
|
|
25
|
+
decimals: number(),
|
|
26
|
+
isInitialized: boolean(),
|
|
27
|
+
freezeAuthority: nullable(PublicKeyFromString),
|
|
28
|
+
});
|
|
29
|
+
export const MultisigAccountInfo = type({
|
|
30
|
+
numRequiredSigners: number(),
|
|
31
|
+
numValidSigners: number(),
|
|
32
|
+
isInitialized: boolean(),
|
|
33
|
+
signers: array(PublicKeyFromString),
|
|
34
|
+
});
|
|
35
|
+
export const TokenAccount = type({
|
|
36
|
+
type: TokenAccountType,
|
|
37
|
+
info: any(),
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../src/api/chain/account/token.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAEL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,GAAG,EACH,OAAO,EACP,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGvE,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
1
|
+
/// <reference types="@solana/web3.js" />
|
|
2
|
+
import { Infer } from "superstruct";
|
|
3
|
+
export type VoteAccountType = Infer<typeof VoteAccountType>;
|
|
4
|
+
export declare const VoteAccountType: import("superstruct").Struct<"vote", {
|
|
5
|
+
vote: "vote";
|
|
6
|
+
}>;
|
|
7
|
+
export type AuthorizedVoter = Infer<typeof AuthorizedVoter>;
|
|
8
|
+
export declare const AuthorizedVoter: import("superstruct").Struct<{
|
|
9
|
+
epoch: number;
|
|
10
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
11
|
+
}, {
|
|
12
|
+
authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
13
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
14
|
+
}>;
|
|
15
|
+
export type PriorVoter = Infer<typeof PriorVoter>;
|
|
16
|
+
export declare const PriorVoter: import("superstruct").Struct<{
|
|
17
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
18
|
+
epochOfLastAuthorizedSwitch: number;
|
|
19
|
+
targetEpoch: number;
|
|
20
|
+
}, {
|
|
21
|
+
authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
22
|
+
epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
|
|
23
|
+
targetEpoch: import("superstruct").Struct<number, null>;
|
|
24
|
+
}>;
|
|
25
|
+
export type EpochCredits = Infer<typeof EpochCredits>;
|
|
26
|
+
export declare const EpochCredits: import("superstruct").Struct<{
|
|
27
|
+
epoch: number;
|
|
28
|
+
credits: string;
|
|
29
|
+
previousCredits: string;
|
|
30
|
+
}, {
|
|
31
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
32
|
+
credits: import("superstruct").Struct<string, null>;
|
|
33
|
+
previousCredits: import("superstruct").Struct<string, null>;
|
|
34
|
+
}>;
|
|
35
|
+
export type Vote = Infer<typeof Vote>;
|
|
36
|
+
export declare const Vote: import("superstruct").Struct<{
|
|
37
|
+
slot: number;
|
|
38
|
+
confirmationCount: number;
|
|
39
|
+
}, {
|
|
40
|
+
slot: import("superstruct").Struct<number, null>;
|
|
41
|
+
confirmationCount: import("superstruct").Struct<number, null>;
|
|
42
|
+
}>;
|
|
43
|
+
export type VoteAccountInfo = Infer<typeof VoteAccountInfo>;
|
|
44
|
+
export declare const VoteAccountInfo: import("superstruct").Struct<{
|
|
45
|
+
commission: number;
|
|
46
|
+
authorizedVoters: {
|
|
47
|
+
epoch: number;
|
|
48
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
49
|
+
}[];
|
|
50
|
+
authorizedWithdrawer: import("@solana/web3.js").PublicKey;
|
|
51
|
+
epochCredits: {
|
|
52
|
+
epoch: number;
|
|
53
|
+
credits: string;
|
|
54
|
+
previousCredits: string;
|
|
55
|
+
}[];
|
|
56
|
+
lastTimestamp: {
|
|
57
|
+
slot: number;
|
|
58
|
+
timestamp: number;
|
|
59
|
+
};
|
|
60
|
+
nodePubkey: import("@solana/web3.js").PublicKey;
|
|
61
|
+
priorVoters: {
|
|
62
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
63
|
+
epochOfLastAuthorizedSwitch: number;
|
|
64
|
+
targetEpoch: number;
|
|
65
|
+
}[];
|
|
66
|
+
rootSlot: number | null;
|
|
67
|
+
votes: {
|
|
68
|
+
slot: number;
|
|
69
|
+
confirmationCount: number;
|
|
70
|
+
}[];
|
|
71
|
+
}, {
|
|
72
|
+
authorizedVoters: import("superstruct").Struct<{
|
|
73
|
+
epoch: number;
|
|
74
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
75
|
+
}[], import("superstruct").Struct<{
|
|
76
|
+
epoch: number;
|
|
77
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
78
|
+
}, {
|
|
79
|
+
authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
80
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
81
|
+
}>>;
|
|
82
|
+
authorizedWithdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
83
|
+
commission: import("superstruct").Struct<number, null>;
|
|
84
|
+
epochCredits: import("superstruct").Struct<{
|
|
85
|
+
epoch: number;
|
|
86
|
+
credits: string;
|
|
87
|
+
previousCredits: string;
|
|
88
|
+
}[], import("superstruct").Struct<{
|
|
89
|
+
epoch: number;
|
|
90
|
+
credits: string;
|
|
91
|
+
previousCredits: string;
|
|
92
|
+
}, {
|
|
93
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
94
|
+
credits: import("superstruct").Struct<string, null>;
|
|
95
|
+
previousCredits: import("superstruct").Struct<string, null>;
|
|
96
|
+
}>>;
|
|
97
|
+
lastTimestamp: import("superstruct").Struct<{
|
|
98
|
+
slot: number;
|
|
99
|
+
timestamp: number;
|
|
100
|
+
}, {
|
|
101
|
+
slot: import("superstruct").Struct<number, null>;
|
|
102
|
+
timestamp: import("superstruct").Struct<number, null>;
|
|
103
|
+
}>;
|
|
104
|
+
nodePubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
105
|
+
priorVoters: import("superstruct").Struct<{
|
|
106
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
107
|
+
epochOfLastAuthorizedSwitch: number;
|
|
108
|
+
targetEpoch: number;
|
|
109
|
+
}[], import("superstruct").Struct<{
|
|
110
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
111
|
+
epochOfLastAuthorizedSwitch: number;
|
|
112
|
+
targetEpoch: number;
|
|
113
|
+
}, {
|
|
114
|
+
authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
115
|
+
epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
|
|
116
|
+
targetEpoch: import("superstruct").Struct<number, null>;
|
|
117
|
+
}>>;
|
|
118
|
+
rootSlot: import("superstruct").Struct<number | null, null>;
|
|
119
|
+
votes: import("superstruct").Struct<{
|
|
120
|
+
slot: number;
|
|
121
|
+
confirmationCount: number;
|
|
122
|
+
}[], import("superstruct").Struct<{
|
|
123
|
+
slot: number;
|
|
124
|
+
confirmationCount: number;
|
|
125
|
+
}, {
|
|
126
|
+
slot: import("superstruct").Struct<number, null>;
|
|
127
|
+
confirmationCount: import("superstruct").Struct<number, null>;
|
|
128
|
+
}>>;
|
|
129
|
+
}>;
|
|
130
|
+
export type VoteAccount = Infer<typeof VoteAccount>;
|
|
131
|
+
export declare const VoteAccount: import("superstruct").Struct<{
|
|
132
|
+
type: "vote";
|
|
133
|
+
info: {
|
|
134
|
+
commission: number;
|
|
135
|
+
authorizedVoters: {
|
|
136
|
+
epoch: number;
|
|
137
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
138
|
+
}[];
|
|
139
|
+
authorizedWithdrawer: import("@solana/web3.js").PublicKey;
|
|
140
|
+
epochCredits: {
|
|
141
|
+
epoch: number;
|
|
142
|
+
credits: string;
|
|
143
|
+
previousCredits: string;
|
|
144
|
+
}[];
|
|
145
|
+
lastTimestamp: {
|
|
146
|
+
slot: number;
|
|
147
|
+
timestamp: number;
|
|
148
|
+
};
|
|
149
|
+
nodePubkey: import("@solana/web3.js").PublicKey;
|
|
150
|
+
priorVoters: {
|
|
151
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
152
|
+
epochOfLastAuthorizedSwitch: number;
|
|
153
|
+
targetEpoch: number;
|
|
154
|
+
}[];
|
|
155
|
+
rootSlot: number | null;
|
|
156
|
+
votes: {
|
|
157
|
+
slot: number;
|
|
158
|
+
confirmationCount: number;
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
}, {
|
|
162
|
+
type: import("superstruct").Struct<"vote", {
|
|
163
|
+
vote: "vote";
|
|
164
|
+
}>;
|
|
165
|
+
info: import("superstruct").Struct<{
|
|
166
|
+
commission: number;
|
|
167
|
+
authorizedVoters: {
|
|
168
|
+
epoch: number;
|
|
169
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
170
|
+
}[];
|
|
171
|
+
authorizedWithdrawer: import("@solana/web3.js").PublicKey;
|
|
172
|
+
epochCredits: {
|
|
173
|
+
epoch: number;
|
|
174
|
+
credits: string;
|
|
175
|
+
previousCredits: string;
|
|
176
|
+
}[];
|
|
177
|
+
lastTimestamp: {
|
|
178
|
+
slot: number;
|
|
179
|
+
timestamp: number;
|
|
180
|
+
};
|
|
181
|
+
nodePubkey: import("@solana/web3.js").PublicKey;
|
|
182
|
+
priorVoters: {
|
|
183
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
184
|
+
epochOfLastAuthorizedSwitch: number;
|
|
185
|
+
targetEpoch: number;
|
|
186
|
+
}[];
|
|
187
|
+
rootSlot: number | null;
|
|
188
|
+
votes: {
|
|
189
|
+
slot: number;
|
|
190
|
+
confirmationCount: number;
|
|
191
|
+
}[];
|
|
192
|
+
}, {
|
|
193
|
+
authorizedVoters: import("superstruct").Struct<{
|
|
194
|
+
epoch: number;
|
|
195
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
196
|
+
}[], import("superstruct").Struct<{
|
|
197
|
+
epoch: number;
|
|
198
|
+
authorizedVoter: import("@solana/web3.js").PublicKey;
|
|
199
|
+
}, {
|
|
200
|
+
authorizedVoter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
201
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
202
|
+
}>>;
|
|
203
|
+
authorizedWithdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
204
|
+
commission: import("superstruct").Struct<number, null>;
|
|
205
|
+
epochCredits: import("superstruct").Struct<{
|
|
206
|
+
epoch: number;
|
|
207
|
+
credits: string;
|
|
208
|
+
previousCredits: string;
|
|
209
|
+
}[], import("superstruct").Struct<{
|
|
210
|
+
epoch: number;
|
|
211
|
+
credits: string;
|
|
212
|
+
previousCredits: string;
|
|
213
|
+
}, {
|
|
214
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
215
|
+
credits: import("superstruct").Struct<string, null>;
|
|
216
|
+
previousCredits: import("superstruct").Struct<string, null>;
|
|
217
|
+
}>>;
|
|
218
|
+
lastTimestamp: import("superstruct").Struct<{
|
|
219
|
+
slot: number;
|
|
220
|
+
timestamp: number;
|
|
221
|
+
}, {
|
|
222
|
+
slot: import("superstruct").Struct<number, null>;
|
|
223
|
+
timestamp: import("superstruct").Struct<number, null>;
|
|
224
|
+
}>;
|
|
225
|
+
nodePubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
226
|
+
priorVoters: import("superstruct").Struct<{
|
|
227
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
228
|
+
epochOfLastAuthorizedSwitch: number;
|
|
229
|
+
targetEpoch: number;
|
|
230
|
+
}[], import("superstruct").Struct<{
|
|
231
|
+
authorizedPubkey: import("@solana/web3.js").PublicKey;
|
|
232
|
+
epochOfLastAuthorizedSwitch: number;
|
|
233
|
+
targetEpoch: number;
|
|
234
|
+
}, {
|
|
235
|
+
authorizedPubkey: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
236
|
+
epochOfLastAuthorizedSwitch: import("superstruct").Struct<number, null>;
|
|
237
|
+
targetEpoch: import("superstruct").Struct<number, null>;
|
|
238
|
+
}>>;
|
|
239
|
+
rootSlot: import("superstruct").Struct<number | null, null>;
|
|
240
|
+
votes: import("superstruct").Struct<{
|
|
241
|
+
slot: number;
|
|
242
|
+
confirmationCount: number;
|
|
243
|
+
}[], import("superstruct").Struct<{
|
|
244
|
+
slot: number;
|
|
245
|
+
confirmationCount: number;
|
|
246
|
+
}, {
|
|
247
|
+
slot: import("superstruct").Struct<number, null>;
|
|
248
|
+
confirmationCount: import("superstruct").Struct<number, null>;
|
|
249
|
+
}>>;
|
|
250
|
+
}>;
|
|
251
|
+
}>;
|
|
252
|
+
//# sourceMappingURL=vote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/vote.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAgD,MAAM,aAAa,CAAC;AAGlF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;EAAkB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;EAG1B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAClD,eAAO,MAAM,UAAU;;;;;;;;EAIrB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;EAIvB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACtC,eAAO,MAAM,IAAI;;;;;;EAGf,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACpD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
2
|
+
import { enums, number, array, type, nullable, string } from "superstruct";
|
|
3
|
+
import { PublicKeyFromString } from "../validators/pubkey";
|
|
4
|
+
export const VoteAccountType = enums(["vote"]);
|
|
5
|
+
export const AuthorizedVoter = type({
|
|
6
|
+
authorizedVoter: PublicKeyFromString,
|
|
7
|
+
epoch: number(),
|
|
8
|
+
});
|
|
9
|
+
export const PriorVoter = type({
|
|
10
|
+
authorizedPubkey: PublicKeyFromString,
|
|
11
|
+
epochOfLastAuthorizedSwitch: number(),
|
|
12
|
+
targetEpoch: number(),
|
|
13
|
+
});
|
|
14
|
+
export const EpochCredits = type({
|
|
15
|
+
epoch: number(),
|
|
16
|
+
credits: string(),
|
|
17
|
+
previousCredits: string(),
|
|
18
|
+
});
|
|
19
|
+
export const Vote = type({
|
|
20
|
+
slot: number(),
|
|
21
|
+
confirmationCount: number(),
|
|
22
|
+
});
|
|
23
|
+
export const VoteAccountInfo = type({
|
|
24
|
+
authorizedVoters: array(AuthorizedVoter),
|
|
25
|
+
authorizedWithdrawer: PublicKeyFromString,
|
|
26
|
+
commission: number(),
|
|
27
|
+
epochCredits: array(EpochCredits),
|
|
28
|
+
lastTimestamp: type({
|
|
29
|
+
slot: number(),
|
|
30
|
+
timestamp: number(),
|
|
31
|
+
}),
|
|
32
|
+
nodePubkey: PublicKeyFromString,
|
|
33
|
+
priorVoters: array(PriorVoter),
|
|
34
|
+
rootSlot: nullable(number()),
|
|
35
|
+
votes: array(Vote),
|
|
36
|
+
});
|
|
37
|
+
export const VoteAccount = type({
|
|
38
|
+
type: VoteAccountType,
|
|
39
|
+
info: VoteAccountInfo,
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=vote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vote.js","sourceRoot":"","sources":["../../../../src/api/chain/account/vote.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAS,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO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E,eAAe;IACrB,IAAI,EAAE,eAAe;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Connection, VersionedMessage, SignaturesForAddressOptions } from "@solana/web3.js";
|
|
2
|
+
import { Awaited } from "../../logic";
|
|
3
|
+
export declare const LATEST_BLOCKHASH_MOCK = "EEbZs6DmDyDjucyYbo3LwVJU7pQYuVopYcYTSEZXskW3";
|
|
4
|
+
export type Config = {
|
|
5
|
+
readonly endpoint: string;
|
|
6
|
+
};
|
|
7
|
+
export type ChainAPI = Readonly<{
|
|
8
|
+
getBalance: (address: string) => Promise<number>;
|
|
9
|
+
getLatestBlockhash: () => Promise<string>;
|
|
10
|
+
getFeeForMessage: (message: VersionedMessage) => Promise<number | null>;
|
|
11
|
+
getBalanceAndContext: (address: string) => ReturnType<Connection["getBalanceAndContext"]>;
|
|
12
|
+
getParsedTokenAccountsByOwner: (address: string) => ReturnType<Connection["getParsedTokenAccountsByOwner"]>;
|
|
13
|
+
getStakeAccountsByStakeAuth: (authAddr: string) => ReturnType<Connection["getParsedProgramAccounts"]>;
|
|
14
|
+
getStakeAccountsByWithdrawAuth: (authAddr: string) => ReturnType<Connection["getParsedProgramAccounts"]>;
|
|
15
|
+
getStakeActivation: (stakeAccAddr: string) => ReturnType<Connection["getStakeActivation"]>;
|
|
16
|
+
getInflationReward: (addresses: string[]) => ReturnType<Connection["getInflationReward"]>;
|
|
17
|
+
getVoteAccounts: () => ReturnType<Connection["getVoteAccounts"]>;
|
|
18
|
+
getSignaturesForAddress: (address: string, opts?: SignaturesForAddressOptions) => ReturnType<Connection["getSignaturesForAddress"]>;
|
|
19
|
+
getParsedTransactions: (signatures: string[]) => ReturnType<Connection["getParsedTransactions"]>;
|
|
20
|
+
getAccountInfo: (address: string) => Promise<Awaited<ReturnType<Connection["getParsedAccountInfo"]>>["value"]>;
|
|
21
|
+
sendRawTransaction: (buffer: Buffer) => ReturnType<Connection["sendRawTransaction"]>;
|
|
22
|
+
findAssocTokenAccAddress: (owner: string, mint: string) => Promise<string>;
|
|
23
|
+
getAssocTokenAccMinNativeBalance: () => Promise<number>;
|
|
24
|
+
getMinimumBalanceForRentExemption: (dataLength: number) => Promise<number>;
|
|
25
|
+
getEpochInfo: () => ReturnType<Connection["getEpochInfo"]>;
|
|
26
|
+
config: Config;
|
|
27
|
+
}>;
|
|
28
|
+
export declare function getChainAPI(config: Config, logger?: (url: string, options: any) => void): ChainAPI;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/chain/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,UAAU,EAEV,gBAAgB,EAGhB,2BAA2B,EAE5B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,qBAAqB,iDAAiD,CAAC;AAEpF,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,kBAAkB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C,gBAAgB,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAExE,oBAAoB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAE1F,6BAA6B,EAAE,CAC7B,OAAO,EAAE,MAAM,KACZ,UAAU,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAE7D,2BAA2B,EAAE,CAC3B,QAAQ,EAAE,MAAM,KACb,UAAU,CAAC,U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,CAAC;IAE3D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAOH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,GAC3C,QAAQ,CA+HV"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TOKEN_PROGRAM_ID, getAssociatedTokenAddress, getMinimumBalanceForRentExemptAccount, } from "@solana/spl-token";
|
|
2
|
+
import { Connection, PublicKey, sendAndConfirmRawTransaction, StakeProgram, } from "@solana/web3.js";
|
|
3
|
+
import { makeLRUCache, minutes } from "@ledgerhq/live-network/cache";
|
|
4
|
+
import { getEnv } from "@ledgerhq/live-env";
|
|
5
|
+
import { NetworkError } from "@ledgerhq/errors";
|
|
6
|
+
export const LATEST_BLOCKHASH_MOCK = "EEbZs6DmDyDjucyYbo3LwVJU7pQYuVopYcYTSEZXskW3";
|
|
7
|
+
// Naive mode, allow us to filter in sentry all this error comming from Sol RPC node
|
|
8
|
+
const remapErrors = (e) => {
|
|
9
|
+
throw new NetworkError(e === null || e === void 0 ? void 0 : e.message);
|
|
10
|
+
};
|
|
11
|
+
export function getChainAPI(config, logger) {
|
|
12
|
+
const fetchMiddleware = logger === undefined
|
|
13
|
+
? undefined
|
|
14
|
+
: (url, options, fetch) => {
|
|
15
|
+
logger(url, options);
|
|
16
|
+
fetch(url, options);
|
|
17
|
+
};
|
|
18
|
+
const connection = () => {
|
|
19
|
+
return new Connection(config.endpoint, Object.assign(Object.assign({}, (fetchMiddleware ? { fetchMiddleware } : {})), { commitment: "finalized", confirmTransactionInitialTimeout: getEnv("SOLANA_TX_CONFIRMATION_TIMEOUT") || 0 }));
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
getBalance: (address) => connection().getBalance(new PublicKey(address)).catch(remapErrors),
|
|
23
|
+
getLatestBlockhash: () => connection()
|
|
24
|
+
.getLatestBlockhash()
|
|
25
|
+
.then(r => r.blockhash)
|
|
26
|
+
.catch(remapErrors),
|
|
27
|
+
getFeeForMessage: (msg) => connection()
|
|
28
|
+
.getFeeForMessage(msg)
|
|
29
|
+
.then(r => r.value)
|
|
30
|
+
.catch(remapErrors),
|
|
31
|
+
getBalanceAndContext: (address) => connection().getBalanceAndContext(new PublicKey(address)).catch(remapErrors),
|
|
32
|
+
getParsedTokenAccountsByOwner: (address) => connection()
|
|
33
|
+
.getParsedTokenAccountsByOwner(new PublicKey(address), {
|
|
34
|
+
programId: TOKEN_PROGRAM_ID,
|
|
35
|
+
})
|
|
36
|
+
.catch(remapErrors),
|
|
37
|
+
getStakeAccountsByStakeAuth: makeLRUCache((authAddr) => connection()
|
|
38
|
+
.getParsedProgramAccounts(StakeProgram.programId, {
|
|
39
|
+
filters: [
|
|
40
|
+
{
|
|
41
|
+
memcmp: {
|
|
42
|
+
offset: 12,
|
|
43
|
+
bytes: authAddr,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
})
|
|
48
|
+
.catch(remapErrors), (addr) => addr, minutes(3)),
|
|
49
|
+
getStakeAccountsByWithdrawAuth: makeLRUCache((authAddr) => connection()
|
|
50
|
+
.getParsedProgramAccounts(StakeProgram.programId, {
|
|
51
|
+
filters: [
|
|
52
|
+
{
|
|
53
|
+
memcmp: {
|
|
54
|
+
offset: 44,
|
|
55
|
+
bytes: authAddr,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
.catch(remapErrors), (addr) => addr, minutes(3)),
|
|
61
|
+
getStakeActivation: (stakeAccAddr) => connection().getStakeActivation(new PublicKey(stakeAccAddr)).catch(remapErrors),
|
|
62
|
+
getInflationReward: (addresses) => connection()
|
|
63
|
+
.getInflationReward(addresses.map(addr => new PublicKey(addr)))
|
|
64
|
+
.catch(remapErrors),
|
|
65
|
+
getVoteAccounts: () => connection().getVoteAccounts().catch(remapErrors),
|
|
66
|
+
getSignaturesForAddress: (address, opts) => connection().getSignaturesForAddress(new PublicKey(address), opts).catch(remapErrors),
|
|
67
|
+
getParsedTransactions: (signatures) => connection()
|
|
68
|
+
.getParsedTransactions(signatures, {
|
|
69
|
+
maxSupportedTransactionVersion: 0,
|
|
70
|
+
})
|
|
71
|
+
.catch(remapErrors),
|
|
72
|
+
getAccountInfo: (address) => connection()
|
|
73
|
+
.getParsedAccountInfo(new PublicKey(address))
|
|
74
|
+
.then(r => r.value)
|
|
75
|
+
.catch(remapErrors),
|
|
76
|
+
sendRawTransaction: (buffer) => {
|
|
77
|
+
return sendAndConfirmRawTransaction(connection(), buffer, {
|
|
78
|
+
commitment: "confirmed",
|
|
79
|
+
}).catch(remapErrors);
|
|
80
|
+
},
|
|
81
|
+
findAssocTokenAccAddress: (owner, mint) => {
|
|
82
|
+
return getAssociatedTokenAddress(new PublicKey(mint), new PublicKey(owner))
|
|
83
|
+
.then(r => r.toBase58())
|
|
84
|
+
.catch(remapErrors);
|
|
85
|
+
},
|
|
86
|
+
getAssocTokenAccMinNativeBalance: () => getMinimumBalanceForRentExemptAccount(connection()).catch(remapErrors),
|
|
87
|
+
getMinimumBalanceForRentExemption: (dataLength) => connection().getMinimumBalanceForRentExemption(dataLength).catch(remapErrors),
|
|
88
|
+
getEpochInfo: () => connection().getEpochInfo().catch(remapErrors),
|
|
89
|
+
config,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/chain/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,UAAU,EAGV,SAAS,EACT,4BAA4B,EAE5B,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,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