@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
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
es6: true,
|
|
5
|
+
},
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ["src/**/*.test.{ts,tsx}"],
|
|
9
|
+
env: {
|
|
10
|
+
"jest/globals": true,
|
|
11
|
+
},
|
|
12
|
+
plugins: ["jest"],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
rules: {
|
|
16
|
+
"no-console": ["error", { allow: ["warn", "error"] }],
|
|
17
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
18
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": [
|
|
3
|
+
"src/api/index.ts",
|
|
4
|
+
"src/bridge/js.ts",
|
|
5
|
+
"src/cli-transaction.ts",
|
|
6
|
+
"src/deviceTransactionConfig.ts",
|
|
7
|
+
"src/errors.ts",
|
|
8
|
+
"src/hw-getAddress.ts",
|
|
9
|
+
"src/serialization.ts",
|
|
10
|
+
"src/specs.ts",
|
|
11
|
+
"src/transaction.ts"
|
|
12
|
+
],
|
|
13
|
+
"ignorePatterns": ["**/node_modules/**", "**/*.fixture.ts", "**/*.mock.ts", "**/*.test.{js,jsx,ts,tsx}"],
|
|
14
|
+
"ignoreUnresolved": [],
|
|
15
|
+
"ignoreUnimported": ["src/datasets/solana.scanAccounts.1.ts"]
|
|
16
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @ledgerhq/coin-solana
|
|
2
|
+
|
|
3
|
+
## 0.7.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#6876](https://github.com/LedgerHQ/ledger-live/pull/6876) [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4) Thanks [@lambertkevin](https://github.com/lambertkevin)! - Update coin implementations to use new account bridge types & implement cleaner architecture
|
|
8
|
+
|
|
9
|
+
- [#6721](https://github.com/LedgerHQ/ledger-live/pull/6721) [`1cee8ff`](https://github.com/LedgerHQ/ledger-live/commit/1cee8ff557fdd6e44f55d4d396805e02c2733cc1) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Solana as a coin module
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#6844](https://github.com/LedgerHQ/ledger-live/pull/6844) [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Simplify SignerContext generic signature
|
|
14
|
+
|
|
15
|
+
- [#6946](https://github.com/LedgerHQ/ledger-live/pull/6946) [`056946e`](https://github.com/LedgerHQ/ledger-live/commit/056946e5a0a27c202e6153996a625ede07ca0833) Thanks [@mikhd](https://github.com/mikhd)! - Optimisations of solana delegations performance
|
|
16
|
+
|
|
17
|
+
- [#6816](https://github.com/LedgerHQ/ledger-live/pull/6816) [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Split currencies utils between CoinFmk and LLC
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`b9f1f71`](https://github.com/LedgerHQ/ledger-live/commit/b9f1f715355752d8c57c24ecd6a6d166b80f689d), [`815ae3d`](https://github.com/LedgerHQ/ledger-live/commit/815ae3dae8027823854ada837df3dc983d09b10f), [`de5de2d`](https://github.com/LedgerHQ/ledger-live/commit/de5de2d273ed6966c82bde2c3a95b98ba594204f), [`83e5690`](https://github.com/LedgerHQ/ledger-live/commit/83e5690429e41ecd1c508b3398904ae747085cf7), [`6eec3f9`](https://github.com/LedgerHQ/ledger-live/commit/6eec3f973ecea36bafc7ebc8b88526399048cdc4), [`4c01029`](https://github.com/LedgerHQ/ledger-live/commit/4c01029b4d4feb32dab2f9e77da1126050d8c1bc), [`326cae0`](https://github.com/LedgerHQ/ledger-live/commit/326cae088cc33795536deb1d868c86e8dbeb6a13), [`6c35cc5`](https://github.com/LedgerHQ/ledger-live/commit/6c35cc564cb050614ee571907f628ecf15ec4584), [`4499990`](https://github.com/LedgerHQ/ledger-live/commit/449999066c58ae5df371dfb92a7230f9b5e90a60), [`a18c28e`](https://github.com/LedgerHQ/ledger-live/commit/a18c28e3f6a6132bd5e53d5b61721084b3aa19e8), [`cec1599`](https://github.com/LedgerHQ/ledger-live/commit/cec1599a41aa1a18a249e34312164bc93b63972f), [`801265b`](https://github.com/LedgerHQ/ledger-live/commit/801265b7ff3ed7ebd0012eb50f70898557a2dd52), [`6d44f25`](https://github.com/LedgerHQ/ledger-live/commit/6d44f255c5b2f453c61d0b754807db1f76d7174e), [`f19960f`](https://github.com/LedgerHQ/ledger-live/commit/f19960f2e7104e5bdf332269fa92fda47455e17d), [`3b9c93c`](https://github.com/LedgerHQ/ledger-live/commit/3b9c93c0de8ceff2af96a6ee8e42b8d9c2ab7af0), [`6623cd1`](https://github.com/LedgerHQ/ledger-live/commit/6623cd13102bd8340bd7d4dfdd469934527985c3), [`2f2b754`](https://github.com/LedgerHQ/ledger-live/commit/2f2b754b1350360ca0d9f761ca6e4a8cbaff141b), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`6552679`](https://github.com/LedgerHQ/ledger-live/commit/65526794bb4d1fbc7e286c0e1c0b6d021413fc8c), [`fda6a81`](https://github.com/LedgerHQ/ledger-live/commit/fda6a814544b3a1debceab22f69485911e76cadc), [`689e6e5`](https://github.com/LedgerHQ/ledger-live/commit/689e6e5a443170b8e6c2b404cc99af2e67d8e8e4), [`1a5b277`](https://github.com/LedgerHQ/ledger-live/commit/1a5b2777b7b71aa4c4e353010eeb9e3dab432bca), [`a115d6c`](https://github.com/LedgerHQ/ledger-live/commit/a115d6cd5dcbcc753d02dedb80f5eb1693d1a249), [`a2505de`](https://github.com/LedgerHQ/ledger-live/commit/a2505deb93dd0722981a90e12082ff1dbefc29b1), [`f17a3cb`](https://github.com/LedgerHQ/ledger-live/commit/f17a3cbc16abf7fadf686025a5ca56ec1a1e7bb6), [`60cd799`](https://github.com/LedgerHQ/ledger-live/commit/60cd799e693e3ae0712a5a9e88206b5304bbc214), [`84274a6`](https://github.com/LedgerHQ/ledger-live/commit/84274a6e764a385f707bc811ead7a7e92a02ed6a)]:
|
|
20
|
+
- @ledgerhq/types-cryptoassets@7.13.0-next.0
|
|
21
|
+
- @ledgerhq/cryptoassets@13.1.0-next.0
|
|
22
|
+
- @ledgerhq/types-live@6.48.0-next.0
|
|
23
|
+
- @ledgerhq/devices@8.4.0-next.0
|
|
24
|
+
- @ledgerhq/errors@6.17.0-next.0
|
|
25
|
+
- @ledgerhq/coin-framework@0.14.0-next.0
|
|
26
|
+
- @ledgerhq/live-network@1.3.0-next.0
|
|
27
|
+
- @ledgerhq/live-env@2.1.0-next.0
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-present Ledger https://www.ledger.com/
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/jest.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached.d.ts","sourceRoot":"","sources":["../../src/api/cached.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnC,wBAAgB,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAiE9C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cached = void 0;
|
|
7
|
+
const cache_1 = require("@ledgerhq/live-network/cache");
|
|
8
|
+
const object_hash_1 = __importDefault(require("object-hash"));
|
|
9
|
+
const cacheKeyAddress = (address) => address;
|
|
10
|
+
const cacheKeyEmpty = () => "";
|
|
11
|
+
const cacheKeyAssocTokenAccAddress = (owner, mint) => `${owner}:${mint}`;
|
|
12
|
+
const cacheKeyMinimumBalanceForRentExemption = (dataLengt) => dataLengt.toString();
|
|
13
|
+
const cacheKeyTransactions = (signatures) => (0, object_hash_1.default)([...signatures].sort());
|
|
14
|
+
const cacheKeyByArgs = (...args) => (0, object_hash_1.default)(args);
|
|
15
|
+
function cached(api) {
|
|
16
|
+
return {
|
|
17
|
+
findAssocTokenAccAddress: (0, cache_1.makeLRUCache)(api.findAssocTokenAccAddress, cacheKeyAssocTokenAccAddress, (0, cache_1.minutes)(1000)),
|
|
18
|
+
getAccountInfo: (0, cache_1.makeLRUCache)(api.getAccountInfo, cacheKeyAddress, (0, cache_1.seconds)(30)),
|
|
19
|
+
getAssocTokenAccMinNativeBalance: (0, cache_1.makeLRUCache)(api.getAssocTokenAccMinNativeBalance, cacheKeyEmpty, (0, cache_1.minutes)(5)),
|
|
20
|
+
getBalance: (0, cache_1.makeLRUCache)(api.getBalance, cacheKeyAddress, (0, cache_1.seconds)(30)),
|
|
21
|
+
getBalanceAndContext: (0, cache_1.makeLRUCache)(api.getBalanceAndContext, cacheKeyAddress, (0, cache_1.seconds)(30)),
|
|
22
|
+
getParsedTransactions: (0, cache_1.makeLRUCache)(api.getParsedTransactions, cacheKeyTransactions, (0, cache_1.seconds)(30)),
|
|
23
|
+
getParsedTokenAccountsByOwner: (0, cache_1.makeLRUCache)(api.getParsedTokenAccountsByOwner, cacheKeyAddress, (0, cache_1.minutes)(1)),
|
|
24
|
+
// cached by default in api
|
|
25
|
+
getStakeAccountsByStakeAuth: api.getStakeAccountsByStakeAuth,
|
|
26
|
+
getStakeAccountsByWithdrawAuth: api.getStakeAccountsByWithdrawAuth,
|
|
27
|
+
getStakeActivation: (0, cache_1.makeLRUCache)(api.getStakeActivation, cacheKeyAddress, (0, cache_1.minutes)(1)),
|
|
28
|
+
getInflationReward: (0, cache_1.makeLRUCache)(api.getInflationReward, cacheKeyByArgs, (0, cache_1.minutes)(5)),
|
|
29
|
+
getVoteAccounts: (0, cache_1.makeLRUCache)(api.getVoteAccounts, cacheKeyEmpty, (0, cache_1.minutes)(1)),
|
|
30
|
+
getLatestBlockhash: (0, cache_1.makeLRUCache)(api.getLatestBlockhash, cacheKeyEmpty, (0, cache_1.seconds)(15)),
|
|
31
|
+
getFeeForMessage: (0, cache_1.makeLRUCache)(api.getFeeForMessage, msg => msg.serialize().toString(), (0, cache_1.minutes)(1)),
|
|
32
|
+
getSignaturesForAddress: (0, cache_1.makeLRUCache)(api.getSignaturesForAddress, cacheKeyByArgs, (0, cache_1.seconds)(30)),
|
|
33
|
+
getMinimumBalanceForRentExemption: (0, cache_1.makeLRUCache)(api.getMinimumBalanceForRentExemption, cacheKeyMinimumBalanceForRentExemption, (0, cache_1.minutes)(5)),
|
|
34
|
+
// do not cache
|
|
35
|
+
sendRawTransaction: api.sendRawTransaction,
|
|
36
|
+
getEpochInfo: (0, cache_1.makeLRUCache)(api.getEpochInfo, cacheKeyEmpty, (0, cache_1.minutes)(1)),
|
|
37
|
+
config: api.config,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.cached = cached;
|
|
41
|
+
//# sourceMappingURL=cached.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached.js","sourceRoot":"","sources":["../../src/api/cached.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA8E;AAC9E,8DAA+B;AAG/B,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC;AACrD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,EAAW,CAAC;AACxC,MAAM,4BAA4B,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AACzF,MAAM,sCAAsC,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAE3F,MAAM,oBAAoB,GAAG,CAAC,UAAoB,EAAE,EAAE,CAAC,IAAA,qBAAI,EAAC,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAEpF,MAAM,cAAc,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,IAAA,qBAAI,EAAC,IAAI,CAAC,CAAC;AAEtD,SAAgB,MAAM,CAAC,GAAa;IAClC,OAAO;QACL,wBAAwB,EAAE,IAAA,oBAAY,EACpC,GAAG,CAAC,wBAAwB,EAC5B,4BAA4B,EAC5B,IAAA,eAAO,EAAC,IAAI,CAAC,CACd;QAED,cAAc,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE9E,gCAAgC,EAAE,IAAA,oBAAY,EAC5C,GAAG,CAAC,gCAAgC,EACpC,aAAa,EACb,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,UAAU,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAEtE,oBAAoB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,oBAAoB,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE1F,qBAAqB,EAAE,IAAA,oBAAY,EACjC,GAAG,CAAC,qBAAqB,EACzB,oBAAoB,EACpB,IAAA,eAAO,EAAC,EAAE,CAAC,CACZ;QAED,6BAA6B,EAAE,IAAA,oBAAY,EACzC,GAAG,CAAC,6BAA6B,EACjC,eAAe,EACf,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,2BAA2B;QAC3B,2BAA2B,EAAE,GAAG,CAAC,2BAA2B;QAC5D,8BAA8B,EAAE,GAAG,CAAC,8BAA8B;QAElE,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,eAAe,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAErF,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,cAAc,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAEpF,eAAe,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,eAAe,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAE7E,kBAAkB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,kBAAkB,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAEpF,gBAAgB,EAAE,IAAA,oBAAY,EAC5B,GAAG,CAAC,gBAAgB,EACpB,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EACjC,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,uBAAuB,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,uBAAuB,EAAE,cAAc,EAAE,IAAA,eAAO,EAAC,EAAE,CAAC,CAAC;QAE/F,iCAAiC,EAAE,IAAA,oBAAY,EAC7C,GAAG,CAAC,iCAAiC,EACrC,sCAAsC,EACtC,IAAA,eAAO,EAAC,CAAC,CAAC,CACX;QAED,eAAe;QACf,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;QAE1C,YAAY,EAAE,IAAA,oBAAY,EAAC,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,IAAA,eAAO,EAAC,CAAC,CAAC,CAAC;QAEvE,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAC;AACJ,CAAC;AAjED,wBAiEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryParseAsVoteAccount = exports.parseTokenAccountInfo = exports.tryParseAsTokenAccount = void 0;
|
|
4
|
+
var parser_1 = require("./parser");
|
|
5
|
+
Object.defineProperty(exports, "tryParseAsTokenAccount", { enumerable: true, get: function () { return parser_1.tryParseAsTokenAccount; } });
|
|
6
|
+
Object.defineProperty(exports, "parseTokenAccountInfo", { enumerable: true, get: function () { return parser_1.parseTokenAccountInfo; } });
|
|
7
|
+
Object.defineProperty(exports, "tryParseAsVoteAccount", { enumerable: true, get: function () { return parser_1.tryParseAsVoteAccount; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/chain/account/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgG;AAAvF,gHAAA,sBAAsB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AAAE,+GAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParsedAccountData } from "@solana/web3.js";
|
|
2
|
+
import { StakeAccountInfo } from "./stake";
|
|
3
|
+
import { TokenAccountInfo } from "./token";
|
|
4
|
+
import { VoteAccountInfo } from "./vote";
|
|
5
|
+
export declare function parseTokenAccountInfo(info: unknown): TokenAccountInfo;
|
|
6
|
+
export declare function tryParseAsTokenAccount(data: ParsedAccountData): TokenAccountInfo | undefined | Error;
|
|
7
|
+
export declare function parseVoteAccountInfo(info: unknown): VoteAccountInfo;
|
|
8
|
+
export declare function tryParseAsVoteAccount(data: ParsedAccountData): VoteAccountInfo | undefined | Error;
|
|
9
|
+
export declare function parseStakeAccountInfo(info: unknown): StakeAccountInfo;
|
|
10
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/api/chain/account/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAe,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEtD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAErE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,iBAAiB,GACtB,gBAAgB,GAAG,SAAS,GAAG,KAAK,CAetC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAEnE;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,GACtB,eAAe,GAAG,SAAS,GAAG,KAAK,CAarC;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAErE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseStakeAccountInfo = exports.tryParseAsVoteAccount = exports.parseVoteAccountInfo = exports.tryParseAsTokenAccount = exports.parseTokenAccountInfo = void 0;
|
|
4
|
+
const superstruct_1 = require("superstruct");
|
|
5
|
+
const constants_1 = require("../program/constants");
|
|
6
|
+
const validators_1 = require("../validators");
|
|
7
|
+
const stake_1 = require("./stake");
|
|
8
|
+
const token_1 = require("./token");
|
|
9
|
+
const vote_1 = require("./vote");
|
|
10
|
+
function parseTokenAccountInfo(info) {
|
|
11
|
+
return (0, superstruct_1.create)(info, token_1.TokenAccountInfo);
|
|
12
|
+
}
|
|
13
|
+
exports.parseTokenAccountInfo = parseTokenAccountInfo;
|
|
14
|
+
function tryParseAsTokenAccount(data) {
|
|
15
|
+
const routine = () => {
|
|
16
|
+
const info = (0, superstruct_1.create)(data.parsed, validators_1.ParsedInfo);
|
|
17
|
+
if (data.program === "spl-token") {
|
|
18
|
+
const parsed = (0, superstruct_1.create)(info, token_1.TokenAccount);
|
|
19
|
+
if (parsed.type === "account") {
|
|
20
|
+
return parseTokenAccountInfo(parsed.info);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
};
|
|
25
|
+
return onThrowReturnError(routine);
|
|
26
|
+
}
|
|
27
|
+
exports.tryParseAsTokenAccount = tryParseAsTokenAccount;
|
|
28
|
+
function parseVoteAccountInfo(info) {
|
|
29
|
+
return (0, superstruct_1.create)(info, vote_1.VoteAccountInfo);
|
|
30
|
+
}
|
|
31
|
+
exports.parseVoteAccountInfo = parseVoteAccountInfo;
|
|
32
|
+
function tryParseAsVoteAccount(data) {
|
|
33
|
+
const routine = () => {
|
|
34
|
+
const info = (0, superstruct_1.create)(data.parsed, validators_1.ParsedInfo);
|
|
35
|
+
if (data.program === constants_1.PARSED_PROGRAMS.VOTE) {
|
|
36
|
+
const parsed = (0, superstruct_1.create)(info, vote_1.VoteAccount);
|
|
37
|
+
return parseVoteAccountInfo(parsed.info);
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
return onThrowReturnError(routine);
|
|
42
|
+
}
|
|
43
|
+
exports.tryParseAsVoteAccount = tryParseAsVoteAccount;
|
|
44
|
+
function parseStakeAccountInfo(info) {
|
|
45
|
+
return (0, superstruct_1.create)(info, stake_1.StakeAccountInfo);
|
|
46
|
+
}
|
|
47
|
+
exports.parseStakeAccountInfo = parseStakeAccountInfo;
|
|
48
|
+
function onThrowReturnError(fn) {
|
|
49
|
+
try {
|
|
50
|
+
return fn();
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
return e instanceof Error ? e : new Error(JSON.stringify(e));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/api/chain/account/parser.ts"],"names":[],"mappings":";;;AACA,6CAAqC;AACrC,oDAAuD;AACvD,8CAA2C;AAC3C,mCAA2C;AAC3C,mCAAyD;AACzD,iCAAsD;AAEtD,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,wBAAgB,CAAC,CAAC;AACxC,CAAC;AAFD,sDAEC;AAED,SAAgB,sBAAsB,CACpC,IAAuB;IAEvB,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,oBAAM,EAAC,IAAI,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YACjC,MAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,IAAI,EAAE,oBAAY,CAAC,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAO,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAjBD,wDAiBC;AAED,SAAgB,oBAAoB,CAAC,IAAa;IAChD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,sBAAe,CAAC,CAAC;AACvC,CAAC;AAFD,oDAEC;AAED,SAAgB,qBAAqB,CACnC,IAAuB;IAEvB,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,oBAAM,EAAC,IAAI,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;QAE7C,IAAI,IAAI,CAAC,OAAO,KAAK,2BAAe,CAAC,IAAI,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,IAAI,EAAE,kBAAW,CAAC,CAAC;YACzC,OAAO,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAfD,sDAeC;AAED,SAAgB,qBAAqB,CAAC,IAAa;IACjD,OAAO,IAAA,oBAAM,EAAC,IAAI,EAAE,wBAAgB,CAAC,CAAC;AACxC,CAAC;AAFD,sDAEC;AAED,SAAS,kBAAkB,CAAI,EAAW;IACxC,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/// <reference types="@solana/web3.js" />
|
|
2
|
+
import { Infer } from "superstruct";
|
|
3
|
+
export type StakeAccountType = Infer<typeof StakeAccountType>;
|
|
4
|
+
export declare const StakeAccountType: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
|
|
5
|
+
uninitialized: "uninitialized";
|
|
6
|
+
initialized: "initialized";
|
|
7
|
+
delegated: "delegated";
|
|
8
|
+
rewardsPool: "rewardsPool";
|
|
9
|
+
}>;
|
|
10
|
+
export type StakeMeta = Infer<typeof StakeMeta>;
|
|
11
|
+
export declare const StakeMeta: import("superstruct").Struct<{
|
|
12
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
13
|
+
authorized: {
|
|
14
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
15
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
16
|
+
};
|
|
17
|
+
lockup: {
|
|
18
|
+
unixTimestamp: number;
|
|
19
|
+
epoch: number;
|
|
20
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
24
|
+
authorized: import("superstruct").Struct<{
|
|
25
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
26
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
27
|
+
}, {
|
|
28
|
+
staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
29
|
+
withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
30
|
+
}>;
|
|
31
|
+
lockup: import("superstruct").Struct<{
|
|
32
|
+
unixTimestamp: number;
|
|
33
|
+
epoch: number;
|
|
34
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
35
|
+
}, {
|
|
36
|
+
unixTimestamp: import("superstruct").Struct<number, null>;
|
|
37
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
38
|
+
custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
export type StakeAccountInfo = Infer<typeof StakeAccountInfo>;
|
|
42
|
+
export declare const StakeAccountInfo: import("superstruct").Struct<{
|
|
43
|
+
meta: {
|
|
44
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
45
|
+
authorized: {
|
|
46
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
47
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
48
|
+
};
|
|
49
|
+
lockup: {
|
|
50
|
+
unixTimestamp: number;
|
|
51
|
+
epoch: number;
|
|
52
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
stake: {
|
|
56
|
+
delegation: {
|
|
57
|
+
stake: import("bignumber.js").BigNumber;
|
|
58
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
59
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
60
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
61
|
+
warmupCooldownRate: number;
|
|
62
|
+
};
|
|
63
|
+
creditsObserved: number;
|
|
64
|
+
} | null;
|
|
65
|
+
}, {
|
|
66
|
+
meta: import("superstruct").Struct<{
|
|
67
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
68
|
+
authorized: {
|
|
69
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
70
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
71
|
+
};
|
|
72
|
+
lockup: {
|
|
73
|
+
unixTimestamp: number;
|
|
74
|
+
epoch: number;
|
|
75
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
79
|
+
authorized: import("superstruct").Struct<{
|
|
80
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
81
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
82
|
+
}, {
|
|
83
|
+
staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
84
|
+
withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
85
|
+
}>;
|
|
86
|
+
lockup: import("superstruct").Struct<{
|
|
87
|
+
unixTimestamp: number;
|
|
88
|
+
epoch: number;
|
|
89
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
90
|
+
}, {
|
|
91
|
+
unixTimestamp: import("superstruct").Struct<number, null>;
|
|
92
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
93
|
+
custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
94
|
+
}>;
|
|
95
|
+
}>;
|
|
96
|
+
stake: import("superstruct").Struct<{
|
|
97
|
+
delegation: {
|
|
98
|
+
stake: import("bignumber.js").BigNumber;
|
|
99
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
100
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
101
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
102
|
+
warmupCooldownRate: number;
|
|
103
|
+
};
|
|
104
|
+
creditsObserved: number;
|
|
105
|
+
} | null, {
|
|
106
|
+
delegation: import("superstruct").Struct<{
|
|
107
|
+
stake: import("bignumber.js").BigNumber;
|
|
108
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
109
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
110
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
111
|
+
warmupCooldownRate: number;
|
|
112
|
+
}, {
|
|
113
|
+
voter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
114
|
+
stake: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
115
|
+
activationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
116
|
+
deactivationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
117
|
+
warmupCooldownRate: import("superstruct").Struct<number, null>;
|
|
118
|
+
}>;
|
|
119
|
+
creditsObserved: import("superstruct").Struct<number, null>;
|
|
120
|
+
}>;
|
|
121
|
+
}>;
|
|
122
|
+
export type StakeAccount = Infer<typeof StakeAccount>;
|
|
123
|
+
export declare const StakeAccount: import("superstruct").Struct<{
|
|
124
|
+
type: "uninitialized" | "initialized" | "delegated" | "rewardsPool";
|
|
125
|
+
info: {
|
|
126
|
+
meta: {
|
|
127
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
128
|
+
authorized: {
|
|
129
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
130
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
131
|
+
};
|
|
132
|
+
lockup: {
|
|
133
|
+
unixTimestamp: number;
|
|
134
|
+
epoch: number;
|
|
135
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
stake: {
|
|
139
|
+
delegation: {
|
|
140
|
+
stake: import("bignumber.js").BigNumber;
|
|
141
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
142
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
143
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
144
|
+
warmupCooldownRate: number;
|
|
145
|
+
};
|
|
146
|
+
creditsObserved: number;
|
|
147
|
+
} | null;
|
|
148
|
+
};
|
|
149
|
+
}, {
|
|
150
|
+
type: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
|
|
151
|
+
uninitialized: "uninitialized";
|
|
152
|
+
initialized: "initialized";
|
|
153
|
+
delegated: "delegated";
|
|
154
|
+
rewardsPool: "rewardsPool";
|
|
155
|
+
}>;
|
|
156
|
+
info: import("superstruct").Struct<{
|
|
157
|
+
meta: {
|
|
158
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
159
|
+
authorized: {
|
|
160
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
161
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
162
|
+
};
|
|
163
|
+
lockup: {
|
|
164
|
+
unixTimestamp: number;
|
|
165
|
+
epoch: number;
|
|
166
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
stake: {
|
|
170
|
+
delegation: {
|
|
171
|
+
stake: import("bignumber.js").BigNumber;
|
|
172
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
173
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
174
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
175
|
+
warmupCooldownRate: number;
|
|
176
|
+
};
|
|
177
|
+
creditsObserved: number;
|
|
178
|
+
} | null;
|
|
179
|
+
}, {
|
|
180
|
+
meta: import("superstruct").Struct<{
|
|
181
|
+
rentExemptReserve: import("bignumber.js").BigNumber;
|
|
182
|
+
authorized: {
|
|
183
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
184
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
185
|
+
};
|
|
186
|
+
lockup: {
|
|
187
|
+
unixTimestamp: number;
|
|
188
|
+
epoch: number;
|
|
189
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
190
|
+
};
|
|
191
|
+
}, {
|
|
192
|
+
rentExemptReserve: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
193
|
+
authorized: import("superstruct").Struct<{
|
|
194
|
+
staker: import("@solana/web3.js").PublicKey;
|
|
195
|
+
withdrawer: import("@solana/web3.js").PublicKey;
|
|
196
|
+
}, {
|
|
197
|
+
staker: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
198
|
+
withdrawer: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
199
|
+
}>;
|
|
200
|
+
lockup: import("superstruct").Struct<{
|
|
201
|
+
unixTimestamp: number;
|
|
202
|
+
epoch: number;
|
|
203
|
+
custodian: import("@solana/web3.js").PublicKey;
|
|
204
|
+
}, {
|
|
205
|
+
unixTimestamp: import("superstruct").Struct<number, null>;
|
|
206
|
+
epoch: import("superstruct").Struct<number, null>;
|
|
207
|
+
custodian: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
208
|
+
}>;
|
|
209
|
+
}>;
|
|
210
|
+
stake: import("superstruct").Struct<{
|
|
211
|
+
delegation: {
|
|
212
|
+
stake: import("bignumber.js").BigNumber;
|
|
213
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
214
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
215
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
216
|
+
warmupCooldownRate: number;
|
|
217
|
+
};
|
|
218
|
+
creditsObserved: number;
|
|
219
|
+
} | null, {
|
|
220
|
+
delegation: import("superstruct").Struct<{
|
|
221
|
+
stake: import("bignumber.js").BigNumber;
|
|
222
|
+
voter: import("@solana/web3.js").PublicKey;
|
|
223
|
+
activationEpoch: import("bignumber.js").BigNumber;
|
|
224
|
+
deactivationEpoch: import("bignumber.js").BigNumber;
|
|
225
|
+
warmupCooldownRate: number;
|
|
226
|
+
}, {
|
|
227
|
+
voter: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
228
|
+
stake: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
229
|
+
activationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
230
|
+
deactivationEpoch: import("superstruct").Struct<import("bignumber.js").BigNumber, null>;
|
|
231
|
+
warmupCooldownRate: import("superstruct").Struct<number, null>;
|
|
232
|
+
}>;
|
|
233
|
+
creditsObserved: import("superstruct").Struct<number, null>;
|
|
234
|
+
}>;
|
|
235
|
+
}>;
|
|
236
|
+
}>;
|
|
237
|
+
//# sourceMappingURL=stake.d.ts.map
|
|
@@ -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,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.StakeAccount = exports.StakeAccountInfo = exports.StakeMeta = exports.StakeAccountType = void 0;
|
|
5
|
+
const superstruct_1 = require("superstruct");
|
|
6
|
+
const pubkey_1 = require("../validators/pubkey");
|
|
7
|
+
const bignum_1 = require("../validators/bignum");
|
|
8
|
+
exports.StakeAccountType = (0, superstruct_1.enums)(["uninitialized", "initialized", "delegated", "rewardsPool"]);
|
|
9
|
+
exports.StakeMeta = (0, superstruct_1.type)({
|
|
10
|
+
rentExemptReserve: bignum_1.BigNumFromString,
|
|
11
|
+
authorized: (0, superstruct_1.type)({
|
|
12
|
+
staker: pubkey_1.PublicKeyFromString,
|
|
13
|
+
withdrawer: pubkey_1.PublicKeyFromString,
|
|
14
|
+
}),
|
|
15
|
+
lockup: (0, superstruct_1.type)({
|
|
16
|
+
unixTimestamp: (0, superstruct_1.number)(),
|
|
17
|
+
epoch: (0, superstruct_1.number)(),
|
|
18
|
+
custodian: pubkey_1.PublicKeyFromString,
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
exports.StakeAccountInfo = (0, superstruct_1.type)({
|
|
22
|
+
meta: exports.StakeMeta,
|
|
23
|
+
stake: (0, superstruct_1.nullable)((0, superstruct_1.type)({
|
|
24
|
+
delegation: (0, superstruct_1.type)({
|
|
25
|
+
voter: pubkey_1.PublicKeyFromString,
|
|
26
|
+
stake: bignum_1.BigNumFromString,
|
|
27
|
+
activationEpoch: bignum_1.BigNumFromString,
|
|
28
|
+
deactivationEpoch: bignum_1.BigNumFromString,
|
|
29
|
+
warmupCooldownRate: (0, superstruct_1.number)(),
|
|
30
|
+
}),
|
|
31
|
+
creditsObserved: (0, superstruct_1.number)(),
|
|
32
|
+
})),
|
|
33
|
+
});
|
|
34
|
+
exports.StakeAccount = (0, superstruct_1.type)({
|
|
35
|
+
type: exports.StakeAccountType,
|
|
36
|
+
info: exports.StakeAccountInfo,
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=stake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake.js","sourceRoot":"","sources":["../../../../src/api/chain/account/stake.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,6CAAmE;AACnE,iDAA2D;AAC3D,iDAAwD;AAG3C,QAAA,gBAAgB,GAAG,IAAA,mBAAK,EAAC,CAAC,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAGvF,QAAA,SAAS,GAAG,IAAA,kBAAI,EAAC;IAC5B,iBAAiB,EAAE,yBAAgB;IACnC,UAAU,EAAE,IAAA,kBAAI,EAAC;QACf,MAAM,EAAE,4BAAmB;QAC3B,UAAU,EAAE,4BAAmB;KAChC,CAAC;IACF,MAAM,EAAE,IAAA,kBAAI,EAAC;QACX,aAAa,EAAE,IAAA,oBAAM,GAAE;QACvB,KAAK,EAAE,IAAA,oBAAM,GAAE;QACf,SAAS,EAAE,4BAAmB;KAC/B,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,IAAA,kBAAI,EAAC;IACnC,IAAI,EAAE,iBAAS;IACf,KAAK,EAAE,IAAA,sBAAQ,EACb,IAAA,kBAAI,EAAC;QACH,UAAU,EAAE,IAAA,kBAAI,EAAC;YACf,KAAK,EAAE,4BAAmB;YAC1B,KAAK,EAAE,yBAAgB;YACvB,eAAe,EAAE,yBAAgB;YACjC,iBAAiB,EAAE,yBAAgB;YACnC,kBAAkB,EAAE,IAAA,oBAAM,GAAE;SAC7B,CAAC;QACF,eAAe,EAAE,IAAA,oBAAM,GAAE;KAC1B,CAAC,CACH;CACF,CAAC,CAAC;AAGU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,wBAAgB;CACvB,CAAC,CAAC"}
|