@ledgerhq/live-common 21.20.0 → 21.21.0-rc.2
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/lib/__tests__/families/bitcoin/wallet-btc/utils.test.js +4 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/utils.test.js.map +1 -1
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js +12 -0
- package/lib/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.js.map +1 -1
- package/lib/__tests__/test-helpers/setup.js +1 -0
- package/lib/__tests__/test-helpers/setup.js.map +1 -1
- package/lib/account/pending.d.ts +1 -1
- package/lib/api/Ledger.d.ts.map +1 -1
- package/lib/api/Ledger.js +12 -2
- package/lib/api/Ledger.js.map +1 -1
- package/lib/api/explorerConfig/index.d.ts.map +1 -1
- package/lib/api/explorerConfig/index.js +5 -1
- package/lib/api/explorerConfig/index.js.map +1 -1
- package/lib/data/icons/react/cro.d.ts +8 -0
- package/lib/data/icons/react/cro.d.ts.map +1 -0
- package/lib/data/icons/react/cro.js +33 -0
- package/lib/data/icons/react/cro.js.map +1 -0
- package/lib/data/icons/react/index.d.ts +2 -0
- package/lib/data/icons/react/index.d.ts.map +1 -1
- package/lib/data/icons/react/index.js +12 -8
- package/lib/data/icons/react/index.js.map +1 -1
- package/lib/data/icons/react/sol.d.ts +8 -0
- package/lib/data/icons/react/sol.d.ts.map +1 -0
- package/lib/data/icons/react/sol.js +30 -0
- package/lib/data/icons/react/sol.js.map +1 -0
- package/lib/data/icons/reactNative/cro.d.ts +8 -0
- package/lib/data/icons/reactNative/cro.d.ts.map +1 -0
- package/lib/data/icons/reactNative/cro.js +34 -0
- package/lib/data/icons/reactNative/cro.js.map +1 -0
- package/lib/data/icons/reactNative/index.d.ts +2 -0
- package/lib/data/icons/reactNative/index.d.ts.map +1 -1
- package/lib/data/icons/reactNative/index.js +12 -8
- package/lib/data/icons/reactNative/index.js.map +1 -1
- package/lib/data/icons/reactNative/sol.d.ts +8 -0
- package/lib/data/icons/reactNative/sol.d.ts.map +1 -0
- package/lib/data/icons/reactNative/sol.js +31 -0
- package/lib/data/icons/reactNative/sol.js.map +1 -0
- package/lib/derivation.d.ts +7 -0
- package/lib/derivation.d.ts.map +1 -1
- package/lib/derivation.js +16 -1
- package/lib/derivation.js.map +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -0
- package/lib/errors.js.map +1 -1
- package/lib/families/bitcoin/exchange.d.ts +1 -1
- package/lib/families/bitcoin/getAccountNetworkInfo.d.ts.map +1 -1
- package/lib/families/bitcoin/getAccountNetworkInfo.js +3 -2
- package/lib/families/bitcoin/getAccountNetworkInfo.js.map +1 -1
- package/lib/families/bitcoin/js-signOperation.d.ts.map +1 -1
- package/lib/families/bitcoin/js-signOperation.js +7 -2
- package/lib/families/bitcoin/js-signOperation.js.map +1 -1
- package/lib/families/bitcoin/js-synchronisation.d.ts +2 -2
- package/lib/families/bitcoin/specs.d.ts +1 -0
- package/lib/families/bitcoin/specs.d.ts.map +1 -1
- package/lib/families/bitcoin/specs.js +14 -1
- package/lib/families/bitcoin/specs.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +8 -1
- package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts +16 -0
- package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts.map +1 -0
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js +248 -0
- package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -0
- package/lib/families/bitcoin/wallet-btc/crypto/factory.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/factory.js +5 -0
- package/lib/families/bitcoin/wallet-btc/crypto/factory.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/index.d.ts +1 -0
- package/lib/families/bitcoin/wallet-btc/crypto/index.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/index.js +3 -1
- package/lib/families/bitcoin/wallet-btc/crypto/index.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +13 -3
- package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js +8 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js +8 -1
- package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/utils.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/utils.js +6 -1
- package/lib/families/bitcoin/wallet-btc/utils.js.map +1 -1
- package/lib/families/bitcoin/wallet-btc/wallet.d.ts +2 -0
- package/lib/families/bitcoin/wallet-btc/wallet.d.ts.map +1 -1
- package/lib/families/bitcoin/wallet-btc/wallet.js +15 -7
- package/lib/families/bitcoin/wallet-btc/wallet.js.map +1 -1
- package/lib/families/crypto_org/js-synchronisation.d.ts +2 -2
- package/lib/families/elrond/js-synchronisation.d.ts +2 -2
- package/lib/families/ethereum/synchronisation.d.ts.map +1 -1
- package/lib/families/ethereum/synchronisation.js +2 -2
- package/lib/families/ethereum/synchronisation.js.map +1 -1
- package/lib/families/polkadot/api/sidecar.js +4 -2
- package/lib/families/polkadot/api/sidecar.js.map +1 -1
- package/lib/families/polkadot/js-synchronisation.d.ts +2 -2
- package/lib/families/solana/api/cached.d.ts +5 -0
- package/lib/families/solana/api/cached.d.ts.map +1 -0
- package/lib/families/solana/api/cached.js +80 -0
- package/lib/families/solana/api/cached.js.map +1 -0
- package/lib/families/solana/api/chain/account/index.d.ts +2 -0
- package/lib/families/solana/api/chain/account/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/account/index.js +14 -0
- package/lib/families/solana/api/chain/account/index.js.map +1 -0
- package/lib/families/solana/api/chain/account/parser.d.ts +5 -0
- package/lib/families/solana/api/chain/account/parser.d.ts.map +1 -0
- package/lib/families/solana/api/chain/account/parser.js +33 -0
- package/lib/families/solana/api/chain/account/parser.js.map +1 -0
- package/lib/families/solana/api/chain/account/stake.d.ts +237 -0
- package/lib/families/solana/api/chain/account/stake.d.ts.map +1 -0
- package/lib/families/solana/api/chain/account/stake.js +43 -0
- package/lib/families/solana/api/chain/account/stake.js.map +1 -0
- package/lib/families/solana/api/chain/account/token.d.ts +116 -0
- package/lib/families/solana/api/chain/account/token.d.ts.map +1 -0
- package/lib/families/solana/api/chain/account/token.js +42 -0
- package/lib/families/solana/api/chain/account/token.js.map +1 -0
- package/lib/families/solana/api/chain/index.d.ts +22 -0
- package/lib/families/solana/api/chain/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/index.js +54 -0
- package/lib/families/solana/api/chain/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/index.d.ts +15 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/index.js +21 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts +30 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.js +19 -0
- package/lib/families/solana/api/chain/instruction/associated-token-account/types.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/memo/index.d.ts +15 -0
- package/lib/families/solana/api/chain/instruction/memo/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/memo/index.js +14 -0
- package/lib/families/solana/api/chain/instruction/memo/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/memo/types.d.ts +21 -0
- package/lib/families/solana/api/chain/instruction/memo/types.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/memo/types.js +16 -0
- package/lib/families/solana/api/chain/instruction/memo/types.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/stake/index.d.ts +15 -0
- package/lib/families/solana/api/chain/instruction/stake/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/stake/index.js +20 -0
- package/lib/families/solana/api/chain/instruction/stake/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/stake/types.d.ts +215 -0
- package/lib/families/solana/api/chain/instruction/stake/types.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/stake/types.js +80 -0
- package/lib/families/solana/api/chain/instruction/stake/types.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/token/index.d.ts +15 -0
- package/lib/families/solana/api/chain/instruction/token/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/token/index.js +20 -0
- package/lib/families/solana/api/chain/instruction/token/index.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/token/types.d.ts +497 -0
- package/lib/families/solana/api/chain/instruction/token/types.d.ts.map +1 -0
- package/lib/families/solana/api/chain/instruction/token/types.js +205 -0
- package/lib/families/solana/api/chain/instruction/token/types.js.map +1 -0
- package/lib/families/solana/api/chain/program/constants.d.ts +11 -0
- package/lib/families/solana/api/chain/program/constants.d.ts.map +1 -0
- package/lib/families/solana/api/chain/program/constants.js +14 -0
- package/lib/families/solana/api/chain/program/constants.js.map +1 -0
- package/lib/families/solana/api/chain/program/index.d.ts +2 -0
- package/lib/families/solana/api/chain/program/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/program/index.js +14 -0
- package/lib/families/solana/api/chain/program/index.js.map +1 -0
- package/lib/families/solana/api/chain/program/parser.d.ts +30 -0
- package/lib/families/solana/api/chain/program/parser.d.ts.map +1 -0
- package/lib/families/solana/api/chain/program/parser.js +70 -0
- package/lib/families/solana/api/chain/program/parser.js.map +1 -0
- package/lib/families/solana/api/chain/validators/bignum.d.ts +3 -0
- package/lib/families/solana/api/chain/validators/bignum.d.ts.map +1 -0
- package/lib/families/solana/api/chain/validators/bignum.js +11 -0
- package/lib/families/solana/api/chain/validators/bignum.js.map +1 -0
- package/lib/families/solana/api/chain/validators/index.d.ts +10 -0
- package/lib/families/solana/api/chain/validators/index.d.ts.map +1 -0
- package/lib/families/solana/api/chain/validators/index.js +10 -0
- package/lib/families/solana/api/chain/validators/index.js.map +1 -0
- package/lib/families/solana/api/chain/validators/pubkey.d.ts +3 -0
- package/lib/families/solana/api/chain/validators/pubkey.d.ts.map +1 -0
- package/lib/families/solana/api/chain/validators/pubkey.js +7 -0
- package/lib/families/solana/api/chain/validators/pubkey.js.map +1 -0
- package/lib/families/solana/api/chain/web3.d.ts +29 -0
- package/lib/families/solana/api/chain/web3.d.ts.map +1 -0
- package/lib/families/solana/api/chain/web3.js +287 -0
- package/lib/families/solana/api/chain/web3.js.map +1 -0
- package/lib/families/solana/api/index.d.ts +5 -0
- package/lib/families/solana/api/index.d.ts.map +1 -0
- package/lib/families/solana/api/index.js +21 -0
- package/lib/families/solana/api/index.js.map +1 -0
- package/lib/families/solana/api/logged.d.ts +3 -0
- package/lib/families/solana/api/logged.d.ts.map +1 -0
- package/lib/families/solana/api/logged.js +53 -0
- package/lib/families/solana/api/logged.js.map +1 -0
- package/lib/families/solana/api/queued.d.ts +3 -0
- package/lib/families/solana/api/queued.d.ts.map +1 -0
- package/lib/families/solana/api/queued.js +31 -0
- package/lib/families/solana/api/queued.js.map +1 -0
- package/lib/families/solana/bridge/bridge.d.ts +12 -0
- package/lib/families/solana/bridge/bridge.d.ts.map +1 -0
- package/lib/families/solana/bridge/bridge.js +218 -0
- package/lib/families/solana/bridge/bridge.js.map +1 -0
- package/lib/families/solana/bridge/js.d.ts +6 -0
- package/lib/families/solana/bridge/js.d.ts.map +1 -0
- package/lib/families/solana/bridge/js.js +15 -0
- package/lib/families/solana/bridge/js.js.map +1 -0
- package/lib/families/solana/bridge/mock-data.d.ts +186 -0
- package/lib/families/solana/bridge/mock-data.d.ts.map +1 -0
- package/lib/families/solana/bridge/mock-data.js +23 -0
- package/lib/families/solana/bridge/mock-data.js.map +1 -0
- package/lib/families/solana/bridge/mock.d.ts +6 -0
- package/lib/families/solana/bridge/mock.d.ts.map +1 -0
- package/lib/families/solana/bridge/mock.js +75 -0
- package/lib/families/solana/bridge/mock.js.map +1 -0
- package/lib/families/solana/cli-transaction.d.ts +14 -0
- package/lib/families/solana/cli-transaction.d.ts.map +1 -0
- package/lib/families/solana/cli-transaction.js +137 -0
- package/lib/families/solana/cli-transaction.js.map +1 -0
- package/lib/families/solana/datasets/solana.scanAccounts.1.d.ts +6 -0
- package/lib/families/solana/datasets/solana.scanAccounts.1.d.ts.map +1 -0
- package/lib/families/solana/datasets/solana.scanAccounts.1.js +7 -0
- package/lib/families/solana/datasets/solana.scanAccounts.1.js.map +1 -0
- package/lib/families/solana/deviceTransactionConfig.d.ts +10 -0
- package/lib/families/solana/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/families/solana/deviceTransactionConfig.js +121 -0
- package/lib/families/solana/deviceTransactionConfig.js.map +1 -0
- package/lib/families/solana/errors.d.ts +25 -0
- package/lib/families/solana/errors.d.ts.map +1 -0
- package/lib/families/solana/errors.js +13 -0
- package/lib/families/solana/errors.js.map +1 -0
- package/lib/families/solana/hw-getAddress.d.ts +4 -0
- package/lib/families/solana/hw-getAddress.d.ts.map +1 -0
- package/lib/families/solana/hw-getAddress.js +66 -0
- package/lib/families/solana/hw-getAddress.js.map +1 -0
- package/lib/families/solana/js-broadcast.d.ts +7 -0
- package/lib/families/solana/js-broadcast.d.ts.map +1 -0
- package/lib/families/solana/js-broadcast.js +59 -0
- package/lib/families/solana/js-broadcast.js.map +1 -0
- package/lib/families/solana/js-buildTransaction.d.ts +6 -0
- package/lib/families/solana/js-buildTransaction.d.ts.map +1 -0
- package/lib/families/solana/js-buildTransaction.js +123 -0
- package/lib/families/solana/js-buildTransaction.js.map +1 -0
- package/lib/families/solana/js-createTransaction.d.ts +6 -0
- package/lib/families/solana/js-createTransaction.d.ts.map +1 -0
- package/lib/families/solana/js-createTransaction.js +35 -0
- package/lib/families/solana/js-createTransaction.js.map +1 -0
- package/lib/families/solana/js-estimateMaxSpendable.d.ts +7 -0
- package/lib/families/solana/js-estimateMaxSpendable.d.ts.map +1 -0
- package/lib/families/solana/js-estimateMaxSpendable.js +72 -0
- package/lib/families/solana/js-estimateMaxSpendable.js.map +1 -0
- package/lib/families/solana/js-getTransactionStatus.d.ts +5 -0
- package/lib/families/solana/js-getTransactionStatus.d.ts.map +1 -0
- package/lib/families/solana/js-getTransactionStatus.js +106 -0
- package/lib/families/solana/js-getTransactionStatus.js.map +1 -0
- package/lib/families/solana/js-prepareTransaction.d.ts +6 -0
- package/lib/families/solana/js-prepareTransaction.d.ts.map +1 -0
- package/lib/families/solana/js-prepareTransaction.js +380 -0
- package/lib/families/solana/js-prepareTransaction.js.map +1 -0
- package/lib/families/solana/js-signOperation.d.ts +10 -0
- package/lib/families/solana/js-signOperation.d.ts.map +1 -0
- package/lib/families/solana/js-signOperation.js +193 -0
- package/lib/families/solana/js-signOperation.js.map +1 -0
- package/lib/families/solana/js-synchronization.d.ts +5 -0
- package/lib/families/solana/js-synchronization.d.ts.map +1 -0
- package/lib/families/solana/js-synchronization.js +464 -0
- package/lib/families/solana/js-synchronization.js.map +1 -0
- package/lib/families/solana/logic.d.ts +15 -0
- package/lib/families/solana/logic.d.ts.map +1 -0
- package/lib/families/solana/logic.js +49 -0
- package/lib/families/solana/logic.js.map +1 -0
- package/lib/families/solana/specs.d.ts +7 -0
- package/lib/families/solana/specs.d.ts.map +1 -0
- package/lib/families/solana/specs.js +100 -0
- package/lib/families/solana/specs.js.map +1 -0
- package/lib/families/solana/speculos-deviceActions.d.ts +8 -0
- package/lib/families/solana/speculos-deviceActions.d.ts.map +1 -0
- package/lib/families/solana/speculos-deviceActions.js +60 -0
- package/lib/families/solana/speculos-deviceActions.js.map +1 -0
- package/lib/families/solana/test-dataset.d.ts +5 -0
- package/lib/families/solana/test-dataset.d.ts.map +1 -0
- package/lib/families/solana/test-dataset.js +396 -0
- package/lib/families/solana/test-dataset.js.map +1 -0
- package/lib/families/solana/transaction.d.ts +12 -0
- package/lib/families/solana/transaction.d.ts.map +1 -0
- package/lib/families/solana/transaction.js +109 -0
- package/lib/families/solana/transaction.js.map +1 -0
- package/lib/families/solana/types.d.ts +84 -0
- package/lib/families/solana/types.d.ts.map +1 -0
- package/lib/families/solana/types.js +6 -0
- package/lib/families/solana/types.js.map +1 -0
- package/lib/families/solana/utils.d.ts +10 -0
- package/lib/families/solana/utils.d.ts.map +1 -0
- package/lib/families/solana/utils.js +194 -0
- package/lib/families/solana/utils.js.map +1 -0
- package/lib/families/stellar/js-synchronization.d.ts +2 -2
- package/lib/generated/bridge/js.d.ts +4 -0
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +8 -6
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/bridge/mock.d.ts +4 -0
- package/lib/generated/bridge/mock.d.ts.map +1 -1
- package/lib/generated/bridge/mock.js +6 -4
- package/lib/generated/bridge/mock.js.map +1 -1
- package/lib/generated/cli-transaction.d.ts +9 -0
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/generated/cli-transaction.js +8 -6
- package/lib/generated/cli-transaction.js.map +1 -1
- package/lib/generated/deviceTransactionConfig.d.ts +2 -0
- package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
- package/lib/generated/deviceTransactionConfig.js +8 -6
- package/lib/generated/deviceTransactionConfig.js.map +1 -1
- package/lib/generated/exchange.d.ts +1 -1
- package/lib/generated/hw-getAddress.d.ts +1 -0
- package/lib/generated/hw-getAddress.d.ts.map +1 -1
- package/lib/generated/hw-getAddress.js +8 -6
- package/lib/generated/hw-getAddress.js.map +1 -1
- package/lib/generated/specs.d.ts +4 -0
- package/lib/generated/specs.d.ts.map +1 -1
- package/lib/generated/specs.js +8 -6
- package/lib/generated/specs.js.map +1 -1
- package/lib/generated/speculos-deviceActions.d.ts +3 -0
- package/lib/generated/speculos-deviceActions.d.ts.map +1 -1
- package/lib/generated/speculos-deviceActions.js +8 -6
- package/lib/generated/speculos-deviceActions.js.map +1 -1
- package/lib/generated/test-dataset.d.ts +1 -0
- package/lib/generated/test-dataset.d.ts.map +1 -1
- package/lib/generated/test-dataset.js +8 -6
- package/lib/generated/test-dataset.js.map +1 -1
- package/lib/generated/transaction.d.ts +5 -0
- package/lib/generated/transaction.d.ts.map +1 -1
- package/lib/generated/transaction.js +8 -6
- package/lib/generated/transaction.js.map +1 -1
- package/lib/generated/types.d.ts +12 -6
- package/lib/generated/types.d.ts.map +1 -1
- package/lib/generated/types.js +5 -3
- package/lib/generated/types.js.map +1 -1
- package/lib/nft/helpers.js +1 -1
- package/lib/nft/helpers.js.map +1 -1
- package/package.json +8 -4
- package/src/__tests__/__snapshots__/all.libcore.ts.snap +113 -0
- package/src/__tests__/families/bitcoin/wallet-btc/utils.test.ts +4 -0
- package/src/__tests__/families/bitcoin/wallet-btc/xpub.syncing.integration.test.ts +12 -0
- package/src/__tests__/test-helpers/setup.ts +1 -0
- package/src/api/Ledger.ts +11 -1
- package/src/api/explorerConfig/index.ts +1 -3
- package/src/data/icons/react/cro.tsx +12 -0
- package/src/data/icons/react/index.tsx +2 -0
- package/src/data/icons/react/sol.tsx +12 -0
- package/src/data/icons/reactNative/cro.tsx +13 -0
- package/src/data/icons/reactNative/index.tsx +2 -0
- package/src/data/icons/reactNative/sol.tsx +13 -0
- package/src/data/icons/svg/CRO.svg +6 -0
- package/src/data/icons/svg/SOL.svg +3 -0
- package/src/derivation.ts +13 -0
- package/src/errors.ts +1 -0
- package/src/families/bitcoin/getAccountNetworkInfo.ts +5 -2
- package/src/families/bitcoin/js-signOperation.ts +4 -7
- package/src/families/bitcoin/specs.ts +16 -0
- package/src/families/bitcoin/wallet-btc/crypto/base.ts +1 -1
- package/src/families/bitcoin/wallet-btc/crypto/bitcoincash.ts +8 -1
- package/src/families/bitcoin/wallet-btc/crypto/decred.ts +251 -0
- package/src/families/bitcoin/wallet-btc/crypto/factory.ts +5 -0
- package/src/families/bitcoin/wallet-btc/crypto/index.ts +1 -0
- package/src/families/bitcoin/wallet-btc/crypto/litecoin.ts +13 -3
- package/src/families/bitcoin/wallet-btc/crypto/types.ts +1 -0
- package/src/families/bitcoin/wallet-btc/crypto/zec.ts +8 -1
- package/src/families/bitcoin/wallet-btc/crypto/zen.ts +8 -1
- package/src/families/bitcoin/wallet-btc/utils.ts +6 -1
- package/src/families/bitcoin/wallet-btc/wallet.ts +18 -5
- package/src/families/ethereum/synchronisation.ts +5 -2
- package/src/families/polkadot/api/sidecar.ts +2 -2
- package/src/families/solana/api/cached.ts +89 -0
- package/src/families/solana/api/chain/account/index.ts +1 -0
- package/src/families/solana/api/chain/account/parser.ts +35 -0
- package/src/families/solana/api/chain/account/stake.ts +50 -0
- package/src/families/solana/api/chain/account/token.ts +63 -0
- package/src/families/solana/api/chain/index.ts +115 -0
- package/src/families/solana/api/chain/instruction/associated-token-account/index.ts +37 -0
- package/src/families/solana/api/chain/instruction/associated-token-account/types.ts +23 -0
- package/src/families/solana/api/chain/instruction/memo/index.ts +24 -0
- package/src/families/solana/api/chain/instruction/memo/types.ts +18 -0
- package/src/families/solana/api/chain/instruction/stake/index.ts +29 -0
- package/src/families/solana/api/chain/instruction/stake/types.ts +95 -0
- package/src/families/solana/api/chain/instruction/token/index.ts +30 -0
- package/src/families/solana/api/chain/instruction/token/types.ts +237 -0
- package/src/families/solana/api/chain/program/constants.ts +10 -0
- package/src/families/solana/api/chain/program/index.ts +1 -0
- package/src/families/solana/api/chain/program/parser.ts +122 -0
- package/src/families/solana/api/chain/validators/bignum.ts +11 -0
- package/src/families/solana/api/chain/validators/index.ts +9 -0
- package/src/families/solana/api/chain/validators/pubkey.ts +8 -0
- package/src/families/solana/api/chain/web3.ts +258 -0
- package/src/families/solana/api/index.ts +4 -0
- package/src/families/solana/api/logged.ts +50 -0
- package/src/families/solana/api/queued.ts +23 -0
- package/src/families/solana/bridge/bridge.ts +169 -0
- package/src/families/solana/bridge/js.ts +28 -0
- package/src/families/solana/bridge/mock-data.ts +22 -0
- package/src/families/solana/bridge/mock.ts +80 -0
- package/src/families/solana/cli-transaction.ts +175 -0
- package/src/families/solana/datasets/solana.scanAccounts.1.ts +9 -0
- package/src/families/solana/deviceTransactionConfig.ts +160 -0
- package/src/families/solana/errors.ts +32 -0
- package/src/families/solana/hw-getAddress.ts +20 -0
- package/src/families/solana/js-broadcast.ts +20 -0
- package/src/families/solana/js-buildTransaction.ts +75 -0
- package/src/families/solana/js-createTransaction.ts +27 -0
- package/src/families/solana/js-estimateMaxSpendable.ts +29 -0
- package/src/families/solana/js-getTransactionStatus.ts +78 -0
- package/src/families/solana/js-prepareTransaction.ts +423 -0
- package/src/families/solana/js-signOperation.ts +230 -0
- package/src/families/solana/js-synchronization.ts +544 -0
- package/src/families/solana/logic.ts +52 -0
- package/src/families/solana/specs.ts +100 -0
- package/src/families/solana/speculos-deviceActions.ts +59 -0
- package/src/families/solana/test-dataset.ts +572 -0
- package/src/families/solana/transaction.ts +146 -0
- package/src/families/solana/types.ts +110 -0
- package/src/families/solana/utils.ts +80 -0
- package/src/generated/bridge/js.ts +3 -0
- package/src/generated/bridge/mock.ts +3 -0
- package/src/generated/cli-transaction.ts +3 -0
- package/src/generated/deviceTransactionConfig.ts +3 -0
- package/src/generated/hw-getAddress.ts +3 -0
- package/src/generated/specs.ts +3 -0
- package/src/generated/speculos-deviceActions.ts +3 -0
- package/src/generated/test-dataset.ts +3 -0
- package/src/generated/transaction.ts +3 -0
- package/src/generated/types.ts +14 -0
- package/src/nft/helpers.ts +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/// <reference types="@solana/web3.js" />
|
|
2
|
+
import { Infer } from "superstruct";
|
|
3
|
+
export declare type TokenAccountType = Infer<typeof TokenAccountType>;
|
|
4
|
+
export declare const TokenAccountType: import("superstruct").Struct<"account" | "mint" | "multisig", {
|
|
5
|
+
account: "account";
|
|
6
|
+
mint: "mint";
|
|
7
|
+
multisig: "multisig";
|
|
8
|
+
}>;
|
|
9
|
+
export declare type TokenAccountState = Infer<typeof AccountState>;
|
|
10
|
+
declare const AccountState: import("superstruct").Struct<"initialized" | "uninitialized" | "frozen", {
|
|
11
|
+
initialized: "initialized";
|
|
12
|
+
uninitialized: "uninitialized";
|
|
13
|
+
frozen: "frozen";
|
|
14
|
+
}>;
|
|
15
|
+
export declare type TokenAccountInfo = Infer<typeof TokenAccountInfo>;
|
|
16
|
+
export declare const TokenAccountInfo: import("superstruct").Struct<{
|
|
17
|
+
owner: import("@solana/web3.js").PublicKey;
|
|
18
|
+
state: "initialized" | "uninitialized" | "frozen";
|
|
19
|
+
mint: import("@solana/web3.js").PublicKey;
|
|
20
|
+
tokenAmount: {
|
|
21
|
+
amount: string;
|
|
22
|
+
decimals: number;
|
|
23
|
+
uiAmountString: string;
|
|
24
|
+
};
|
|
25
|
+
isNative: boolean;
|
|
26
|
+
delegate?: import("@solana/web3.js").PublicKey | undefined;
|
|
27
|
+
rentExemptReserve?: {
|
|
28
|
+
amount: string;
|
|
29
|
+
decimals: number;
|
|
30
|
+
uiAmountString: string;
|
|
31
|
+
} | 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<"initialized" | "uninitialized" | "frozen", {
|
|
52
|
+
initialized: "initialized";
|
|
53
|
+
uninitialized: "uninitialized";
|
|
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 declare 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 declare 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 declare type TokenAccount = Infer<typeof TokenAccount>;
|
|
104
|
+
export declare const TokenAccount: import("superstruct").Struct<{
|
|
105
|
+
type: "account" | "mint" | "multisig";
|
|
106
|
+
info?: any;
|
|
107
|
+
}, {
|
|
108
|
+
type: import("superstruct").Struct<"account" | "mint" | "multisig", {
|
|
109
|
+
account: "account";
|
|
110
|
+
mint: "mint";
|
|
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/families/solana/api/chain/account/token.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,KAAK,EAUN,MAAM,aAAa,CAAC;AAGrB,oBAAY,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;EAAyC,CAAC;AAEvE,oBAAY,iBAAiB,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3D,QAAA,MAAM,YAAY;;;;EAAoD,CAAC;AAQvE,oBAAY,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,oBAAY,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;EAM1B,CAAC;AAEH,oBAAY,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,mBAAmB;;;;;;;;;;EAK9B,CAAC;AAEH,oBAAY,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;EAGvB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.TokenAccount = exports.MultisigAccountInfo = exports.MintAccountInfo = exports.TokenAccountInfo = exports.TokenAccountType = void 0;
|
|
5
|
+
var superstruct_1 = require("superstruct");
|
|
6
|
+
var pubkey_1 = require("../validators/pubkey");
|
|
7
|
+
exports.TokenAccountType = (0, superstruct_1.enums)(["mint", "account", "multisig"]);
|
|
8
|
+
var AccountState = (0, superstruct_1.enums)(["initialized", "uninitialized", "frozen"]);
|
|
9
|
+
var TokenAmount = (0, superstruct_1.type)({
|
|
10
|
+
decimals: (0, superstruct_1.number)(),
|
|
11
|
+
uiAmountString: (0, superstruct_1.string)(),
|
|
12
|
+
amount: (0, superstruct_1.string)()
|
|
13
|
+
});
|
|
14
|
+
exports.TokenAccountInfo = (0, superstruct_1.type)({
|
|
15
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
16
|
+
owner: pubkey_1.PublicKeyFromString,
|
|
17
|
+
tokenAmount: TokenAmount,
|
|
18
|
+
delegate: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString),
|
|
19
|
+
state: AccountState,
|
|
20
|
+
isNative: (0, superstruct_1.boolean)(),
|
|
21
|
+
rentExemptReserve: (0, superstruct_1.optional)(TokenAmount),
|
|
22
|
+
delegatedAmount: (0, superstruct_1.optional)(TokenAmount),
|
|
23
|
+
closeAuthority: (0, superstruct_1.optional)(pubkey_1.PublicKeyFromString)
|
|
24
|
+
});
|
|
25
|
+
exports.MintAccountInfo = (0, superstruct_1.type)({
|
|
26
|
+
mintAuthority: (0, superstruct_1.nullable)(pubkey_1.PublicKeyFromString),
|
|
27
|
+
supply: (0, superstruct_1.string)(),
|
|
28
|
+
decimals: (0, superstruct_1.number)(),
|
|
29
|
+
isInitialized: (0, superstruct_1.boolean)(),
|
|
30
|
+
freezeAuthority: (0, superstruct_1.nullable)(pubkey_1.PublicKeyFromString)
|
|
31
|
+
});
|
|
32
|
+
exports.MultisigAccountInfo = (0, superstruct_1.type)({
|
|
33
|
+
numRequiredSigners: (0, superstruct_1.number)(),
|
|
34
|
+
numValidSigners: (0, superstruct_1.number)(),
|
|
35
|
+
isInitialized: (0, superstruct_1.boolean)(),
|
|
36
|
+
signers: (0, superstruct_1.array)(pubkey_1.PublicKeyFromString)
|
|
37
|
+
});
|
|
38
|
+
exports.TokenAccount = (0, superstruct_1.type)({
|
|
39
|
+
type: exports.TokenAccountType,
|
|
40
|
+
info: (0, superstruct_1.any)()
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../../src/families/solana/api/chain/account/token.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,2CAWqB;AACrB,+CAA2D;AAG9C,QAAA,gBAAgB,GAAG,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGvE,IAAM,YAAY,GAAG,IAAA,mBAAK,EAAC,CAAC,aAAa,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEvE,IAAM,WAAW,GAAG,IAAA,kBAAI,EAAC;IACvB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,cAAc,EAAE,IAAA,oBAAM,GAAE;IACxB,MAAM,EAAE,IAAA,oBAAM,GAAE;CACjB,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG,IAAA,kBAAI,EAAC;IACnC,IAAI,EAAE,4BAAmB;IACzB,KAAK,EAAE,4BAAmB;IAC1B,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;IACvC,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,IAAA,qBAAO,GAAE;IACnB,iBAAiB,EAAE,IAAA,sBAAQ,EAAC,WAAW,CAAC;IACxC,eAAe,EAAE,IAAA,sBAAQ,EAAC,WAAW,CAAC;IACtC,cAAc,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;CAC9C,CAAC,CAAC;AAGU,QAAA,eAAe,GAAG,IAAA,kBAAI,EAAC;IAClC,aAAa,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;IAC5C,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,QAAQ,EAAE,IAAA,oBAAM,GAAE;IAClB,aAAa,EAAE,IAAA,qBAAO,GAAE;IACxB,eAAe,EAAE,IAAA,sBAAQ,EAAC,4BAAmB,CAAC;CAC/C,CAAC,CAAC;AAGU,QAAA,mBAAmB,GAAG,IAAA,kBAAI,EAAC;IACtC,kBAAkB,EAAE,IAAA,oBAAM,GAAE;IAC5B,eAAe,EAAE,IAAA,oBAAM,GAAE;IACzB,aAAa,EAAE,IAAA,qBAAO,GAAE;IACxB,OAAO,EAAE,IAAA,mBAAK,EAAC,4BAAmB,CAAC;CACpC,CAAC,CAAC;AAGU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B,IAAI,EAAE,wBAAgB;IACtB,IAAI,EAAE,IAAA,iBAAG,GAAE;CACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Cluster, Connection, FeeCalculator, SignaturesForAddressOptions } from "@solana/web3.js";
|
|
3
|
+
import { Awaited } from "../../logic";
|
|
4
|
+
export declare type Config = {
|
|
5
|
+
readonly cluster: Cluster;
|
|
6
|
+
};
|
|
7
|
+
export declare type ChainAPI = Readonly<{
|
|
8
|
+
getBalance: (address: string) => Promise<number>;
|
|
9
|
+
getRecentBlockhash: () => Promise<string>;
|
|
10
|
+
getTxFeeCalculator: () => Promise<FeeCalculator>;
|
|
11
|
+
getBalanceAndContext: (address: string) => ReturnType<Connection["getBalanceAndContext"]>;
|
|
12
|
+
getParsedTokenAccountsByOwner: (address: string) => ReturnType<Connection["getParsedTokenAccountsByOwner"]>;
|
|
13
|
+
getSignaturesForAddress: (address: string, opts?: SignaturesForAddressOptions) => ReturnType<Connection["getSignaturesForAddress"]>;
|
|
14
|
+
getParsedConfirmedTransactions: (signatures: string[]) => ReturnType<Connection["getParsedConfirmedTransactions"]>;
|
|
15
|
+
getAccountInfo: (address: string) => Promise<Awaited<ReturnType<Connection["getParsedAccountInfo"]>>["value"]>;
|
|
16
|
+
sendRawTransaction: (buffer: Buffer) => ReturnType<Connection["sendRawTransaction"]>;
|
|
17
|
+
findAssocTokenAccAddress: (owner: string, mint: string) => Promise<string>;
|
|
18
|
+
getAssocTokenAccMinNativeBalance: () => Promise<number>;
|
|
19
|
+
config: Config;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function getChainAPI(config: Config): ChainAPI;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/families/solana/api/chain/index.ts"],"names":[],"mappings":";AAKA,OAAO,EACL,OAAO,EAEP,UAAU,EACV,aAAa,EAEb,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,oBAAY,MAAM,GAAG;IACnB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oBAAY,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,kBAAkB,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;IAEjD,oBAAoB,EAAE,CACpB,OAAO,EAAE,MAAM,KACZ,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAEpD,6BAA6B,EAAE,CAC7B,OAAO,EAAE,MAAM,KACZ,UAAU,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAE7D,uBAAuB,EAAE,CACvB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,2BAA2B,KAC/B,UAAU,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAEvD,8BAA8B,EAAE,CAC9B,UAAU,EAAE,MAAM,EAAE,KACjB,UAAU,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAE9D,cAAc,EAAE,CACd,OAAO,EAAE,MAAM,KACZ,OAAO,CACV,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CACjE,CAAC;IAEF,kBAAkB,EAAE,CAClB,MAAM,EAAE,MAAM,KACX,UAAU,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAElD,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3E,gCAAgC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAsDpD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getChainAPI = void 0;
|
|
4
|
+
var spl_token_1 = require("@solana/spl-token");
|
|
5
|
+
var web3_js_1 = require("@solana/web3.js");
|
|
6
|
+
function getChainAPI(config) {
|
|
7
|
+
var connection = function () {
|
|
8
|
+
return new web3_js_1.Connection((0, web3_js_1.clusterApiUrl)(config.cluster), "finalized");
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
getBalance: function (address) {
|
|
12
|
+
return connection().getBalance(new web3_js_1.PublicKey(address));
|
|
13
|
+
},
|
|
14
|
+
getRecentBlockhash: function () {
|
|
15
|
+
return connection()
|
|
16
|
+
.getRecentBlockhash()
|
|
17
|
+
.then(function (r) { return r.blockhash; });
|
|
18
|
+
},
|
|
19
|
+
getTxFeeCalculator: function () {
|
|
20
|
+
return connection()
|
|
21
|
+
.getRecentBlockhash()
|
|
22
|
+
.then(function (r) { return r.feeCalculator; });
|
|
23
|
+
},
|
|
24
|
+
getBalanceAndContext: function (address) {
|
|
25
|
+
return connection().getBalanceAndContext(new web3_js_1.PublicKey(address));
|
|
26
|
+
},
|
|
27
|
+
getParsedTokenAccountsByOwner: function (address) {
|
|
28
|
+
return connection().getParsedTokenAccountsByOwner(new web3_js_1.PublicKey(address), {
|
|
29
|
+
programId: spl_token_1.TOKEN_PROGRAM_ID
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
getSignaturesForAddress: function (address, opts) { return connection().getSignaturesForAddress(new web3_js_1.PublicKey(address), opts); },
|
|
33
|
+
getParsedConfirmedTransactions: function (signatures) {
|
|
34
|
+
return connection().getParsedConfirmedTransactions(signatures);
|
|
35
|
+
},
|
|
36
|
+
getAccountInfo: function (address) {
|
|
37
|
+
return connection()
|
|
38
|
+
.getParsedAccountInfo(new web3_js_1.PublicKey(address))
|
|
39
|
+
.then(function (r) { return r.value; });
|
|
40
|
+
},
|
|
41
|
+
sendRawTransaction: function (buffer) {
|
|
42
|
+
return connection().sendRawTransaction(buffer);
|
|
43
|
+
},
|
|
44
|
+
findAssocTokenAccAddress: function (owner, mint) {
|
|
45
|
+
return spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, new web3_js_1.PublicKey(mint), new web3_js_1.PublicKey(owner)).then(function (r) { return r.toBase58(); });
|
|
46
|
+
},
|
|
47
|
+
getAssocTokenAccMinNativeBalance: function () {
|
|
48
|
+
return spl_token_1.Token.getMinBalanceRentForExemptAccount(connection());
|
|
49
|
+
},
|
|
50
|
+
config: config
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.getChainAPI = getChainAPI;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/families/solana/api/chain/index.ts"],"names":[],"mappings":";;;AAAA,+CAI2B;AAC3B,2CAOyB;AAgDzB,SAAgB,WAAW,CAAC,MAAc;IACxC,IAAM,UAAU,GAAG;QACjB,OAAA,IAAI,oBAAU,CAAC,IAAA,uBAAa,EAAC,MAAM,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAA1D,CAA0D,CAAC;IAE7D,OAAO;QACL,UAAU,EAAE,UAAC,OAAe;YAC1B,OAAA,UAAU,EAAE,CAAC,UAAU,CAAC,IAAI,mBAAS,CAAC,OAAO,CAAC,CAAC;QAA/C,CAA+C;QAEjD,kBAAkB,EAAE;YAClB,OAAA,UAAU,EAAE;iBACT,kBAAkB,EAAE;iBACpB,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,SAAS,EAAX,CAAW,CAAC;QAF3B,CAE2B;QAE7B,kBAAkB,EAAE;YAClB,OAAA,UAAU,EAAE;iBACT,kBAAkB,EAAE;iBACpB,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,aAAa,EAAf,CAAe,CAAC;QAF/B,CAE+B;QAEjC,oBAAoB,EAAE,UAAC,OAAe;YACpC,OAAA,UAAU,EAAE,CAAC,oBAAoB,CAAC,IAAI,mBAAS,CAAC,OAAO,CAAC,CAAC;QAAzD,CAAyD;QAE3D,6BAA6B,EAAE,UAAC,OAAe;YAC7C,OAAA,UAAU,EAAE,CAAC,6BAA6B,CAAC,IAAI,mBAAS,CAAC,OAAO,CAAC,EAAE;gBACjE,SAAS,EAAE,4BAAgB;aAC5B,CAAC;QAFF,CAEE;QACJ,uBAAuB,EAAE,UACvB,OAAe,EACf,IAAkC,IAC/B,OAAA,UAAU,EAAE,CAAC,uBAAuB,CAAC,IAAI,mBAAS,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAlE,CAAkE;QAEvE,8BAA8B,EAAE,UAAC,UAAoB;YACnD,OAAA,UAAU,EAAE,CAAC,8BAA8B,CAAC,UAAU,CAAC;QAAvD,CAAuD;QAEzD,cAAc,EAAE,UAAC,OAAe;YAC9B,OAAA,UAAU,EAAE;iBACT,oBAAoB,CAAC,IAAI,mBAAS,CAAC,OAAO,CAAC,CAAC;iBAC5C,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,KAAK,EAAP,CAAO,CAAC;QAFvB,CAEuB;QAEzB,kBAAkB,EAAE,UAAC,MAAc;YACjC,OAAA,UAAU,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;QAAvC,CAAuC;QAEzC,wBAAwB,EAAE,UAAC,KAAa,EAAE,IAAY;YACpD,OAAA,iBAAK,CAAC,yBAAyB,CAC7B,uCAA2B,EAC3B,4BAAgB,EAChB,IAAI,mBAAS,CAAC,IAAI,CAAC,EACnB,IAAI,mBAAS,CAAC,KAAK,CAAC,CACrB,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,EAAE,EAAZ,CAAY,CAAC;QAL3B,CAK2B;QAE7B,gCAAgC,EAAE;YAChC,OAAA,iBAAK,CAAC,iCAAiC,CAAC,UAAU,EAAE,CAAC;QAArD,CAAqD;QAEvD,MAAM,QAAA;KACP,CAAC;AACJ,CAAC;AAtDD,kCAsDC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Infer } from "superstruct";
|
|
2
|
+
import { ParsedInstruction } from "@solana/web3.js";
|
|
3
|
+
import { AssociatedTokenAccountInstructionType, IX_STRUCTS, IX_TITLES } from "./types";
|
|
4
|
+
import { PARSED_PROGRAMS } from "../../program/constants";
|
|
5
|
+
export declare function parseAssociatedTokenAccountInstruction(ix: ParsedInstruction & {
|
|
6
|
+
program: typeof PARSED_PROGRAMS.SPL_ASSOCIATED_TOKEN_ACCOUNT;
|
|
7
|
+
}): AssociatedTokenAccountInstructionDescriptor;
|
|
8
|
+
export declare type AssociatedTokenAccountInstructionDescriptor = {
|
|
9
|
+
[K in AssociatedTokenAccountInstructionType]: {
|
|
10
|
+
title: typeof IX_TITLES[K];
|
|
11
|
+
type: K;
|
|
12
|
+
info: Infer<typeof IX_STRUCTS[K]>;
|
|
13
|
+
};
|
|
14
|
+
}[AssociatedTokenAccountInstructionType];
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/associated-token-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,qCAAqC,EACrC,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,sCAAsC,CACpD,EAAE,EAAE,iBAAiB,GAAG;IACtB,OAAO,EAAE,OAAO,eAAe,CAAC,4BAA4B,CAAC;CAC9D,GACA,2CAA2C,CAa7C;AAED,oBAAY,2CAA2C,GAAG;KACvD,CAAC,IAAI,qCAAqC,GAAG;QAC5C,KAAK,EAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;CACF,CAAC,qCAAqC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.parseAssociatedTokenAccountInstruction = void 0;
|
|
4
|
+
var validators_1 = require("../../validators");
|
|
5
|
+
var superstruct_1 = require("superstruct");
|
|
6
|
+
var types_1 = require("./types");
|
|
7
|
+
function parseAssociatedTokenAccountInstruction(ix) {
|
|
8
|
+
// TODO: check this
|
|
9
|
+
var parsed = (0, superstruct_1.create)(ix.parsed, validators_1.ParsedInfo);
|
|
10
|
+
//const { type: rawType, info } = parsed;
|
|
11
|
+
var type = "associate";
|
|
12
|
+
var title = types_1.IX_TITLES[type];
|
|
13
|
+
var struct = types_1.IX_STRUCTS[type];
|
|
14
|
+
return {
|
|
15
|
+
type: "associate",
|
|
16
|
+
title: title,
|
|
17
|
+
info: (0, superstruct_1.create)(parsed.info, struct)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.parseAssociatedTokenAccountInstruction = parseAssociatedTokenAccountInstruction;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/associated-token-account/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAC9C,2CAA4C;AAE5C,iCAIiB;AAIjB,SAAgB,sCAAsC,CACpD,EAEC;IAED,mBAAmB;IACnB,IAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,EAAE,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;IAC7C,yCAAyC;IACzC,IAAM,IAAI,GAA0C,WAAW,CAAC;IAChE,IAAM,KAAK,GAAG,iBAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAM,MAAM,GAAG,kBAAU,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAA,oBAAM,EAAC,MAAM,CAAC,IAAI,EAAE,MAAa,CAAQ;KAChD,CAAC;AACJ,CAAC;AAjBD,wFAiBC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="@solana/web3.js" />
|
|
2
|
+
import { Infer } from "superstruct";
|
|
3
|
+
export declare const AssociateInfo: import("superstruct").Struct<{
|
|
4
|
+
account: import("@solana/web3.js").PublicKey;
|
|
5
|
+
mint: import("@solana/web3.js").PublicKey;
|
|
6
|
+
wallet: import("@solana/web3.js").PublicKey;
|
|
7
|
+
}, {
|
|
8
|
+
account: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
9
|
+
mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
10
|
+
wallet: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare type AssociatedTokenAccountInstructionType = Infer<typeof AssociatedTokenAccountInstructionType>;
|
|
13
|
+
export declare const AssociatedTokenAccountInstructionType: import("superstruct").Struct<"associate", {
|
|
14
|
+
associate: "associate";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const IX_STRUCTS: {
|
|
17
|
+
readonly associate: import("superstruct").Struct<{
|
|
18
|
+
account: import("@solana/web3.js").PublicKey;
|
|
19
|
+
mint: import("@solana/web3.js").PublicKey;
|
|
20
|
+
wallet: import("@solana/web3.js").PublicKey;
|
|
21
|
+
}, {
|
|
22
|
+
account: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
23
|
+
mint: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
24
|
+
wallet: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
export declare const IX_TITLES: {
|
|
28
|
+
readonly associate: "Associate";
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/associated-token-account/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,KAAK,EAAE,MAAM,aAAa,CAAC;AAIjD,eAAO,MAAM,aAAa;;;;;;;;EAIxB,CAAC;AAEH,oBAAY,qCAAqC,GAAG,KAAK,CACvD,OAAO,qCAAqC,CAC7C,CAAC;AAEF,eAAO,MAAM,qCAAqC;;EAAuB,CAAC;AAE1E,eAAO,MAAM,UAAU;;;;;;;;;;CAEb,CAAC;AAEX,eAAO,MAAM,SAAS;;CAEZ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.IX_TITLES = exports.IX_STRUCTS = exports.AssociatedTokenAccountInstructionType = exports.AssociateInfo = void 0;
|
|
4
|
+
var superstruct_1 = require("superstruct");
|
|
5
|
+
var pubkey_1 = require("../../validators/pubkey");
|
|
6
|
+
exports.AssociateInfo = (0, superstruct_1.type)({
|
|
7
|
+
account: pubkey_1.PublicKeyFromString,
|
|
8
|
+
mint: pubkey_1.PublicKeyFromString,
|
|
9
|
+
wallet: pubkey_1.PublicKeyFromString
|
|
10
|
+
});
|
|
11
|
+
// not a real instruction type, added for structure
|
|
12
|
+
exports.AssociatedTokenAccountInstructionType = (0, superstruct_1.enums)(["associate"]);
|
|
13
|
+
exports.IX_STRUCTS = {
|
|
14
|
+
associate: exports.AssociateInfo
|
|
15
|
+
};
|
|
16
|
+
exports.IX_TITLES = {
|
|
17
|
+
associate: "Associate"
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/associated-token-account/types.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AACjD,kDAA8D;AAGjD,QAAA,aAAa,GAAG,IAAA,kBAAI,EAAC;IAChC,OAAO,EAAE,4BAAmB;IAC5B,IAAI,EAAE,4BAAmB;IACzB,MAAM,EAAE,4BAAmB;CAC5B,CAAC,CAAC;AAKH,mDAAmD;AACtC,QAAA,qCAAqC,GAAG,IAAA,mBAAK,EAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAE7D,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE,qBAAa;CAChB,CAAC;AAEE,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,WAAW;CACd,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ParsedInstruction } from "@solana/web3.js";
|
|
2
|
+
import { IX_STRUCTS, IX_TITLES, MemoInstructionType } from "./types";
|
|
3
|
+
import { Infer } from "superstruct";
|
|
4
|
+
import { PARSED_PROGRAMS } from "../../program/constants";
|
|
5
|
+
export declare function parseSplMemoInstruction(ix: ParsedInstruction & {
|
|
6
|
+
program: typeof PARSED_PROGRAMS.SPL_MEMO;
|
|
7
|
+
}): MemoInstructionDescriptor;
|
|
8
|
+
export declare type MemoInstructionDescriptor = {
|
|
9
|
+
[K in MemoInstructionType]: {
|
|
10
|
+
title: typeof IX_TITLES[K];
|
|
11
|
+
type: K;
|
|
12
|
+
info: Infer<typeof IX_STRUCTS[K]>;
|
|
13
|
+
};
|
|
14
|
+
}[MemoInstructionType];
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/memo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,iBAAiB,GAAG;IAAE,OAAO,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAA;CAAE,GACnE,yBAAyB,CAQ3B;AAED,oBAAY,yBAAyB,GAAG;KACrC,CAAC,IAAI,mBAAmB,GAAG;QAC1B,KAAK,EAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;CACF,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.parseSplMemoInstruction = void 0;
|
|
4
|
+
function parseSplMemoInstruction(ix) {
|
|
5
|
+
return {
|
|
6
|
+
title: "Save",
|
|
7
|
+
type: "save",
|
|
8
|
+
info: {
|
|
9
|
+
data: ix.parsed
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.parseSplMemoInstruction = parseSplMemoInstruction;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/memo/index.ts"],"names":[],"mappings":";;;AAKA,SAAgB,uBAAuB,CACrC,EAAoE;IAEpE,OAAO;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE;YACJ,IAAI,EAAE,EAAE,CAAC,MAAM;SAChB;KACF,CAAC;AACJ,CAAC;AAVD,0DAUC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Infer } from "superstruct";
|
|
2
|
+
export declare const SaveInfo: import("superstruct").Struct<{
|
|
3
|
+
data: string;
|
|
4
|
+
}, {
|
|
5
|
+
data: import("superstruct").Struct<string, null>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare type MemoInstructionType = Infer<typeof MemoInstructionType>;
|
|
8
|
+
export declare const MemoInstructionType: import("superstruct").Struct<"save", {
|
|
9
|
+
save: "save";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const IX_STRUCTS: {
|
|
12
|
+
readonly save: import("superstruct").Struct<{
|
|
13
|
+
data: string;
|
|
14
|
+
}, {
|
|
15
|
+
data: import("superstruct").Struct<string, null>;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
export declare const IX_TITLES: {
|
|
19
|
+
readonly save: "Save";
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/memo/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzD,eAAO,MAAM,QAAQ;;;;EAEnB,CAAC;AAEH,oBAAY,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;EAAkB,CAAC;AAEnD,eAAO,MAAM,UAAU;;;;;;CAEb,CAAC;AAEX,eAAO,MAAM,SAAS;;CAEZ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.IX_TITLES = exports.IX_STRUCTS = exports.MemoInstructionType = exports.SaveInfo = void 0;
|
|
4
|
+
var superstruct_1 = require("superstruct");
|
|
5
|
+
exports.SaveInfo = (0, superstruct_1.type)({
|
|
6
|
+
data: (0, superstruct_1.string)()
|
|
7
|
+
});
|
|
8
|
+
// not a real instruction type, added for structure
|
|
9
|
+
exports.MemoInstructionType = (0, superstruct_1.enums)(["save"]);
|
|
10
|
+
exports.IX_STRUCTS = {
|
|
11
|
+
save: exports.SaveInfo
|
|
12
|
+
};
|
|
13
|
+
exports.IX_TITLES = {
|
|
14
|
+
save: "Save"
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/memo/types.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAG5C,QAAA,QAAQ,GAAG,IAAA,kBAAI,EAAC;IAC3B,IAAI,EAAE,IAAA,oBAAM,GAAE;CACf,CAAC,CAAC;AAGH,mDAAmD;AACtC,QAAA,mBAAmB,GAAG,IAAA,mBAAK,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEtC,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,gBAAQ;CACN,CAAC;AAEE,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;CACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Infer } from "superstruct";
|
|
2
|
+
import { ParsedInstruction } from "@solana/web3.js";
|
|
3
|
+
import { StakeInstructionType, IX_STRUCTS, IX_TITLES } from "./types";
|
|
4
|
+
import { PARSED_PROGRAMS } from "../../program/constants";
|
|
5
|
+
export declare function parseStakeInstruction(ix: ParsedInstruction & {
|
|
6
|
+
program: typeof PARSED_PROGRAMS.STAKE;
|
|
7
|
+
}): StakeInstructionDescriptor;
|
|
8
|
+
export declare type StakeInstructionDescriptor = {
|
|
9
|
+
[K in StakeInstructionType]: {
|
|
10
|
+
title: typeof IX_TITLES[K];
|
|
11
|
+
type: K;
|
|
12
|
+
info: Infer<typeof IX_STRUCTS[K]>;
|
|
13
|
+
};
|
|
14
|
+
}[StakeInstructionType];
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/stake/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,iBAAiB,GAAG;IAAE,OAAO,EAAE,OAAO,eAAe,CAAC,KAAK,CAAA;CAAE,GAChE,0BAA0B,CAY5B;AAED,oBAAY,0BAA0B,GAAG;KACtC,CAAC,IAAI,oBAAoB,GAAG;QAC3B,KAAK,EAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,EAAE,CAAC,CAAC;QACR,IAAI,EAAE,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;CACF,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.parseStakeInstruction = void 0;
|
|
4
|
+
var validators_1 = require("../../validators");
|
|
5
|
+
var superstruct_1 = require("superstruct");
|
|
6
|
+
var types_1 = require("./types");
|
|
7
|
+
function parseStakeInstruction(ix) {
|
|
8
|
+
var parsed = (0, superstruct_1.create)(ix.parsed, validators_1.ParsedInfo);
|
|
9
|
+
var rawType = parsed.type, info = parsed.info;
|
|
10
|
+
var type = (0, superstruct_1.create)(rawType, types_1.StakeInstructionType);
|
|
11
|
+
var title = types_1.IX_TITLES[type];
|
|
12
|
+
var struct = types_1.IX_STRUCTS[type];
|
|
13
|
+
return {
|
|
14
|
+
type: type,
|
|
15
|
+
title: title,
|
|
16
|
+
info: (0, superstruct_1.create)(info, struct)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.parseStakeInstruction = parseStakeInstruction;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/families/solana/api/chain/instruction/stake/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAC9C,2CAA4C;AAE5C,iCAAsE;AAGtE,SAAgB,qBAAqB,CACnC,EAAiE;IAEjE,IAAM,MAAM,GAAG,IAAA,oBAAM,EAAC,EAAE,CAAC,MAAM,EAAE,uBAAU,CAAC,CAAC;IACrC,IAAM,OAAO,GAAW,MAAM,KAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAY;IACvC,IAAM,IAAI,GAAG,IAAA,oBAAM,EAAC,OAAO,EAAE,4BAAoB,CAAC,CAAC;IACnD,IAAM,KAAK,GAAG,iBAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAM,MAAM,GAAG,kBAAU,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO;QACL,IAAI,MAAA;QACJ,KAAK,EAAE,KAAY;QACnB,IAAI,EAAE,IAAA,oBAAM,EAAC,IAAI,EAAE,MAAa,CAAQ;KACzC,CAAC;AACJ,CAAC;AAdD,sDAcC"}
|