@ledgerhq/coin-canton 0.2.0-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.integ.test.example +2 -0
- package/.eslintrc.js +22 -0
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +29 -0
- package/CHANGELOG.md +14 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +21 -0
- package/jest.integ.config.js +8 -0
- package/lib/api/index.d.ts +4 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +44 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/index.test.d.ts +2 -0
- package/lib/api/index.test.d.ts.map +1 -0
- package/lib/api/index.test.js +16 -0
- package/lib/api/index.test.js.map +1 -0
- package/lib/bridge/broadcast.d.ts +4 -0
- package/lib/bridge/broadcast.d.ts.map +1 -0
- package/lib/bridge/broadcast.js +11 -0
- package/lib/bridge/broadcast.js.map +1 -0
- package/lib/bridge/broadcast.test.d.ts +2 -0
- package/lib/bridge/broadcast.test.d.ts.map +1 -0
- package/lib/bridge/broadcast.test.js +35 -0
- package/lib/bridge/broadcast.test.js.map +1 -0
- package/lib/bridge/createTransaction.d.ts +4 -0
- package/lib/bridge/createTransaction.d.ts.map +1 -0
- package/lib/bridge/createTransaction.js +19 -0
- package/lib/bridge/createTransaction.js.map +1 -0
- package/lib/bridge/createTransaction.test.d.ts +2 -0
- package/lib/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib/bridge/createTransaction.test.js +12 -0
- package/lib/bridge/createTransaction.test.js.map +1 -0
- package/lib/bridge/deviceTransactionConfig.d.ts +11 -0
- package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/bridge/deviceTransactionConfig.js +21 -0
- package/lib/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib/bridge/deviceTransactionConfig.test.js +22 -0
- package/lib/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib/bridge/estimateMaxSpendable.d.ts +4 -0
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/estimateMaxSpendable.js +26 -0
- package/lib/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/getTransactionStatus.d.ts +4 -0
- package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib/bridge/getTransactionStatus.js +78 -0
- package/lib/bridge/getTransactionStatus.js.map +1 -0
- package/lib/bridge/index.d.ts +11 -0
- package/lib/bridge/index.d.ts.map +1 -0
- package/lib/bridge/index.js +51 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge/index.test.d.ts +2 -0
- package/lib/bridge/index.test.d.ts.map +1 -0
- package/lib/bridge/index.test.js +31 -0
- package/lib/bridge/index.test.js.map +1 -0
- package/lib/bridge/prepareTransaction.d.ts +4 -0
- package/lib/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib/bridge/prepareTransaction.js +20 -0
- package/lib/bridge/prepareTransaction.js.map +1 -0
- package/lib/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib/bridge/prepareTransaction.test.js +30 -0
- package/lib/bridge/prepareTransaction.test.js.map +1 -0
- package/lib/bridge/signOperation.d.ts +5 -0
- package/lib/bridge/signOperation.d.ts.map +1 -0
- package/lib/bridge/signOperation.js +71 -0
- package/lib/bridge/signOperation.js.map +1 -0
- package/lib/bridge/sync.d.ts +3 -0
- package/lib/bridge/sync.d.ts.map +1 -0
- package/lib/bridge/sync.js +86 -0
- package/lib/bridge/sync.js.map +1 -0
- package/lib/bridge/transaction.d.ts +15 -0
- package/lib/bridge/transaction.d.ts.map +1 -0
- package/lib/bridge/transaction.js +50 -0
- package/lib/bridge/transaction.js.map +1 -0
- package/lib/bridge/updateTransaction.d.ts +4 -0
- package/lib/bridge/updateTransaction.d.ts.map +1 -0
- package/lib/bridge/updateTransaction.js +17 -0
- package/lib/bridge/updateTransaction.js.map +1 -0
- package/lib/common-logic/account/getBalance.d.ts +3 -0
- package/lib/common-logic/account/getBalance.d.ts.map +1 -0
- package/lib/common-logic/account/getBalance.js +10 -0
- package/lib/common-logic/account/getBalance.js.map +1 -0
- package/lib/common-logic/account/getNextSequence.d.ts +2 -0
- package/lib/common-logic/account/getNextSequence.d.ts.map +1 -0
- package/lib/common-logic/account/getNextSequence.js +9 -0
- package/lib/common-logic/account/getNextSequence.js.map +1 -0
- package/lib/common-logic/common.d.ts +3 -0
- package/lib/common-logic/common.d.ts.map +1 -0
- package/lib/common-logic/common.js +11 -0
- package/lib/common-logic/common.js.map +1 -0
- package/lib/common-logic/history/lastBlock.d.ts +3 -0
- package/lib/common-logic/history/lastBlock.d.ts.map +1 -0
- package/lib/common-logic/history/lastBlock.js +13 -0
- package/lib/common-logic/history/lastBlock.js.map +1 -0
- package/lib/common-logic/history/listOperations.d.ts +11 -0
- package/lib/common-logic/history/listOperations.d.ts.map +1 -0
- package/lib/common-logic/history/listOperations.js +52 -0
- package/lib/common-logic/history/listOperations.js.map +1 -0
- package/lib/common-logic/index.d.ts +11 -0
- package/lib/common-logic/index.d.ts.map +1 -0
- package/lib/common-logic/index.js +24 -0
- package/lib/common-logic/index.js.map +1 -0
- package/lib/common-logic/transaction/broadcast.d.ts +2 -0
- package/lib/common-logic/transaction/broadcast.d.ts.map +1 -0
- package/lib/common-logic/transaction/broadcast.js +9 -0
- package/lib/common-logic/transaction/broadcast.js.map +1 -0
- package/lib/common-logic/transaction/combine.d.ts +2 -0
- package/lib/common-logic/transaction/combine.d.ts.map +1 -0
- package/lib/common-logic/transaction/combine.js +9 -0
- package/lib/common-logic/transaction/combine.js.map +1 -0
- package/lib/common-logic/transaction/craftTransaction.d.ts +15 -0
- package/lib/common-logic/transaction/craftTransaction.d.ts.map +1 -0
- package/lib/common-logic/transaction/craftTransaction.js +20 -0
- package/lib/common-logic/transaction/craftTransaction.js.map +1 -0
- package/lib/common-logic/transaction/estimateFees.d.ts +2 -0
- package/lib/common-logic/transaction/estimateFees.d.ts.map +1 -0
- package/lib/common-logic/transaction/estimateFees.js +21 -0
- package/lib/common-logic/transaction/estimateFees.js.map +1 -0
- package/lib/common-logic/utils.d.ts +6 -0
- package/lib/common-logic/utils.d.ts.map +1 -0
- package/lib/common-logic/utils.js +22 -0
- package/lib/common-logic/utils.js.map +1 -0
- package/lib/config.d.ts +12 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +9 -0
- package/lib/config.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/network/indexer.d.ts +6 -0
- package/lib/network/indexer.d.ts.map +1 -0
- package/lib/network/indexer.js +19 -0
- package/lib/network/indexer.js.map +1 -0
- package/lib/network/mock-network.d.ts +5 -0
- package/lib/network/mock-network.d.ts.map +1 -0
- package/lib/network/mock-network.js +29 -0
- package/lib/network/mock-network.js.map +1 -0
- package/lib/network/node.d.ts +12 -0
- package/lib/network/node.d.ts.map +1 -0
- package/lib/network/node.js +92 -0
- package/lib/network/node.js.map +1 -0
- package/lib/network/types.d.ts +47 -0
- package/lib/network/types.d.ts.map +1 -0
- package/lib/network/types.js +7 -0
- package/lib/network/types.js.map +1 -0
- package/lib/signer/getAddress.d.ts +6 -0
- package/lib/signer/getAddress.d.ts.map +1 -0
- package/lib/signer/getAddress.js +14 -0
- package/lib/signer/getAddress.js.map +1 -0
- package/lib/signer/index.d.ts +6 -0
- package/lib/signer/index.d.ts.map +1 -0
- package/lib/signer/index.js +11 -0
- package/lib/signer/index.js.map +1 -0
- package/lib/test/bot-deviceActions.d.ts +4 -0
- package/lib/test/bot-deviceActions.d.ts.map +1 -0
- package/lib/test/bot-deviceActions.js +44 -0
- package/lib/test/bot-deviceActions.js.map +1 -0
- package/lib/test/bot-specs.d.ts +2 -0
- package/lib/test/bot-specs.d.ts.map +1 -0
- package/lib/test/bot-specs.js +79 -0
- package/lib/test/bot-specs.js.map +1 -0
- package/lib/test/bridgeDatasetTest.d.ts +5 -0
- package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib/test/bridgeDatasetTest.js +148 -0
- package/lib/test/bridgeDatasetTest.js.map +1 -0
- package/lib/test/cli.d.ts +26 -0
- package/lib/test/cli.d.ts.map +1 -0
- package/lib/test/cli.js +36 -0
- package/lib/test/cli.js.map +1 -0
- package/lib/test/index.d.ts +5 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +26 -0
- package/lib/test/index.js.map +1 -0
- package/lib/types/bridge.d.ts +23 -0
- package/lib/types/bridge.d.ts.map +1 -0
- package/lib/types/bridge.js +3 -0
- package/lib/types/bridge.js.map +1 -0
- package/lib/types/errors.d.ts +4 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/errors.js +6 -0
- package/lib/types/errors.js.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +19 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/signer.d.ts +10 -0
- package/lib/types/signer.d.ts.map +1 -0
- package/lib/types/signer.js +3 -0
- package/lib/types/signer.js.map +1 -0
- package/lib-es/api/index.d.ts +4 -0
- package/lib-es/api/index.d.ts.map +1 -0
- package/lib-es/api/index.js +38 -0
- package/lib-es/api/index.js.map +1 -0
- package/lib-es/api/index.test.d.ts +2 -0
- package/lib-es/api/index.test.d.ts.map +1 -0
- package/lib-es/api/index.test.js +14 -0
- package/lib-es/api/index.test.js.map +1 -0
- package/lib-es/bridge/broadcast.d.ts +4 -0
- package/lib-es/bridge/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.js +7 -0
- package/lib-es/bridge/broadcast.js.map +1 -0
- package/lib-es/bridge/broadcast.test.d.ts +2 -0
- package/lib-es/bridge/broadcast.test.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.test.js +33 -0
- package/lib-es/bridge/broadcast.test.js.map +1 -0
- package/lib-es/bridge/createTransaction.d.ts +4 -0
- package/lib-es/bridge/createTransaction.d.ts.map +1 -0
- package/lib-es/bridge/createTransaction.js +12 -0
- package/lib-es/bridge/createTransaction.js.map +1 -0
- package/lib-es/bridge/createTransaction.test.d.ts +2 -0
- package/lib-es/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib-es/bridge/createTransaction.test.js +10 -0
- package/lib-es/bridge/createTransaction.test.js.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts +11 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.js +19 -0
- package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib-es/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.test.js +17 -0
- package/lib-es/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts +4 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.js +19 -0
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
- package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/bridge/getTransactionStatus.js +71 -0
- package/lib-es/bridge/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/index.d.ts +11 -0
- package/lib-es/bridge/index.d.ts.map +1 -0
- package/lib-es/bridge/index.js +45 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge/index.test.d.ts +2 -0
- package/lib-es/bridge/index.test.d.ts.map +1 -0
- package/lib-es/bridge/index.test.js +29 -0
- package/lib-es/bridge/index.test.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.d.ts +4 -0
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib-es/bridge/prepareTransaction.js +13 -0
- package/lib-es/bridge/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib-es/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib-es/bridge/prepareTransaction.test.js +25 -0
- package/lib-es/bridge/prepareTransaction.test.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts +5 -0
- package/lib-es/bridge/signOperation.d.ts.map +1 -0
- package/lib-es/bridge/signOperation.js +67 -0
- package/lib-es/bridge/signOperation.js.map +1 -0
- package/lib-es/bridge/sync.d.ts +3 -0
- package/lib-es/bridge/sync.d.ts.map +1 -0
- package/lib-es/bridge/sync.js +79 -0
- package/lib-es/bridge/sync.js.map +1 -0
- package/lib-es/bridge/transaction.d.ts +15 -0
- package/lib-es/bridge/transaction.d.ts.map +1 -0
- package/lib-es/bridge/transaction.js +44 -0
- package/lib-es/bridge/transaction.js.map +1 -0
- package/lib-es/bridge/updateTransaction.d.ts +4 -0
- package/lib-es/bridge/updateTransaction.d.ts.map +1 -0
- package/lib-es/bridge/updateTransaction.js +13 -0
- package/lib-es/bridge/updateTransaction.js.map +1 -0
- package/lib-es/common-logic/account/getBalance.d.ts +3 -0
- package/lib-es/common-logic/account/getBalance.d.ts.map +1 -0
- package/lib-es/common-logic/account/getBalance.js +7 -0
- package/lib-es/common-logic/account/getBalance.js.map +1 -0
- package/lib-es/common-logic/account/getNextSequence.d.ts +2 -0
- package/lib-es/common-logic/account/getNextSequence.d.ts.map +1 -0
- package/lib-es/common-logic/account/getNextSequence.js +6 -0
- package/lib-es/common-logic/account/getNextSequence.js.map +1 -0
- package/lib-es/common-logic/common.d.ts +3 -0
- package/lib-es/common-logic/common.d.ts.map +1 -0
- package/lib-es/common-logic/common.js +7 -0
- package/lib-es/common-logic/common.js.map +1 -0
- package/lib-es/common-logic/history/lastBlock.d.ts +3 -0
- package/lib-es/common-logic/history/lastBlock.d.ts.map +1 -0
- package/lib-es/common-logic/history/lastBlock.js +10 -0
- package/lib-es/common-logic/history/lastBlock.js.map +1 -0
- package/lib-es/common-logic/history/listOperations.d.ts +11 -0
- package/lib-es/common-logic/history/listOperations.d.ts.map +1 -0
- package/lib-es/common-logic/history/listOperations.js +49 -0
- package/lib-es/common-logic/history/listOperations.js.map +1 -0
- package/lib-es/common-logic/index.d.ts +11 -0
- package/lib-es/common-logic/index.d.ts.map +1 -0
- package/lib-es/common-logic/index.js +11 -0
- package/lib-es/common-logic/index.js.map +1 -0
- package/lib-es/common-logic/transaction/broadcast.d.ts +2 -0
- package/lib-es/common-logic/transaction/broadcast.d.ts.map +1 -0
- package/lib-es/common-logic/transaction/broadcast.js +6 -0
- package/lib-es/common-logic/transaction/broadcast.js.map +1 -0
- package/lib-es/common-logic/transaction/combine.d.ts +2 -0
- package/lib-es/common-logic/transaction/combine.d.ts.map +1 -0
- package/lib-es/common-logic/transaction/combine.js +6 -0
- package/lib-es/common-logic/transaction/combine.js.map +1 -0
- package/lib-es/common-logic/transaction/craftTransaction.d.ts +15 -0
- package/lib-es/common-logic/transaction/craftTransaction.d.ts.map +1 -0
- package/lib-es/common-logic/transaction/craftTransaction.js +17 -0
- package/lib-es/common-logic/transaction/craftTransaction.js.map +1 -0
- package/lib-es/common-logic/transaction/estimateFees.d.ts +2 -0
- package/lib-es/common-logic/transaction/estimateFees.d.ts.map +1 -0
- package/lib-es/common-logic/transaction/estimateFees.js +18 -0
- package/lib-es/common-logic/transaction/estimateFees.js.map +1 -0
- package/lib-es/common-logic/utils.d.ts +6 -0
- package/lib-es/common-logic/utils.d.ts.map +1 -0
- package/lib-es/common-logic/utils.js +13 -0
- package/lib-es/common-logic/utils.js.map +1 -0
- package/lib-es/config.d.ts +12 -0
- package/lib-es/config.d.ts.map +1 -0
- package/lib-es/config.js +4 -0
- package/lib-es/config.js.map +1 -0
- package/lib-es/index.d.ts +4 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +3 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/network/indexer.d.ts +6 -0
- package/lib-es/network/indexer.d.ts.map +1 -0
- package/lib-es/network/indexer.js +12 -0
- package/lib-es/network/indexer.js.map +1 -0
- package/lib-es/network/mock-network.d.ts +5 -0
- package/lib-es/network/mock-network.d.ts.map +1 -0
- package/lib-es/network/mock-network.js +25 -0
- package/lib-es/network/mock-network.js.map +1 -0
- package/lib-es/network/node.d.ts +12 -0
- package/lib-es/network/node.d.ts.map +1 -0
- package/lib-es/network/node.js +80 -0
- package/lib-es/network/node.js.map +1 -0
- package/lib-es/network/types.d.ts +47 -0
- package/lib-es/network/types.d.ts.map +1 -0
- package/lib-es/network/types.js +4 -0
- package/lib-es/network/types.js.map +1 -0
- package/lib-es/signer/getAddress.d.ts +6 -0
- package/lib-es/signer/getAddress.d.ts.map +1 -0
- package/lib-es/signer/getAddress.js +12 -0
- package/lib-es/signer/getAddress.js.map +1 -0
- package/lib-es/signer/index.d.ts +6 -0
- package/lib-es/signer/index.d.ts.map +1 -0
- package/lib-es/signer/index.js +6 -0
- package/lib-es/signer/index.js.map +1 -0
- package/lib-es/test/bot-deviceActions.d.ts +4 -0
- package/lib-es/test/bot-deviceActions.d.ts.map +1 -0
- package/lib-es/test/bot-deviceActions.js +41 -0
- package/lib-es/test/bot-deviceActions.js.map +1 -0
- package/lib-es/test/bot-specs.d.ts +1 -0
- package/lib-es/test/bot-specs.d.ts.map +1 -0
- package/lib-es/test/bot-specs.js +78 -0
- package/lib-es/test/bot-specs.js.map +1 -0
- package/lib-es/test/bridgeDatasetTest.d.ts +5 -0
- package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib-es/test/bridgeDatasetTest.js +142 -0
- package/lib-es/test/bridgeDatasetTest.js.map +1 -0
- package/lib-es/test/cli.d.ts +26 -0
- package/lib-es/test/cli.d.ts.map +1 -0
- package/lib-es/test/cli.js +30 -0
- package/lib-es/test/cli.js.map +1 -0
- package/lib-es/test/index.d.ts +5 -0
- package/lib-es/test/index.d.ts.map +1 -0
- package/lib-es/test/index.js +6 -0
- package/lib-es/test/index.js.map +1 -0
- package/lib-es/types/bridge.d.ts +23 -0
- package/lib-es/types/bridge.d.ts.map +1 -0
- package/lib-es/types/bridge.js +2 -0
- package/lib-es/types/bridge.js.map +1 -0
- package/lib-es/types/errors.d.ts +4 -0
- package/lib-es/types/errors.d.ts.map +1 -0
- package/lib-es/types/errors.js +3 -0
- package/lib-es/types/errors.js.map +1 -0
- package/lib-es/types/index.d.ts +13 -0
- package/lib-es/types/index.d.ts.map +1 -0
- package/lib-es/types/index.js +3 -0
- package/lib-es/types/index.js.map +1 -0
- package/lib-es/types/signer.d.ts +10 -0
- package/lib-es/types/signer.d.ts.map +1 -0
- package/lib-es/types/signer.js +2 -0
- package/lib-es/types/signer.js.map +1 -0
- package/package.json +137 -0
- package/src/api/index.test.ts +15 -0
- package/src/api/index.ts +65 -0
- package/src/bridge/broadcast.test.ts +36 -0
- package/src/bridge/broadcast.ts +11 -0
- package/src/bridge/createTransaction.test.ts +12 -0
- package/src/bridge/createTransaction.ts +14 -0
- package/src/bridge/deviceTransactionConfig.test.ts +22 -0
- package/src/bridge/deviceTransactionConfig.ts +34 -0
- package/src/bridge/estimateMaxSpendable.ts +25 -0
- package/src/bridge/getTransactionStatus.ts +88 -0
- package/src/bridge/index.test.ts +31 -0
- package/src/bridge/index.ts +62 -0
- package/src/bridge/prepareTransaction.test.ts +29 -0
- package/src/bridge/prepareTransaction.ts +25 -0
- package/src/bridge/signOperation.ts +93 -0
- package/src/bridge/sync.ts +106 -0
- package/src/bridge/transaction.ts +61 -0
- package/src/bridge/updateTransaction.ts +17 -0
- package/src/common-logic/account/getBalance.ts +8 -0
- package/src/common-logic/account/getNextSequence.ts +6 -0
- package/src/common-logic/common.ts +9 -0
- package/src/common-logic/history/lastBlock.ts +11 -0
- package/src/common-logic/history/listOperations.ts +64 -0
- package/src/common-logic/index.ts +11 -0
- package/src/common-logic/transaction/broadcast.ts +6 -0
- package/src/common-logic/transaction/combine.ts +6 -0
- package/src/common-logic/transaction/craftTransaction.ts +36 -0
- package/src/common-logic/transaction/estimateFees.ts +16 -0
- package/src/common-logic/utils.ts +18 -0
- package/src/config.ts +12 -0
- package/src/index.ts +4 -0
- package/src/network/indexer.ts +17 -0
- package/src/network/mock-network.ts +25 -0
- package/src/network/node.ts +94 -0
- package/src/network/types.ts +51 -0
- package/src/signer/getAddress.ts +20 -0
- package/src/signer/index.ts +7 -0
- package/src/test/bot-deviceActions.ts +48 -0
- package/src/test/bot-specs.ts +76 -0
- package/src/test/bridgeDatasetTest.ts +147 -0
- package/src/test/cli.ts +44 -0
- package/src/test/index.ts +6 -0
- package/src/types/bridge.ts +33 -0
- package/src/types/errors.ts +3 -0
- package/src/types/index.ts +13 -0
- package/src/types/signer.ts +11 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getAddress = (signerContext) => {
|
|
4
|
+
return async (deviceId, { path, verify }) => {
|
|
5
|
+
const { address, publicKey } = (await signerContext(deviceId, signer => signer.getAddress(path)));
|
|
6
|
+
return {
|
|
7
|
+
path,
|
|
8
|
+
address,
|
|
9
|
+
publicKey,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.default = getAddress;
|
|
14
|
+
//# sourceMappingURL=getAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAddress.js","sourceRoot":"","sources":["../../src/signer/getAddress.ts"],"names":[],"mappings":";;AAKA,MAAM,UAAU,GAAG,CAAC,aAA+C,EAAgB,EAAE;IACnF,OAAO,KAAK,EAAE,QAAgB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAqB,EAAE,EAAE;QACrE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CACrE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CACxB,CAAuB,CAAC;QAEzB,OAAO;YACL,IAAI;YACJ,OAAO;YACP,SAAS;SACV,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signer/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This directory is the home for all types and logic based on Ledgers signer.
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const getAddress_1 = __importDefault(require("./getAddress"));
|
|
10
|
+
exports.default = getAddress_1.default;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signer/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAEH,8DAAsC;AAEtC,kBAAe,oBAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-deviceActions.d.ts","sourceRoot":"","sources":["../../src/test/bot-deviceActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5C,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,EAAE,GAAG,CAuC3D,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acceptTransaction = void 0;
|
|
4
|
+
const specs_1 = require("@ledgerhq/coin-framework/bot/specs");
|
|
5
|
+
exports.acceptTransaction = (0, specs_1.deviceActionFlow)({
|
|
6
|
+
steps: [
|
|
7
|
+
{
|
|
8
|
+
title: "Transaction Type",
|
|
9
|
+
button: specs_1.SpeculosButton.RIGHT,
|
|
10
|
+
expectedValue: () => "Payment",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: "Amount",
|
|
14
|
+
button: specs_1.SpeculosButton.RIGHT,
|
|
15
|
+
expectedValue: ({ account, status }) => (0, specs_1.formatDeviceAmount)(account.currency, status.amount),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "Fee",
|
|
19
|
+
button: specs_1.SpeculosButton.RIGHT,
|
|
20
|
+
expectedValue: ({ account, status }) => (0, specs_1.formatDeviceAmount)(account.currency, status.estimatedFees),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: "Destination",
|
|
24
|
+
button: specs_1.SpeculosButton.RIGHT,
|
|
25
|
+
trimValue: true,
|
|
26
|
+
expectedValue: ({ transaction }) => transaction.recipient,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Account",
|
|
30
|
+
button: specs_1.SpeculosButton.RIGHT,
|
|
31
|
+
trimValue: true,
|
|
32
|
+
expectedValue: ({ account }) => account.freshAddress,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Accept",
|
|
36
|
+
button: specs_1.SpeculosButton.BOTH,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: "Sign transaction",
|
|
40
|
+
button: specs_1.SpeculosButton.BOTH,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=bot-deviceActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-deviceActions.js","sourceRoot":"","sources":["../../src/test/bot-deviceActions.ts"],"names":[],"mappings":";;;AAEA,8DAI4C;AAE/B,QAAA,iBAAiB,GAAmC,IAAA,wBAAgB,EAAC;IAChF,KAAK,EAAE;QACL;YACE,KAAK,EAAE,kBAAkB;YACzB,MAAM,EAAE,sBAAc,CAAC,KAAK;YAC5B,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;SAC/B;QACD;YACE,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,sBAAc,CAAC,KAAK;YAC5B,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAA,0BAAkB,EAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;SAC5F;QACD;YACE,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,sBAAc,CAAC,KAAK;YAC5B,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CACrC,IAAA,0BAAkB,EAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,sBAAc,CAAC,KAAK;YAC5B,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;SAC1D;QACD;YACE,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,sBAAc,CAAC,KAAK;YAC5B,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY;SACrD;QACD;YACE,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,sBAAc,CAAC,IAAI;SAC5B;QACD;YACE,KAAK,EAAE,kBAAkB;YACzB,MAAM,EAAE,sBAAc,CAAC,IAAI;SAC5B;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-specs.d.ts","sourceRoot":"","sources":["../../src/test/bot-specs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
import invariant from "invariant";
|
|
6
|
+
import expect from "expect";
|
|
7
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
8
|
+
import type { AppSpec } from "@ledgerhq/coin-framework/bot/types";
|
|
9
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
10
|
+
import { parseCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
|
|
11
|
+
import { botTest, genericTestDestination, pickSiblings } from "@ledgerhq/coin-framework/bot/specs";
|
|
12
|
+
import { acceptTransaction } from "./bot-deviceActions";
|
|
13
|
+
import type { Transaction } from "../types";
|
|
14
|
+
|
|
15
|
+
const currency = getCryptoCurrencyById("boilerplate");
|
|
16
|
+
const minAmountCutoff = parseCurrencyUnit(currency.units[0], "0.1");
|
|
17
|
+
const reserve = parseCurrencyUnit(currency.units[0], "20");
|
|
18
|
+
|
|
19
|
+
const boilerplateSpec: AppSpec<Transaction> = {
|
|
20
|
+
name: "BOILERPLATE",
|
|
21
|
+
currency,
|
|
22
|
+
appQuery: {
|
|
23
|
+
model: DeviceModelId.nanoS,
|
|
24
|
+
appName: "BOILERPLATE_APP_NAME",
|
|
25
|
+
},
|
|
26
|
+
genericDeviceAction: acceptTransaction,
|
|
27
|
+
minViableAmount: minAmountCutoff,
|
|
28
|
+
mutations: [
|
|
29
|
+
{
|
|
30
|
+
name: "move ~50%",
|
|
31
|
+
maxRun: 2,
|
|
32
|
+
testDestination: genericTestDestination,
|
|
33
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
34
|
+
invariant(maxSpendable.gt(minAmountCutoff), "balance is too low");
|
|
35
|
+
const transaction = bridge.createTransaction(account);
|
|
36
|
+
const sibling = pickSiblings(siblings, 3);
|
|
37
|
+
const recipient = sibling.freshAddress;
|
|
38
|
+
let amount = maxSpendable.div(1.9 + 0.2 * Math.random()).integerValue();
|
|
39
|
+
|
|
40
|
+
if (!sibling.used && amount.lt(reserve)) {
|
|
41
|
+
invariant(
|
|
42
|
+
maxSpendable.gt(reserve.plus(minAmountCutoff)),
|
|
43
|
+
"not enough funds to send to new account",
|
|
44
|
+
);
|
|
45
|
+
amount = reserve;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
transaction,
|
|
50
|
+
updates: [
|
|
51
|
+
{
|
|
52
|
+
amount,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
recipient,
|
|
56
|
+
},
|
|
57
|
+
Math.random() > 0.5
|
|
58
|
+
? {
|
|
59
|
+
tag: 123,
|
|
60
|
+
}
|
|
61
|
+
: null,
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
test: ({ account, accountBeforeTransaction, operation }) => {
|
|
66
|
+
botTest("account balance moved with operation.value", () =>
|
|
67
|
+
expect(account.balance.toString()).toBe(
|
|
68
|
+
accountBeforeTransaction.balance.minus(operation.value).toString(),
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
export default {
|
|
76
|
+
boilerplateSpec,
|
|
77
|
+
};
|
|
78
|
+
*/
|
|
79
|
+
//# sourceMappingURL=bot-specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-specs.js","sourceRoot":"","sources":["../../src/test/bot-specs.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DatasetTest } from "@ledgerhq/types-live";
|
|
2
|
+
import { Transaction } from "../types";
|
|
3
|
+
export declare const newAddress1 = "rZvBc5e2YR1A9otS3r9DyGh3NDP8XLLp4";
|
|
4
|
+
export declare const dataset: DatasetTest<Transaction>;
|
|
5
|
+
//# sourceMappingURL=bridgeDatasetTest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeDatasetTest.d.ts","sourceRoot":"","sources":["../../src/test/bridgeDatasetTest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,WAAW,sCAAsC,CAAC;AAE/D,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CA0I5C,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dataset = exports.newAddress1 = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const errors_1 = require("@ledgerhq/errors");
|
|
9
|
+
const transaction_1 = require("../bridge/transaction");
|
|
10
|
+
exports.newAddress1 = "rZvBc5e2YR1A9otS3r9DyGh3NDP8XLLp4";
|
|
11
|
+
exports.dataset = {
|
|
12
|
+
implementations: ["mock", "ripplejs"],
|
|
13
|
+
currencies: {
|
|
14
|
+
ripple: {
|
|
15
|
+
scanAccounts: [
|
|
16
|
+
{
|
|
17
|
+
name: "ripple seed 1",
|
|
18
|
+
unstableAccounts: true,
|
|
19
|
+
// our account is getting spammed...
|
|
20
|
+
apdus: `
|
|
21
|
+
=> e00200400d038000002c8000009080000000
|
|
22
|
+
<= 2103c73f64083463fa923e1530af6f558204853873c6a45cbfb1f2f1e2ac2a5d989c2272734a4675764165634c333153513750594864504b6b3335625a456f78446d5231789000
|
|
23
|
+
=> e002004015058000002c80000090800000000000000000000000
|
|
24
|
+
<= 2103d1adcff3e0cf1232b1416a75cd6f23b49dd6a25c69bc291a1f6783ec6825ec062272616765584842365134566276765764547a4b414e776a65435434485846434b58379000
|
|
25
|
+
=> e002004015058000002c80000090800000010000000000000000
|
|
26
|
+
<= 21036da109ee84825eab0f55fb57bcf9ef0b05621e71fb0400266fb42d6f68f9487c2272425065393169766d67384347573450414e6f657555555173756d337470786a55469000
|
|
27
|
+
=> e002004015058000002c80000090800000020000000000000000
|
|
28
|
+
<= 2102df9a55b79fb3668dac70fee7372806195841cd713ab8da9fba82240f9db8a23921725a76426335653259523141396f745333723944794768334e445038584c4c70349000
|
|
29
|
+
`,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
accounts: [
|
|
33
|
+
{
|
|
34
|
+
transactions: [
|
|
35
|
+
// FIXME
|
|
36
|
+
/*
|
|
37
|
+
{
|
|
38
|
+
name: "not enough spendable balance with base reserve",
|
|
39
|
+
transaction: fromTransactionRaw({
|
|
40
|
+
family: "xrp",
|
|
41
|
+
recipient: "rB6pwovsyrFWhPYUsjj9V3CHck985QjiXi",
|
|
42
|
+
amount: "15000000",
|
|
43
|
+
tag: null,
|
|
44
|
+
fee: "1",
|
|
45
|
+
feeCustomUnit: null,
|
|
46
|
+
networkInfo: null,
|
|
47
|
+
}),
|
|
48
|
+
expectedStatus: {
|
|
49
|
+
amount: BigNumber("15000000"),
|
|
50
|
+
estimatedFees: BigNumber("1"),
|
|
51
|
+
errors: {
|
|
52
|
+
amount: new NotEnoughSpendableBalance(null, {
|
|
53
|
+
minimumAmount: formatCurrencyUnit(
|
|
54
|
+
rippleUnit,
|
|
55
|
+
BigNumber("20"),
|
|
56
|
+
{
|
|
57
|
+
disableRounding: true,
|
|
58
|
+
useGrouping: false,
|
|
59
|
+
showCode: true,
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
warnings: {},
|
|
65
|
+
totalSpent: BigNumber("15000001"),
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
*/
|
|
69
|
+
// FIXME
|
|
70
|
+
/*
|
|
71
|
+
{
|
|
72
|
+
name: "operation amount to low to create the recipient account",
|
|
73
|
+
transaction: fromTransactionRaw({
|
|
74
|
+
family: "xrp",
|
|
75
|
+
recipient: newAddress1,
|
|
76
|
+
amount: "10000000",
|
|
77
|
+
tag: null,
|
|
78
|
+
fee: "1",
|
|
79
|
+
feeCustomUnit: null,
|
|
80
|
+
networkInfo: null
|
|
81
|
+
}),
|
|
82
|
+
expectedStatus: {
|
|
83
|
+
amount: BigNumber("10000000"),
|
|
84
|
+
estimatedFees: BigNumber("1"),
|
|
85
|
+
errors: {
|
|
86
|
+
amount: new NotEnoughBalanceBecauseDestinationNotCreated()
|
|
87
|
+
},
|
|
88
|
+
warnings: {},
|
|
89
|
+
totalSpent: BigNumber("10000001")
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
*/
|
|
93
|
+
{
|
|
94
|
+
name: "recipient and sender must not be the same",
|
|
95
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
96
|
+
family: "canton",
|
|
97
|
+
recipient: "rageXHB6Q4VbvvWdTzKANwjeCT4HXFCKX7",
|
|
98
|
+
amount: "10000000",
|
|
99
|
+
fee: "1",
|
|
100
|
+
}),
|
|
101
|
+
expectedStatus: {
|
|
102
|
+
amount: new bignumber_js_1.default("10000000"),
|
|
103
|
+
estimatedFees: new bignumber_js_1.default("1"),
|
|
104
|
+
errors: {
|
|
105
|
+
recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource(),
|
|
106
|
+
},
|
|
107
|
+
warnings: {},
|
|
108
|
+
totalSpent: new bignumber_js_1.default("10000001"),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "Operation with tag succeed",
|
|
113
|
+
transaction: (0, transaction_1.fromTransactionRaw)({
|
|
114
|
+
family: "canton",
|
|
115
|
+
recipient: "rB6pwovsyrFWhPYUsjj9V3CHck985QjiXi",
|
|
116
|
+
amount: "10000000",
|
|
117
|
+
fee: "1",
|
|
118
|
+
}),
|
|
119
|
+
expectedStatus: {
|
|
120
|
+
amount: new bignumber_js_1.default("10000000"),
|
|
121
|
+
estimatedFees: new bignumber_js_1.default("1"),
|
|
122
|
+
errors: {},
|
|
123
|
+
warnings: {},
|
|
124
|
+
totalSpent: new bignumber_js_1.default("10000001"),
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
raw: {
|
|
129
|
+
id: "ripplejs:2:ripple:rageXHB6Q4VbvvWdTzKANwjeCT4HXFCKX7:",
|
|
130
|
+
seedIdentifier: "rageXHB6Q4VbvvWdTzKANwjeCT4HXFCKX7",
|
|
131
|
+
name: "XRP 1",
|
|
132
|
+
derivationMode: "",
|
|
133
|
+
index: 0,
|
|
134
|
+
freshAddress: "rageXHB6Q4VbvvWdTzKANwjeCT4HXFCKX7",
|
|
135
|
+
freshAddressPath: "44'/144'/0'/0/0",
|
|
136
|
+
blockHeight: 0,
|
|
137
|
+
operations: [],
|
|
138
|
+
pendingOperations: [],
|
|
139
|
+
currencyId: "ripple",
|
|
140
|
+
lastSyncDate: "",
|
|
141
|
+
balance: "21000310",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=bridgeDatasetTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeDatasetTest.js","sourceRoot":"","sources":["../../src/test/bridgeDatasetTest.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAErC,6CAAgF;AAChF,uDAA2D;AAG9C,QAAA,WAAW,GAAG,mCAAmC,CAAC;AAElD,QAAA,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;IACrC,UAAU,EAAE;QACV,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ;oBACE,IAAI,EAAE,eAAe;oBACrB,gBAAgB,EAAE,IAAI;oBACtB,oCAAoC;oBACpC,KAAK,EAAE;;;;;;;;;WASN;iBACF;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,YAAY,EAAE;wBACZ,QAAQ;wBAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgCF;wBACE,QAAQ;wBAER;;;;;;;;;;;;;;;;;;;;;;sBAsBF;wBACE;4BACE,IAAI,EAAE,2CAA2C;4BACjD,WAAW,EAAE,IAAA,gCAAkB,EAAC;gCAC9B,MAAM,EAAE,QAAQ;gCAChB,SAAS,EAAE,oCAAoC;gCAC/C,MAAM,EAAE,UAAU;gCAClB,GAAG,EAAE,GAAG;6BACT,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE,IAAI,sBAAS,CAAC,UAAU,CAAC;gCACjC,aAAa,EAAE,IAAI,sBAAS,CAAC,GAAG,CAAC;gCACjC,MAAM,EAAE;oCACN,SAAS,EAAE,IAAI,qDAA4C,EAAE;iCAC9D;gCACD,QAAQ,EAAE,EAAE;gCACZ,UAAU,EAAE,IAAI,sBAAS,CAAC,UAAU,CAAC;6BACtC;yBACF;wBACD;4BACE,IAAI,EAAE,4BAA4B;4BAClC,WAAW,EAAE,IAAA,gCAAkB,EAAC;gCAC9B,MAAM,EAAE,QAAQ;gCAChB,SAAS,EAAE,oCAAoC;gCAC/C,MAAM,EAAE,UAAU;gCAClB,GAAG,EAAE,GAAG;6BACT,CAAC;4BACF,cAAc,EAAE;gCACd,MAAM,EAAE,IAAI,sBAAS,CAAC,UAAU,CAAC;gCACjC,aAAa,EAAE,IAAI,sBAAS,CAAC,GAAG,CAAC;gCACjC,MAAM,EAAE,EAAE;gCACV,QAAQ,EAAE,EAAE;gCACZ,UAAU,EAAE,IAAI,sBAAS,CAAC,UAAU,CAAC;6BACtC;yBACF;qBACF;oBACD,GAAG,EAAE;wBACH,EAAE,EAAE,uDAAuD;wBAC3D,cAAc,EAAE,oCAAoC;wBACpD,IAAI,EAAE,OAAO;wBACb,cAAc,EAAE,EAAE;wBAClB,KAAK,EAAE,CAAC;wBACR,YAAY,EAAE,oCAAoC;wBAClD,gBAAgB,EAAE,iBAAiB;wBACnC,WAAW,EAAE,CAAC;wBACd,UAAU,EAAE,EAAE;wBACd,iBAAiB,EAAE,EAAE;wBACrB,UAAU,EAAE,QAAQ;wBACpB,YAAY,EAAE,EAAE;wBAChB,OAAO,EAAE,UAAU;qBACpB;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AccountLike } from "@ledgerhq/types-live";
|
|
2
|
+
import type { Transaction } from "../types";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
declare function inferTransactions(transactions: Array<{
|
|
5
|
+
account: AccountLike;
|
|
6
|
+
transaction: Transaction;
|
|
7
|
+
}>, opts: {
|
|
8
|
+
tag?: number | null | undefined;
|
|
9
|
+
fee?: string;
|
|
10
|
+
}, { inferAmount, }: {
|
|
11
|
+
inferAmount: (account: AccountLike, fee?: string) => BigNumber | null | undefined;
|
|
12
|
+
}): Transaction[];
|
|
13
|
+
export default function makeCliTools(): {
|
|
14
|
+
options: ({
|
|
15
|
+
name: string;
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
desc: string;
|
|
18
|
+
} | {
|
|
19
|
+
name: string;
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
desc: string;
|
|
22
|
+
})[];
|
|
23
|
+
inferTransactions: typeof inferTransactions;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/test/cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,SAAS,MAAM,cAAc,CAAC;AAerC,iBAAS,iBAAiB,CACxB,YAAY,EAAE,KAAK,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC,EACF,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACvD,EACE,WAAW,GACZ,EAAE;IAAE,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GACvF,WAAW,EAAE,CASf;AAED,MAAM,CAAC,OAAO,UAAU,YAAY;;;;;;;;;;;EAKnC"}
|
package/lib/test/cli.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = makeCliTools;
|
|
7
|
+
const invariant_1 = __importDefault(require("invariant"));
|
|
8
|
+
const options = [
|
|
9
|
+
{
|
|
10
|
+
name: "fee",
|
|
11
|
+
type: String,
|
|
12
|
+
desc: "how much fee",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "tag",
|
|
16
|
+
type: Number,
|
|
17
|
+
desc: "ripple tag",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
function inferTransactions(transactions, opts, { inferAmount, }) {
|
|
21
|
+
return transactions.flatMap(({ transaction, account }) => {
|
|
22
|
+
(0, invariant_1.default)(transaction.family === "canton", "Canton family");
|
|
23
|
+
return {
|
|
24
|
+
...transaction,
|
|
25
|
+
fee: inferAmount(account, opts.fee || "0.001brp"),
|
|
26
|
+
tag: opts.tag,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function makeCliTools() {
|
|
31
|
+
return {
|
|
32
|
+
options,
|
|
33
|
+
inferTransactions,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/test/cli.ts"],"names":[],"mappings":";;;;;AAsCA,+BAKC;AA3CD,0DAAkC;AAKlC,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,cAAc;KACrB;IACD;QACE,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,YAAY;KACnB;CACF,CAAC;AAEF,SAAS,iBAAiB,CACxB,YAGE,EACF,IAAuD,EACvD,EACE,WAAW,GAC2E;IAExF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;QACvD,IAAA,mBAAS,EAAC,WAAW,CAAC,MAAM,KAAK,QAAQ,EAAE,eAAe,CAAC,CAAC;QAC5D,OAAO;YACL,GAAG,WAAW;YACd,GAAG,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,UAAU,CAAC;YACjD,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAwB,YAAY;IAClC,OAAO;QACL,OAAO;QACP,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,OAAO,CAAC;AAEjC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.makeCliTools = void 0;
|
|
21
|
+
const cli_1 = __importDefault(require("./cli"));
|
|
22
|
+
exports.makeCliTools = cli_1.default;
|
|
23
|
+
__exportStar(require("./bridgeDatasetTest"), exports);
|
|
24
|
+
__exportStar(require("./bot-deviceActions"), exports);
|
|
25
|
+
// export * from "./bot-specs";
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,gDAAiC;AAGxB,uBAHF,aAAY,CAGE;AADrB,sDAAoC;AAEpC,sDAAoC;AACpC,+BAA+B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { TransactionCommon, TransactionCommonRaw, TransactionStatusCommon, TransactionStatusCommonRaw } from "@ledgerhq/types-live";
|
|
3
|
+
export type NetworkInfo = {
|
|
4
|
+
family: "canton";
|
|
5
|
+
serverFee: BigNumber;
|
|
6
|
+
baseReserve: BigNumber;
|
|
7
|
+
};
|
|
8
|
+
export type NetworkInfoRaw = {
|
|
9
|
+
family: "canton";
|
|
10
|
+
serverFee: string;
|
|
11
|
+
baseReserve: string;
|
|
12
|
+
};
|
|
13
|
+
export type Transaction = TransactionCommon & {
|
|
14
|
+
family: "canton";
|
|
15
|
+
fee: BigNumber | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type TransactionRaw = TransactionCommonRaw & {
|
|
18
|
+
family: "canton";
|
|
19
|
+
fee: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type TransactionStatus = TransactionStatusCommon;
|
|
22
|
+
export type TransactionStatusRaw = TransactionStatusCommonRaw;
|
|
23
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/types/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG;IAC5C,MAAM,EAAE,QAAQ,CAAC;IACjB,GAAG,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG;IAClD,MAAM,EAAE,QAAQ,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/types/bridge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;EAA4C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimulationError = void 0;
|
|
4
|
+
const errors_1 = require("@ledgerhq/errors");
|
|
5
|
+
exports.SimulationError = (0, errors_1.createCustomErrorClass)("SimulationError");
|
|
6
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAE7C,QAAA,eAAe,GAAG,IAAA,+BAAsB,EAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./bridge";
|
|
2
|
+
export * from "./signer";
|
|
3
|
+
export type BoilerplateNativeTransaction = {
|
|
4
|
+
TransactionType: "Payment";
|
|
5
|
+
Account: string;
|
|
6
|
+
Amount: string;
|
|
7
|
+
Destination: string;
|
|
8
|
+
Fee: string;
|
|
9
|
+
Sequence: number;
|
|
10
|
+
SigningPubKey?: string;
|
|
11
|
+
TxnSignature?: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,MAAM,MAAM,4BAA4B,GAAG;IACzC,eAAe,EAAE,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./bridge"), exports);
|
|
18
|
+
__exportStar(require("./signer"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BoilerplateAddress = {
|
|
2
|
+
publicKey: string;
|
|
3
|
+
address: string;
|
|
4
|
+
};
|
|
5
|
+
export type BoilerplateSignature = string;
|
|
6
|
+
export interface BoilerplateSigner {
|
|
7
|
+
getAddress(path: string): Promise<BoilerplateAddress>;
|
|
8
|
+
signTransaction(path: string, rawTx: string): Promise<BoilerplateSignature>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/types/signer.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtD,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/types/signer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,oCAAoC,CAAC;AAC5C,OAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAa1D,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAkBzD"}
|