@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,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
exports.__esModule = true;
|
|
64
|
+
exports.buildTransactionWithAPI = void 0;
|
|
65
|
+
var web3_1 = require("./api/chain/web3");
|
|
66
|
+
var utils_1 = require("./utils");
|
|
67
|
+
var web3_js_1 = require("@solana/web3.js");
|
|
68
|
+
var buildTransactionWithAPI = function (account, transaction, api) { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
+
var instructions, recentBlockhash, feePayer, tx;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
instructions = buildInstructions(transaction);
|
|
74
|
+
return [4 /*yield*/, api.getRecentBlockhash()];
|
|
75
|
+
case 1:
|
|
76
|
+
recentBlockhash = _a.sent();
|
|
77
|
+
feePayer = new web3_js_1.PublicKey(account.freshAddress);
|
|
78
|
+
tx = new web3_js_1.Transaction({
|
|
79
|
+
feePayer: feePayer,
|
|
80
|
+
recentBlockhash: recentBlockhash
|
|
81
|
+
});
|
|
82
|
+
tx.add.apply(tx, __spreadArray([], __read(instructions), false));
|
|
83
|
+
return [2 /*return*/, [
|
|
84
|
+
tx.compileMessage().serialize(),
|
|
85
|
+
function (signature) {
|
|
86
|
+
return (0, web3_1.addSignatureToTransaction)({
|
|
87
|
+
tx: tx,
|
|
88
|
+
address: account.freshAddress,
|
|
89
|
+
signature: signature
|
|
90
|
+
}).serialize();
|
|
91
|
+
},
|
|
92
|
+
]];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}); };
|
|
96
|
+
exports.buildTransactionWithAPI = buildTransactionWithAPI;
|
|
97
|
+
function buildInstructions(tx) {
|
|
98
|
+
var commandDescriptor = tx.model.commandDescriptor;
|
|
99
|
+
if (commandDescriptor === undefined) {
|
|
100
|
+
throw new Error("missing command descriptor");
|
|
101
|
+
}
|
|
102
|
+
switch (commandDescriptor.status) {
|
|
103
|
+
case "valid":
|
|
104
|
+
return buildInstructionsForCommand(commandDescriptor.command);
|
|
105
|
+
case "invalid":
|
|
106
|
+
throw new Error("can not build invalid command");
|
|
107
|
+
default:
|
|
108
|
+
return (0, utils_1.assertUnreachable)(commandDescriptor);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function buildInstructionsForCommand(command) {
|
|
112
|
+
switch (command.kind) {
|
|
113
|
+
case "transfer":
|
|
114
|
+
return (0, web3_1.buildTransferInstructions)(command);
|
|
115
|
+
case "token.transfer":
|
|
116
|
+
return (0, web3_1.buildTokenTransferInstructions)(command);
|
|
117
|
+
case "token.createATA":
|
|
118
|
+
return (0, web3_1.buildCreateAssociatedTokenAccountInstruction)(command);
|
|
119
|
+
default:
|
|
120
|
+
return (0, utils_1.assertUnreachable)(command);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=js-buildTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-buildTransaction.js","sourceRoot":"","sources":["../../../src/families/solana/js-buildTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAK0B;AAC1B,iCAA4C;AAC5C,2CAIyB;AAGlB,IAAM,uBAAuB,GAAG,UACrC,OAAgB,EAChB,WAAwB,EACxB,GAAa;;;;;gBAEP,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAE5B,qBAAM,GAAG,CAAC,kBAAkB,EAAE,EAAA;;gBAAhD,eAAe,GAAG,SAA8B;gBAEhD,QAAQ,GAAG,IAAI,mBAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;gBAE/C,EAAE,GAAG,IAAI,qBAAkB,CAAC;oBAChC,QAAQ,UAAA;oBACR,eAAe,iBAAA;iBAChB,CAAC,CAAC;gBAEH,EAAE,CAAC,GAAG,OAAN,EAAE,2BAAQ,YAAY,WAAE;gBAExB,sBAAO;wBACL,EAAE,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE;wBAC/B,UAAC,SAAiB;4BAChB,OAAO,IAAA,gCAAyB,EAAC;gCAC/B,EAAE,IAAA;gCACF,OAAO,EAAE,OAAO,CAAC,YAAY;gCAC7B,SAAS,WAAA;6BACV,CAAC,CAAC,SAAS,EAAE,CAAC;wBACjB,CAAC;qBACO,EAAC;;;KACZ,CAAC;AA5BW,QAAA,uBAAuB,2BA4BlC;AAEF,SAAS,iBAAiB,CAAC,EAAe;IAChC,IAAA,iBAAiB,GAAK,EAAE,CAAC,KAAK,kBAAb,CAAc;IACvC,IAAI,iBAAiB,KAAK,SAAS,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAC/C;IACD,QAAQ,iBAAiB,CAAC,MAAM,EAAE;QAChC,KAAK,OAAO;YACV,OAAO,2BAA2B,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChE,KAAK,SAAS;YACZ,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD;YACE,OAAO,IAAA,yBAAiB,EAAC,iBAAiB,CAAC,CAAC;KAC/C;AACH,CAAC;AAED,SAAS,2BAA2B,CAClC,OAAgB;IAEhB,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,UAAU;YACb,OAAO,IAAA,gCAAyB,EAAC,OAAO,CAAC,CAAC;QAC5C,KAAK,gBAAgB;YACnB,OAAO,IAAA,qCAA8B,EAAC,OAAO,CAAC,CAAC;QACjD,KAAK,iBAAiB;YACpB,OAAO,IAAA,mDAA4C,EAAC,OAAO,CAAC,CAAC;QAC/D;YACE,OAAO,IAAA,yBAAiB,EAAC,OAAO,CAAC,CAAC;KACrC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Transaction } from "./types";
|
|
2
|
+
import { Account } from "../../types";
|
|
3
|
+
declare const createTransaction: (_: Account) => Transaction;
|
|
4
|
+
export declare const updateTransaction: (t: Transaction, patch: Partial<Transaction>) => Transaction;
|
|
5
|
+
export default createTransaction;
|
|
6
|
+
//# sourceMappingURL=js-createTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-createTransaction.d.ts","sourceRoot":"","sources":["../../../src/families/solana/js-createTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,QAAA,MAAM,iBAAiB,MAAO,OAAO,KAAG,WAavC,CAAC;AAEF,eAAO,MAAM,iBAAiB,MACzB,WAAW,SACP,QAAQ,WAAW,CAAC,KAC1B,WAEF,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
exports.__esModule = true;
|
|
14
|
+
exports.updateTransaction = void 0;
|
|
15
|
+
var bignumber_js_1 = require("bignumber.js");
|
|
16
|
+
var createTransaction = function (_) {
|
|
17
|
+
return {
|
|
18
|
+
family: "solana",
|
|
19
|
+
amount: new bignumber_js_1.BigNumber(0),
|
|
20
|
+
useAllAmount: false,
|
|
21
|
+
recipient: "",
|
|
22
|
+
model: {
|
|
23
|
+
kind: "transfer",
|
|
24
|
+
uiState: {
|
|
25
|
+
memo: undefined
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var updateTransaction = function (t, patch) {
|
|
31
|
+
return __assign(__assign({}, t), patch);
|
|
32
|
+
};
|
|
33
|
+
exports.updateTransaction = updateTransaction;
|
|
34
|
+
exports["default"] = createTransaction;
|
|
35
|
+
//# sourceMappingURL=js-createTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-createTransaction.js","sourceRoot":"","sources":["../../../src/families/solana/js-createTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAAyC;AAIzC,IAAM,iBAAiB,GAAG,UAAC,CAAU;IACnC,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI,wBAAS,CAAC,CAAC,CAAC;QACxB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;aAChB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,iBAAiB,GAAG,UAC/B,CAAc,EACd,KAA2B;IAE3B,6BAAY,CAAC,GAAK,KAAK,EAAG;AAC5B,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B;AAEF,qBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AccountBridge } from "../../types";
|
|
2
|
+
import type { Transaction } from "./types";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
import { ChainAPI } from "./api";
|
|
5
|
+
declare const estimateMaxSpendableWithAPI: ({ account, transaction, }: Parameters<AccountBridge<Transaction>["estimateMaxSpendable"]>[0], api: ChainAPI) => Promise<BigNumber>;
|
|
6
|
+
export default estimateMaxSpendableWithAPI;
|
|
7
|
+
//# sourceMappingURL=js-estimateMaxSpendable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-estimateMaxSpendable.d.ts","sourceRoot":"","sources":["../../../src/families/solana/js-estimateMaxSpendable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,QAAA,MAAM,2BAA2B,8BAI5B,WAAW,cAAc,WAAW,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,OAC/D,QAAQ,KACZ,QAAQ,SAAS,CAenB,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
exports.__esModule = true;
|
|
42
|
+
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
43
|
+
var estimateMaxSpendableWithAPI = function (_a, api) {
|
|
44
|
+
var account = _a.account, transaction = _a.transaction;
|
|
45
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
+
var feeCalculator, _b;
|
|
47
|
+
var _c;
|
|
48
|
+
return __generator(this, function (_d) {
|
|
49
|
+
switch (_d.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
if (!((_c = transaction === null || transaction === void 0 ? void 0 : transaction.feeCalculator) !== null && _c !== void 0)) return [3 /*break*/, 1];
|
|
52
|
+
_b = _c;
|
|
53
|
+
return [3 /*break*/, 3];
|
|
54
|
+
case 1: return [4 /*yield*/, api.getTxFeeCalculator()];
|
|
55
|
+
case 2:
|
|
56
|
+
_b = (_d.sent());
|
|
57
|
+
_d.label = 3;
|
|
58
|
+
case 3:
|
|
59
|
+
feeCalculator = _b;
|
|
60
|
+
switch (account.type) {
|
|
61
|
+
case "Account":
|
|
62
|
+
return [2 /*return*/, bignumber_js_1["default"].max(account.balance.minus(feeCalculator.lamportsPerSignature), 0)];
|
|
63
|
+
case "TokenAccount":
|
|
64
|
+
return [2 /*return*/, account.balance];
|
|
65
|
+
}
|
|
66
|
+
throw new Error("not supported account type");
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
exports["default"] = estimateMaxSpendableWithAPI;
|
|
72
|
+
//# sourceMappingURL=js-estimateMaxSpendable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-estimateMaxSpendable.js","sourceRoot":"","sources":["../../../src/families/solana/js-estimateMaxSpendable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8DAAqC;AAGrC,IAAM,2BAA2B,GAAG,UAClC,EAGoE,EACpE,GAAa;QAHX,OAAO,aAAA,EACP,WAAW,iBAAA;;;;;;;gCAKX,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,aAAa;;;wBAAK,qBAAM,GAAG,CAAC,kBAAkB,EAAE,EAAA;;oBAA/B,KAAA,CAAC,SAA8B,CAAC,CAAA;;;oBAD1D,aAAa,KAC6C;oBAEhE,QAAQ,OAAO,CAAC,IAAI,EAAE;wBACpB,KAAK,SAAS;4BACZ,sBAAO,yBAAS,CAAC,GAAG,CAClB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,EACzD,CAAC,CACF,EAAC;wBACJ,KAAK,cAAc;4BACjB,sBAAO,OAAO,CAAC,OAAO,EAAC;qBAC1B;oBAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;;;;CAC/C,CAAC;AAEF,qBAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Account, TransactionStatus } from "../../types";
|
|
2
|
+
import type { Transaction } from "./types";
|
|
3
|
+
declare const getTransactionStatus: (_: Account, tx: Transaction) => Promise<TransactionStatus>;
|
|
4
|
+
export default getTransactionStatus;
|
|
5
|
+
//# sourceMappingURL=js-getTransactionStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-getTransactionStatus.d.ts","sourceRoot":"","sources":["../../../src/families/solana/js-getTransactionStatus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,SAAS,CAAC;AAGpD,QAAA,MAAM,oBAAoB,MACrB,OAAO,MACN,WAAW,KACd,QAAQ,iBAAiB,CAwC3B,CAAC;AA6BF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
var bignumber_js_1 = require("bignumber.js");
|
|
40
|
+
var utils_1 = require("./utils");
|
|
41
|
+
var getTransactionStatus = function (_, tx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var txFees, commandDescriptor, command, estimatedFees, amount, totalSpent;
|
|
43
|
+
var _a, _b, _c, _d, _e;
|
|
44
|
+
return __generator(this, function (_f) {
|
|
45
|
+
txFees = new bignumber_js_1.BigNumber((_b = (_a = tx.feeCalculator) === null || _a === void 0 ? void 0 : _a.lamportsPerSignature) !== null && _b !== void 0 ? _b : 0);
|
|
46
|
+
commandDescriptor = tx.model.commandDescriptor;
|
|
47
|
+
if (commandDescriptor === undefined) {
|
|
48
|
+
return [2 /*return*/, {
|
|
49
|
+
amount: new bignumber_js_1.BigNumber(tx.amount),
|
|
50
|
+
errors: {},
|
|
51
|
+
warnings: {},
|
|
52
|
+
estimatedFees: txFees,
|
|
53
|
+
totalSpent: new bignumber_js_1.BigNumber(tx.amount)
|
|
54
|
+
}];
|
|
55
|
+
}
|
|
56
|
+
switch (commandDescriptor.status) {
|
|
57
|
+
case "invalid":
|
|
58
|
+
return [2 /*return*/, {
|
|
59
|
+
amount: new bignumber_js_1.BigNumber(tx.amount),
|
|
60
|
+
errors: commandDescriptor.errors,
|
|
61
|
+
warnings: (_c = commandDescriptor.warnings) !== null && _c !== void 0 ? _c : {},
|
|
62
|
+
estimatedFees: txFees,
|
|
63
|
+
totalSpent: new bignumber_js_1.BigNumber(0)
|
|
64
|
+
}];
|
|
65
|
+
case "valid": {
|
|
66
|
+
command = commandDescriptor.command;
|
|
67
|
+
estimatedFees = txFees.plus((_d = commandDescriptor.fees) !== null && _d !== void 0 ? _d : 0);
|
|
68
|
+
amount = getAmount(tx, command);
|
|
69
|
+
totalSpent = getTotalSpent(command, amount, estimatedFees);
|
|
70
|
+
return [2 /*return*/, {
|
|
71
|
+
amount: amount,
|
|
72
|
+
estimatedFees: estimatedFees,
|
|
73
|
+
totalSpent: totalSpent,
|
|
74
|
+
warnings: (_e = commandDescriptor.warnings) !== null && _e !== void 0 ? _e : {},
|
|
75
|
+
errors: {}
|
|
76
|
+
}];
|
|
77
|
+
}
|
|
78
|
+
default:
|
|
79
|
+
return [2 /*return*/, (0, utils_1.assertUnreachable)(commandDescriptor)];
|
|
80
|
+
}
|
|
81
|
+
return [2 /*return*/];
|
|
82
|
+
});
|
|
83
|
+
}); };
|
|
84
|
+
function getAmount(tx, command) {
|
|
85
|
+
switch (command.kind) {
|
|
86
|
+
case "transfer":
|
|
87
|
+
case "token.transfer":
|
|
88
|
+
return new bignumber_js_1.BigNumber(command.amount);
|
|
89
|
+
default:
|
|
90
|
+
return tx.amount;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function getTotalSpent(command, amount, estimatedFees) {
|
|
94
|
+
switch (command.kind) {
|
|
95
|
+
case "transfer":
|
|
96
|
+
return amount.plus(estimatedFees);
|
|
97
|
+
case "token.transfer":
|
|
98
|
+
return amount;
|
|
99
|
+
case "token.createATA":
|
|
100
|
+
return estimatedFees;
|
|
101
|
+
default:
|
|
102
|
+
return (0, utils_1.assertUnreachable)(command);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports["default"] = getTransactionStatus;
|
|
106
|
+
//# sourceMappingURL=js-getTransactionStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-getTransactionStatus.js","sourceRoot":"","sources":["../../../src/families/solana/js-getTransactionStatus.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAGzC,iCAA4C;AAE5C,IAAM,oBAAoB,GAAG,UAC3B,CAAU,EACV,EAAe;;;;QAET,MAAM,GAAG,IAAI,wBAAS,CAAC,MAAA,MAAA,EAAE,CAAC,aAAa,0CAAE,oBAAoB,mCAAI,CAAC,CAAC,CAAC;QAElE,iBAAiB,GAAK,EAAE,CAAC,KAAK,kBAAb,CAAc;QAEvC,IAAI,iBAAiB,KAAK,SAAS,EAAE;YACnC,sBAAO;oBACL,MAAM,EAAE,IAAI,wBAAS,CAAC,EAAE,CAAC,MAAM,CAAC;oBAChC,MAAM,EAAE,EAAE;oBACV,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,MAAM;oBACrB,UAAU,EAAE,IAAI,wBAAS,CAAC,EAAE,CAAC,MAAM,CAAC;iBACrC,EAAC;SACH;QACD,QAAQ,iBAAiB,CAAC,MAAM,EAAE;YAChC,KAAK,SAAS;gBACZ,sBAAO;wBACL,MAAM,EAAE,IAAI,wBAAS,CAAC,EAAE,CAAC,MAAM,CAAC;wBAChC,MAAM,EAAE,iBAAiB,CAAC,MAAM;wBAChC,QAAQ,EAAE,MAAA,iBAAiB,CAAC,QAAQ,mCAAI,EAAE;wBAC1C,aAAa,EAAE,MAAM;wBACrB,UAAU,EAAE,IAAI,wBAAS,CAAC,CAAC,CAAC;qBAC7B,EAAC;YACJ,KAAK,OAAO,CAAC,CAAC;gBACJ,OAAO,GAAK,iBAAiB,QAAtB,CAAuB;gBAChC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,iBAAiB,CAAC,IAAI,mCAAI,CAAC,CAAC,CAAC;gBACzD,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;gBAChC,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;gBAEjE,sBAAO;wBACL,MAAM,QAAA;wBACN,aAAa,eAAA;wBACb,UAAU,YAAA;wBACV,QAAQ,EAAE,MAAA,iBAAiB,CAAC,QAAQ,mCAAI,EAAE;wBAC1C,MAAM,EAAE,EAAE;qBACX,EAAC;aACH;YACD;gBACE,sBAAO,IAAA,yBAAiB,EAAC,iBAAiB,CAAC,EAAC;SAC/C;;;KACF,CAAC;AAEF,SAAS,SAAS,CAAC,EAAe,EAAE,OAAgB;IAClD,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,UAAU,CAAC;QAChB,KAAK,gBAAgB;YACnB,OAAO,IAAI,wBAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC;YACE,OAAO,EAAE,CAAC,MAAM,CAAC;KACpB;AACH,CAAC;AAED,SAAS,aAAa,CACpB,OAAgB,EAChB,MAAiB,EACjB,aAAwB;IAExB,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACpC,KAAK,gBAAgB;YACnB,OAAO,MAAM,CAAC;QAChB,KAAK,iBAAiB;YACpB,OAAO,aAAa,CAAC;QACvB;YACE,OAAO,IAAA,yBAAiB,EAAC,OAAO,CAAC,CAAC;KACrC;AACH,CAAC;AAED,qBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Account } from "../../types";
|
|
2
|
+
import { ChainAPI } from "./api";
|
|
3
|
+
import type { Transaction } from "./types";
|
|
4
|
+
declare const prepareTransaction: (mainAccount: Account, tx: Transaction, api: ChainAPI) => Promise<Transaction>;
|
|
5
|
+
export { prepareTransaction };
|
|
6
|
+
//# sourceMappingURL=js-prepareTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-prepareTransaction.d.ts","sourceRoot":"","sources":["../../../src/families/solana/js-prepareTransaction.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAmBjC,OAAO,KAAK,EAKV,WAAW,EAGZ,MAAM,SAAS,CAAC;AAsDjB,QAAA,MAAM,kBAAkB,gBACT,OAAO,MAChB,WAAW,OACV,QAAQ,KACZ,QAAQ,WAAW,CA+DrB,CAAC;AAuQF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|