@ledgerhq/coin-aptos 1.4.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +16 -0
- package/CHANGELOG.md +18 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +8 -0
- package/lib/__tests__/api/index.test.d.ts +2 -0
- package/lib/__tests__/api/index.test.d.ts.map +1 -0
- package/lib/__tests__/api/index.test.js +447 -0
- package/lib/__tests__/api/index.test.js.map +1 -0
- package/lib/__tests__/bridge/broadcast.test.d.ts +2 -0
- package/lib/__tests__/bridge/broadcast.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/broadcast.test.js +98 -0
- package/lib/__tests__/bridge/broadcast.test.js.map +1 -0
- package/lib/__tests__/bridge/buildTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/buildTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/buildTransaction.test.js +62 -0
- package/lib/__tests__/bridge/buildTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/createTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/createTransaction.test.js +38 -0
- package/lib/__tests__/bridge/createTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.js +43 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts +2 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.js +84 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.js.map +1 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.js +188 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.d.ts +2 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.js +133 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.js.map +1 -0
- package/lib/__tests__/bridge/index.test.d.ts +2 -0
- package/lib/__tests__/bridge/index.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/index.test.js +116 -0
- package/lib/__tests__/bridge/index.test.js.map +1 -0
- package/lib/__tests__/bridge/logic.test.d.ts +2 -0
- package/lib/__tests__/bridge/logic.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/logic.test.js +773 -0
- package/lib/__tests__/bridge/logic.test.js.map +1 -0
- package/lib/__tests__/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/prepareTransaction.test.js +121 -0
- package/lib/__tests__/bridge/prepareTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/signOperation.test.d.ts +2 -0
- package/lib/__tests__/bridge/signOperation.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/signOperation.test.js +185 -0
- package/lib/__tests__/bridge/signOperation.test.js.map +1 -0
- package/lib/__tests__/bridge/synchronisation.test.d.ts +2 -0
- package/lib/__tests__/bridge/synchronisation.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/synchronisation.test.js +349 -0
- package/lib/__tests__/bridge/synchronisation.test.js.map +1 -0
- package/lib/__tests__/bridge/transaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/transaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/transaction.test.js +231 -0
- package/lib/__tests__/bridge/transaction.test.js.map +1 -0
- package/lib/__tests__/errors.test.d.ts +2 -0
- package/lib/__tests__/errors.test.d.ts.map +1 -0
- package/lib/__tests__/errors.test.js +18 -0
- package/lib/__tests__/errors.test.js.map +1 -0
- package/lib/__tests__/index.test.d.ts +2 -0
- package/lib/__tests__/index.test.d.ts.map +1 -0
- package/lib/__tests__/index.test.js +27 -0
- package/lib/__tests__/index.test.js.map +1 -0
- package/lib/__tests__/network/index.test.d.ts +2 -0
- package/lib/__tests__/network/index.test.d.ts.map +1 -0
- package/lib/__tests__/network/index.test.js +57 -0
- package/lib/__tests__/network/index.test.js.map +1 -0
- package/lib/__tests__/signer/index.test.d.ts +2 -0
- package/lib/__tests__/signer/index.test.d.ts.map +1 -0
- package/lib/__tests__/signer/index.test.js +37 -0
- package/lib/__tests__/signer/index.test.js.map +1 -0
- package/lib/api/graphql/queries.d.ts +5 -0
- package/lib/api/graphql/queries.d.ts.map +1 -0
- package/lib/api/graphql/queries.js +56 -0
- package/lib/api/graphql/queries.js.map +1 -0
- package/lib/api/graphql/types.d.ts +79 -0
- package/lib/api/graphql/types.d.ts.map +1 -0
- package/lib/api/graphql/types.js +3 -0
- package/lib/api/graphql/types.js.map +1 -0
- package/lib/api/index.d.ts +31 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +200 -0
- package/lib/api/index.js.map +1 -0
- package/lib/bridge/bridge.fixture.d.ts +4 -0
- package/lib/bridge/bridge.fixture.d.ts.map +1 -0
- package/lib/bridge/bridge.fixture.js +56 -0
- package/lib/bridge/bridge.fixture.js.map +1 -0
- package/lib/bridge/broadcast.d.ts +7 -0
- package/lib/bridge/broadcast.d.ts.map +1 -0
- package/lib/bridge/broadcast.js +20 -0
- package/lib/bridge/broadcast.js.map +1 -0
- package/lib/bridge/buildTransaction.d.ts +7 -0
- package/lib/bridge/buildTransaction.d.ts.map +1 -0
- package/lib/bridge/buildTransaction.js +28 -0
- package/lib/bridge/buildTransaction.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 +20 -0
- package/lib/bridge/createTransaction.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 +23 -0
- package/lib/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib/bridge/estimateMaxSpendable.d.ts +10 -0
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/estimateMaxSpendable.js +30 -0
- package/lib/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/getFeesForTransaction.d.ts +16 -0
- package/lib/bridge/getFeesForTransaction.d.ts.map +1 -0
- package/lib/bridge/getFeesForTransaction.js +74 -0
- package/lib/bridge/getFeesForTransaction.js.map +1 -0
- package/lib/bridge/getTransactionStatus.d.ts +5 -0
- package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib/bridge/getTransactionStatus.js +48 -0
- package/lib/bridge/getTransactionStatus.js.map +1 -0
- package/lib/bridge/index.d.ts +8 -0
- package/lib/bridge/index.d.ts.map +1 -0
- package/lib/bridge/index.js +54 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge/logic.d.ts +24 -0
- package/lib/bridge/logic.d.ts.map +1 -0
- package/lib/bridge/logic.js +200 -0
- package/lib/bridge/logic.js.map +1 -0
- package/lib/bridge/prepareTransaction.d.ts +5 -0
- package/lib/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib/bridge/prepareTransaction.js +44 -0
- package/lib/bridge/prepareTransaction.js.map +1 -0
- package/lib/bridge/signOperation.d.ts +11 -0
- package/lib/bridge/signOperation.d.ts.map +1 -0
- package/lib/bridge/signOperation.js +77 -0
- package/lib/bridge/signOperation.js.map +1 -0
- package/lib/bridge/synchronisation.d.ts +3 -0
- package/lib/bridge/synchronisation.d.ts.map +1 -0
- package/lib/bridge/synchronisation.js +53 -0
- package/lib/bridge/synchronisation.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 +37 -0
- package/lib/bridge/transaction.js.map +1 -0
- package/lib/constants.d.ts +19 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +33 -0
- package/lib/constants.js.map +1 -0
- package/lib/errors.d.ts +10 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +8 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +3 -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/index.d.ts +6 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +39 -0
- package/lib/network/index.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 +23 -0
- package/lib/signer/index.js.map +1 -0
- package/lib/test/bot-specs.d.ts +7 -0
- package/lib/test/bot-specs.d.ts.map +1 -0
- package/lib/test/bot-specs.js +77 -0
- package/lib/test/bot-specs.js.map +1 -0
- package/lib/test/bridgeDatasetTest.d.ts +4 -0
- package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib/test/bridgeDatasetTest.js +85 -0
- package/lib/test/bridgeDatasetTest.js.map +1 -0
- package/lib/test/cli.d.ts +19 -0
- package/lib/test/cli.d.ts.map +1 -0
- package/lib/test/cli.js +59 -0
- package/lib/test/cli.js.map +1 -0
- package/lib/test/index.d.ts +4 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +20 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/speculos-deviceActions.d.ts +5 -0
- package/lib/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib/test/speculos-deviceActions.js +46 -0
- package/lib/test/speculos-deviceActions.js.map +1 -0
- package/lib/types/bridge.d.ts +5 -0
- package/lib/types/bridge.d.ts.map +1 -0
- package/lib/types/bridge.js +9 -0
- package/lib/types/bridge.js.map +1 -0
- package/lib/types/index.d.ts +62 -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 +27 -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/__tests__/api/index.test.d.ts +2 -0
- package/lib-es/__tests__/api/index.test.d.ts.map +1 -0
- package/lib-es/__tests__/api/index.test.js +442 -0
- package/lib-es/__tests__/api/index.test.js.map +1 -0
- package/lib-es/__tests__/bridge/broadcast.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/broadcast.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/broadcast.test.js +93 -0
- package/lib-es/__tests__/bridge/broadcast.test.js.map +1 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.js +57 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/createTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/createTransaction.test.js +33 -0
- package/lib-es/__tests__/bridge/createTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js +18 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js +79 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js.map +1 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.js +160 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.js +128 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.js.map +1 -0
- package/lib-es/__tests__/bridge/index.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/index.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/index.test.js +111 -0
- package/lib-es/__tests__/bridge/index.test.js.map +1 -0
- package/lib-es/__tests__/bridge/logic.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/logic.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/logic.test.js +768 -0
- package/lib-es/__tests__/bridge/logic.test.js.map +1 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.js +116 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/signOperation.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/signOperation.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/signOperation.test.js +157 -0
- package/lib-es/__tests__/bridge/signOperation.test.js.map +1 -0
- package/lib-es/__tests__/bridge/synchronisation.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/synchronisation.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/synchronisation.test.js +347 -0
- package/lib-es/__tests__/bridge/synchronisation.test.js.map +1 -0
- package/lib-es/__tests__/bridge/transaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/transaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/transaction.test.js +226 -0
- package/lib-es/__tests__/bridge/transaction.test.js.map +1 -0
- package/lib-es/__tests__/errors.test.d.ts +2 -0
- package/lib-es/__tests__/errors.test.d.ts.map +1 -0
- package/lib-es/__tests__/errors.test.js +16 -0
- package/lib-es/__tests__/errors.test.js.map +1 -0
- package/lib-es/__tests__/index.test.d.ts +2 -0
- package/lib-es/__tests__/index.test.d.ts.map +1 -0
- package/lib-es/__tests__/index.test.js +25 -0
- package/lib-es/__tests__/index.test.js.map +1 -0
- package/lib-es/__tests__/network/index.test.d.ts +2 -0
- package/lib-es/__tests__/network/index.test.d.ts.map +1 -0
- package/lib-es/__tests__/network/index.test.js +55 -0
- package/lib-es/__tests__/network/index.test.js.map +1 -0
- package/lib-es/__tests__/signer/index.test.d.ts +2 -0
- package/lib-es/__tests__/signer/index.test.d.ts.map +1 -0
- package/lib-es/__tests__/signer/index.test.js +32 -0
- package/lib-es/__tests__/signer/index.test.js.map +1 -0
- package/lib-es/api/graphql/queries.d.ts +5 -0
- package/lib-es/api/graphql/queries.d.ts.map +1 -0
- package/lib-es/api/graphql/queries.js +53 -0
- package/lib-es/api/graphql/queries.js.map +1 -0
- package/lib-es/api/graphql/types.d.ts +79 -0
- package/lib-es/api/graphql/types.d.ts.map +1 -0
- package/lib-es/api/graphql/types.js +2 -0
- package/lib-es/api/graphql/types.js.map +1 -0
- package/lib-es/api/index.d.ts +31 -0
- package/lib-es/api/index.d.ts.map +1 -0
- package/lib-es/api/index.js +193 -0
- package/lib-es/api/index.js.map +1 -0
- package/lib-es/bridge/bridge.fixture.d.ts +4 -0
- package/lib-es/bridge/bridge.fixture.d.ts.map +1 -0
- package/lib-es/bridge/bridge.fixture.js +48 -0
- package/lib-es/bridge/bridge.fixture.js.map +1 -0
- package/lib-es/bridge/broadcast.d.ts +7 -0
- package/lib-es/bridge/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.js +18 -0
- package/lib-es/bridge/broadcast.js.map +1 -0
- package/lib-es/bridge/buildTransaction.d.ts +7 -0
- package/lib-es/bridge/buildTransaction.d.ts.map +1 -0
- package/lib-es/bridge/buildTransaction.js +26 -0
- package/lib-es/bridge/buildTransaction.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 +15 -0
- package/lib-es/bridge/createTransaction.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/estimateMaxSpendable.d.ts +10 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.js +28 -0
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/getFeesForTransaction.d.ts +16 -0
- package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -0
- package/lib-es/bridge/getFeesForTransaction.js +66 -0
- package/lib-es/bridge/getFeesForTransaction.js.map +1 -0
- package/lib-es/bridge/getTransactionStatus.d.ts +5 -0
- package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/bridge/getTransactionStatus.js +46 -0
- package/lib-es/bridge/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/index.d.ts +8 -0
- package/lib-es/bridge/index.d.ts.map +1 -0
- package/lib-es/bridge/index.js +47 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge/logic.d.ts +24 -0
- package/lib-es/bridge/logic.d.ts.map +1 -0
- package/lib-es/bridge/logic.js +183 -0
- package/lib-es/bridge/logic.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.d.ts +5 -0
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib-es/bridge/prepareTransaction.js +39 -0
- package/lib-es/bridge/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts +11 -0
- package/lib-es/bridge/signOperation.d.ts.map +1 -0
- package/lib-es/bridge/signOperation.js +70 -0
- package/lib-es/bridge/signOperation.js.map +1 -0
- package/lib-es/bridge/synchronisation.d.ts +3 -0
- package/lib-es/bridge/synchronisation.d.ts.map +1 -0
- package/lib-es/bridge/synchronisation.js +49 -0
- package/lib-es/bridge/synchronisation.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 +31 -0
- package/lib-es/bridge/transaction.js.map +1 -0
- package/lib-es/constants.d.ts +19 -0
- package/lib-es/constants.d.ts.map +1 -0
- package/lib-es/constants.js +30 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/errors.d.ts +10 -0
- package/lib-es/errors.d.ts.map +1 -0
- package/lib-es/errors.js +5 -0
- package/lib-es/errors.js.map +1 -0
- package/lib-es/index.d.ts +3 -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/index.d.ts +6 -0
- package/lib-es/network/index.d.ts.map +1 -0
- package/lib-es/network/index.js +35 -0
- package/lib-es/network/index.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 +21 -0
- package/lib-es/signer/index.js.map +1 -0
- package/lib-es/test/bot-specs.d.ts +7 -0
- package/lib-es/test/bot-specs.d.ts.map +1 -0
- package/lib-es/test/bot-specs.js +72 -0
- package/lib-es/test/bot-specs.js.map +1 -0
- package/lib-es/test/bridgeDatasetTest.d.ts +4 -0
- package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib-es/test/bridgeDatasetTest.js +79 -0
- package/lib-es/test/bridgeDatasetTest.js.map +1 -0
- package/lib-es/test/cli.d.ts +19 -0
- package/lib-es/test/cli.d.ts.map +1 -0
- package/lib-es/test/cli.js +53 -0
- package/lib-es/test/cli.js.map +1 -0
- package/lib-es/test/index.d.ts +4 -0
- package/lib-es/test/index.d.ts.map +1 -0
- package/lib-es/test/index.js +4 -0
- package/lib-es/test/index.js.map +1 -0
- package/lib-es/test/speculos-deviceActions.d.ts +5 -0
- package/lib-es/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib-es/test/speculos-deviceActions.js +43 -0
- package/lib-es/test/speculos-deviceActions.js.map +1 -0
- package/lib-es/types/bridge.d.ts +5 -0
- package/lib-es/types/bridge.d.ts.map +1 -0
- package/lib-es/types/bridge.js +6 -0
- package/lib-es/types/bridge.js.map +1 -0
- package/lib-es/types/index.d.ts +62 -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 +27 -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 +124 -0
- package/src/__tests__/api/index.test.ts +499 -0
- package/src/__tests__/bridge/broadcast.test.ts +98 -0
- package/src/__tests__/bridge/buildTransaction.test.ts +61 -0
- package/src/__tests__/bridge/createTransaction.test.ts +27 -0
- package/src/__tests__/bridge/deviceTransactionConfig.test.ts +19 -0
- package/src/__tests__/bridge/estimateMaxSpendable.test.ts +94 -0
- package/src/__tests__/bridge/getFeesForTransaction.test.ts +189 -0
- package/src/__tests__/bridge/getTransactionStatus.test.ts +155 -0
- package/src/__tests__/bridge/index.test.ts +108 -0
- package/src/__tests__/bridge/logic.test.ts +876 -0
- package/src/__tests__/bridge/prepareTransaction.test.ts +118 -0
- package/src/__tests__/bridge/signOperation.test.ts +178 -0
- package/src/__tests__/bridge/synchronisation.test.ts +374 -0
- package/src/__tests__/bridge/transaction.test.ts +261 -0
- package/src/__tests__/errors.test.ts +25 -0
- package/src/__tests__/index.test.ts +26 -0
- package/src/__tests__/network/index.test.ts +95 -0
- package/src/__tests__/signer/index.test.ts +24 -0
- package/src/api/graphql/queries.ts +53 -0
- package/src/api/graphql/types.ts +85 -0
- package/src/api/index.ts +224 -0
- package/src/bridge/bridge.fixture.ts +53 -0
- package/src/bridge/broadcast.ts +17 -0
- package/src/bridge/buildTransaction.ts +29 -0
- package/src/bridge/createTransaction.ts +17 -0
- package/src/bridge/deviceTransactionConfig.ts +30 -0
- package/src/bridge/estimateMaxSpendable.ts +35 -0
- package/src/bridge/getFeesForTransaction.ts +87 -0
- package/src/bridge/getTransactionStatus.ts +54 -0
- package/src/bridge/index.ts +65 -0
- package/src/bridge/logic.ts +265 -0
- package/src/bridge/prepareTransaction.ts +55 -0
- package/src/bridge/signOperation.ts +82 -0
- package/src/bridge/synchronisation.ts +50 -0
- package/src/bridge/transaction.ts +61 -0
- package/src/constants.ts +34 -0
- package/src/errors.ts +7 -0
- package/src/index.ts +3 -0
- package/src/network/index.ts +54 -0
- package/src/signer/index.ts +17 -0
- package/src/test/bot-specs.ts +86 -0
- package/src/test/bridgeDatasetTest.ts +82 -0
- package/src/test/cli.ts +80 -0
- package/src/test/index.ts +3 -0
- package/src/test/speculos-deviceActions.ts +52 -0
- package/src/types/bridge.ts +4 -0
- package/src/types/index.ts +74 -0
- package/src/types/signer.ts +26 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { createFixtureAccount, createFixtureTransaction } from "../../bridge/bridge.fixture";
|
|
3
|
+
import { formatTransaction, fromTransactionRaw, toTransactionRaw } from "../../bridge/transaction";
|
|
4
|
+
import { Transaction, TransactionRaw } from "../../types";
|
|
5
|
+
|
|
6
|
+
describe("transaction Test", () => {
|
|
7
|
+
describe("when formatTransaction", () => {
|
|
8
|
+
describe("when amount is 0 and fee is 0", () => {
|
|
9
|
+
it("should return a transaction SEND to 0xff00 with fees=?", async () => {
|
|
10
|
+
const account = createFixtureAccount();
|
|
11
|
+
const transaction = createFixtureTransaction();
|
|
12
|
+
|
|
13
|
+
transaction.recipient = "0xff00";
|
|
14
|
+
const result = formatTransaction(transaction, account);
|
|
15
|
+
|
|
16
|
+
const expected = `
|
|
17
|
+
SEND
|
|
18
|
+
TO 0xff00
|
|
19
|
+
with fees=?`;
|
|
20
|
+
|
|
21
|
+
expect(result).toBe(expected);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe("when amount is 0 and fee is 0.0001", () => {
|
|
26
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
27
|
+
const account = createFixtureAccount();
|
|
28
|
+
const transaction = createFixtureTransaction();
|
|
29
|
+
|
|
30
|
+
transaction.recipient = "0xff00";
|
|
31
|
+
transaction.fees = BigNumber("0.0001");
|
|
32
|
+
const result = formatTransaction(transaction, account);
|
|
33
|
+
|
|
34
|
+
const expected = `
|
|
35
|
+
SEND
|
|
36
|
+
TO 0xff00
|
|
37
|
+
with fees=0`;
|
|
38
|
+
|
|
39
|
+
expect(result).toBe(expected);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("when amount is 0 and fee is 0.1", () => {
|
|
44
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
45
|
+
const account = createFixtureAccount();
|
|
46
|
+
const transaction = createFixtureTransaction();
|
|
47
|
+
|
|
48
|
+
transaction.recipient = "0xff00";
|
|
49
|
+
transaction.fees = BigNumber("0.1");
|
|
50
|
+
const result = formatTransaction(transaction, account);
|
|
51
|
+
|
|
52
|
+
const expected = `
|
|
53
|
+
SEND
|
|
54
|
+
TO 0xff00
|
|
55
|
+
with fees=0`;
|
|
56
|
+
|
|
57
|
+
expect(result).toBe(expected);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe("when amount is 1 and fee is 0.1", () => {
|
|
62
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
63
|
+
const account = createFixtureAccount();
|
|
64
|
+
const transaction = createFixtureTransaction();
|
|
65
|
+
|
|
66
|
+
transaction.amount = BigNumber("1");
|
|
67
|
+
transaction.recipient = "0xff00";
|
|
68
|
+
transaction.fees = BigNumber("0.1");
|
|
69
|
+
const result = formatTransaction(transaction, account);
|
|
70
|
+
|
|
71
|
+
const expected = `
|
|
72
|
+
SEND 0.00000001
|
|
73
|
+
TO 0xff00
|
|
74
|
+
with fees=0`;
|
|
75
|
+
|
|
76
|
+
expect(result).toBe(expected);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe("when amount is 10 and fee is 1", () => {
|
|
81
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
82
|
+
const account = createFixtureAccount();
|
|
83
|
+
const transaction = createFixtureTransaction();
|
|
84
|
+
|
|
85
|
+
transaction.amount = BigNumber("10");
|
|
86
|
+
transaction.recipient = "0xff00";
|
|
87
|
+
transaction.fees = BigNumber("1");
|
|
88
|
+
const result = formatTransaction(transaction, account);
|
|
89
|
+
|
|
90
|
+
const expected = `
|
|
91
|
+
SEND 0.0000001
|
|
92
|
+
TO 0xff00
|
|
93
|
+
with fees=0.00000001`;
|
|
94
|
+
|
|
95
|
+
expect(result).toBe(expected);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe("when amount is 1000 and fee is 1", () => {
|
|
100
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
101
|
+
const account = createFixtureAccount();
|
|
102
|
+
const transaction = createFixtureTransaction();
|
|
103
|
+
|
|
104
|
+
transaction.amount = BigNumber("1000");
|
|
105
|
+
transaction.recipient = "0xff00";
|
|
106
|
+
transaction.fees = BigNumber("1");
|
|
107
|
+
const result = formatTransaction(transaction, account);
|
|
108
|
+
|
|
109
|
+
const expected = `
|
|
110
|
+
SEND 0.00001
|
|
111
|
+
TO 0xff00
|
|
112
|
+
with fees=0.00000001`;
|
|
113
|
+
|
|
114
|
+
expect(result).toBe(expected);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe("when using MAX with amount is 1000 and fee is 1", () => {
|
|
119
|
+
it("should return a transaction SEND to 0xff00 with fees=0", async () => {
|
|
120
|
+
const account = createFixtureAccount();
|
|
121
|
+
const transaction = createFixtureTransaction();
|
|
122
|
+
|
|
123
|
+
transaction.amount = BigNumber("1000");
|
|
124
|
+
transaction.useAllAmount = true;
|
|
125
|
+
transaction.recipient = "0xff00";
|
|
126
|
+
transaction.fees = BigNumber("1");
|
|
127
|
+
const result = formatTransaction(transaction, account);
|
|
128
|
+
|
|
129
|
+
const expected = `
|
|
130
|
+
SEND MAX
|
|
131
|
+
TO 0xff00
|
|
132
|
+
with fees=0.00000001`;
|
|
133
|
+
|
|
134
|
+
expect(result).toBe(expected);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe("when fromTransactionRaw", () => {
|
|
140
|
+
it("should return the transaction object", () => {
|
|
141
|
+
const txRaw = {
|
|
142
|
+
family: "aptos",
|
|
143
|
+
mode: "send",
|
|
144
|
+
options: "{}",
|
|
145
|
+
amount: "0.5",
|
|
146
|
+
recipient: "0xff00",
|
|
147
|
+
useAllAmount: false,
|
|
148
|
+
subAccountId: "0xff01",
|
|
149
|
+
recipientDomain: {},
|
|
150
|
+
} as TransactionRaw;
|
|
151
|
+
|
|
152
|
+
const result = fromTransactionRaw(txRaw);
|
|
153
|
+
|
|
154
|
+
const expected = {
|
|
155
|
+
family: "aptos",
|
|
156
|
+
amount: BigNumber("0.5"),
|
|
157
|
+
options: {},
|
|
158
|
+
mode: "send",
|
|
159
|
+
recipient: "0xff00",
|
|
160
|
+
recipientDomain: {},
|
|
161
|
+
subAccountId: "0xff01",
|
|
162
|
+
useAllAmount: false,
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
expect(result).toEqual(expected);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("should return the transaction object with fees and errors", () => {
|
|
169
|
+
const txRaw = {
|
|
170
|
+
family: "aptos",
|
|
171
|
+
mode: "send",
|
|
172
|
+
fees: "50",
|
|
173
|
+
errors: '{ "errors": "error" }',
|
|
174
|
+
options: "{}",
|
|
175
|
+
amount: "0.5",
|
|
176
|
+
recipient: "0xff00",
|
|
177
|
+
useAllAmount: false,
|
|
178
|
+
subAccountId: "0xff01",
|
|
179
|
+
recipientDomain: {},
|
|
180
|
+
} as TransactionRaw;
|
|
181
|
+
|
|
182
|
+
const result = fromTransactionRaw(txRaw);
|
|
183
|
+
|
|
184
|
+
const expected = {
|
|
185
|
+
family: "aptos",
|
|
186
|
+
amount: BigNumber("0.5"),
|
|
187
|
+
fees: BigNumber(50),
|
|
188
|
+
errors: { errors: "error" },
|
|
189
|
+
options: {},
|
|
190
|
+
mode: "send",
|
|
191
|
+
recipient: "0xff00",
|
|
192
|
+
recipientDomain: {},
|
|
193
|
+
subAccountId: "0xff01",
|
|
194
|
+
useAllAmount: false,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
expect(result).toEqual(expected);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
describe("when toTransactionRaw", () => {
|
|
202
|
+
it("should return the raw transaction object", () => {
|
|
203
|
+
const tx = {
|
|
204
|
+
family: "aptos",
|
|
205
|
+
amount: BigNumber("0.5"),
|
|
206
|
+
options: {},
|
|
207
|
+
mode: "send",
|
|
208
|
+
recipient: "0xff00",
|
|
209
|
+
recipientDomain: {},
|
|
210
|
+
subAccountId: "0xff01",
|
|
211
|
+
useAllAmount: false,
|
|
212
|
+
} as Transaction;
|
|
213
|
+
|
|
214
|
+
const result = toTransactionRaw(tx);
|
|
215
|
+
|
|
216
|
+
const expected = {
|
|
217
|
+
family: "aptos",
|
|
218
|
+
mode: "send",
|
|
219
|
+
fees: null,
|
|
220
|
+
options: "{}",
|
|
221
|
+
amount: "0.5",
|
|
222
|
+
recipient: "0xff00",
|
|
223
|
+
useAllAmount: false,
|
|
224
|
+
subAccountId: "0xff01",
|
|
225
|
+
recipientDomain: {},
|
|
226
|
+
} as TransactionRaw;
|
|
227
|
+
|
|
228
|
+
expect(result).toEqual(expected);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("should return the raw transaction object with fees", () => {
|
|
232
|
+
const tx = {
|
|
233
|
+
family: "aptos",
|
|
234
|
+
amount: BigNumber("0.5"),
|
|
235
|
+
options: {},
|
|
236
|
+
fees: BigNumber("0.1"),
|
|
237
|
+
mode: "send",
|
|
238
|
+
recipient: "0xff00",
|
|
239
|
+
recipientDomain: {},
|
|
240
|
+
subAccountId: "0xff01",
|
|
241
|
+
useAllAmount: false,
|
|
242
|
+
} as Transaction;
|
|
243
|
+
|
|
244
|
+
const result = toTransactionRaw(tx);
|
|
245
|
+
|
|
246
|
+
const expected = {
|
|
247
|
+
family: "aptos",
|
|
248
|
+
mode: "send",
|
|
249
|
+
fees: "0.1",
|
|
250
|
+
options: "{}",
|
|
251
|
+
amount: "0.5",
|
|
252
|
+
recipient: "0xff00",
|
|
253
|
+
useAllAmount: false,
|
|
254
|
+
subAccountId: "0xff01",
|
|
255
|
+
recipientDomain: {},
|
|
256
|
+
} as TransactionRaw;
|
|
257
|
+
|
|
258
|
+
expect(result).toEqual(expected);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SequenceNumberTooOldError,
|
|
3
|
+
SequenceNumberTooNewError,
|
|
4
|
+
TransactionExpiredError,
|
|
5
|
+
} from "../errors";
|
|
6
|
+
|
|
7
|
+
describe("APTOS errors", () => {
|
|
8
|
+
it("should create the SequenceNumberTooOldError error", () => {
|
|
9
|
+
const error = new SequenceNumberTooOldError();
|
|
10
|
+
|
|
11
|
+
expect(error).toBeInstanceOf(Error);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should create the SequenceNumberTooNewError error", () => {
|
|
15
|
+
const error = new SequenceNumberTooNewError();
|
|
16
|
+
|
|
17
|
+
expect(error).toBeInstanceOf(Error);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should create the TransactionExpiredError error", () => {
|
|
21
|
+
const error = new TransactionExpiredError();
|
|
22
|
+
|
|
23
|
+
expect(error).toBeInstanceOf(Error);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
jest.mock("@ledgerhq/coin-framework/bridge/getAddressWrapper", () => jest.fn());
|
|
2
|
+
jest.mock("@ledgerhq/coin-framework/signer", () => jest.fn());
|
|
3
|
+
jest.mock("@ledgerhq/types-live", () => jest.fn());
|
|
4
|
+
jest.mock("@ledgerhq/coin-framework/bridge/jsHelpers", () => ({
|
|
5
|
+
makeAccountBridgeReceive: jest.fn(),
|
|
6
|
+
makeScanAccounts: jest.fn(),
|
|
7
|
+
getSerializedAddressParameters: jest.fn(),
|
|
8
|
+
makeSync: jest.fn(),
|
|
9
|
+
}));
|
|
10
|
+
jest.mock("../signer", () => jest.fn());
|
|
11
|
+
jest.mock("../types", () => jest.fn());
|
|
12
|
+
jest.mock("../bridge/getTransactionStatus", () => jest.fn());
|
|
13
|
+
jest.mock("../bridge/estimateMaxSpendable", () => jest.fn());
|
|
14
|
+
jest.mock("../bridge/prepareTransaction", () => jest.fn());
|
|
15
|
+
jest.mock("../bridge/createTransaction", () => jest.fn());
|
|
16
|
+
jest.mock("../bridge/synchronisation", () => jest.fn());
|
|
17
|
+
jest.mock("../bridge/signOperation", () => jest.fn());
|
|
18
|
+
jest.mock("../bridge/broadcast", () => jest.fn());
|
|
19
|
+
|
|
20
|
+
import { createBridges } from "../bridge";
|
|
21
|
+
|
|
22
|
+
describe("APTOS index", () => {
|
|
23
|
+
it("should export a function createBridges", () => {
|
|
24
|
+
expect(typeof createBridges).toBe("function");
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { signTransaction } from "../../network";
|
|
2
|
+
import { createFixtureAccount } from "../../bridge/bridge.fixture";
|
|
3
|
+
import {
|
|
4
|
+
AccountAddress,
|
|
5
|
+
ChainId,
|
|
6
|
+
RawTransaction,
|
|
7
|
+
Serializable,
|
|
8
|
+
generateSigningMessageForTransaction,
|
|
9
|
+
generateSignedTransaction,
|
|
10
|
+
} from "@aptos-labs/ts-sdk";
|
|
11
|
+
|
|
12
|
+
jest.mock("@aptos-labs/ts-sdk", () => {
|
|
13
|
+
const originalModule = jest.requireActual("@aptos-labs/ts-sdk");
|
|
14
|
+
const partialMockedModule = Object.keys(originalModule).reduce(
|
|
15
|
+
(pre: { [key: string]: jest.Mock }, methodName) => {
|
|
16
|
+
pre[methodName] = jest.fn();
|
|
17
|
+
return pre;
|
|
18
|
+
},
|
|
19
|
+
{} as { [key: string]: jest.Mock },
|
|
20
|
+
);
|
|
21
|
+
return {
|
|
22
|
+
...partialMockedModule,
|
|
23
|
+
// mock all except these
|
|
24
|
+
AccountAddress: originalModule.AccountAddress,
|
|
25
|
+
Hex: originalModule.Hex,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
let mockedGenerateSigningMessageForTransaction: jest.Mocked<any>;
|
|
29
|
+
let mockedGenerateSignedTransaction: jest.Mocked<any>;
|
|
30
|
+
|
|
31
|
+
describe("signTransaction", () => {
|
|
32
|
+
beforeAll(() => {
|
|
33
|
+
mockedGenerateSigningMessageForTransaction = jest.mocked(generateSigningMessageForTransaction);
|
|
34
|
+
mockedGenerateSignedTransaction = jest.mocked(generateSignedTransaction);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
afterEach(() => {
|
|
38
|
+
jest.resetAllMocks();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should throw an error", async () => {
|
|
42
|
+
mockedGenerateSigningMessageForTransaction.mockReturnValue("signingMessage");
|
|
43
|
+
|
|
44
|
+
const mockGenerateSignedTransactionSpy = jest.spyOn(
|
|
45
|
+
{ generateSignedTransaction: mockedGenerateSignedTransaction },
|
|
46
|
+
"generateSignedTransaction",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const signerContext = jest.fn().mockImplementation(() => ({ signature: "0x7aa193705193f4" }));
|
|
50
|
+
const account = createFixtureAccount();
|
|
51
|
+
const deviceId = "nanoX";
|
|
52
|
+
const rawTxn = new RawTransaction(
|
|
53
|
+
new AccountAddress(Uint8Array.from(Buffer.from("thisaddressmustbe32byteslooooong"))),
|
|
54
|
+
BigInt(1),
|
|
55
|
+
"" as unknown as Serializable,
|
|
56
|
+
BigInt(100),
|
|
57
|
+
BigInt(50),
|
|
58
|
+
BigInt(1),
|
|
59
|
+
{ chainId: 1 } as ChainId,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
expect(signTransaction(signerContext, account, deviceId, rawTxn)).rejects.toThrow(
|
|
63
|
+
"Account must have a public signing key",
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(mockGenerateSignedTransactionSpy).toHaveBeenCalledTimes(0);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should sign a transaction", async () => {
|
|
70
|
+
mockedGenerateSigningMessageForTransaction.mockReturnValue("signingMessage");
|
|
71
|
+
|
|
72
|
+
const mockGenerateSignedTransactionSpy = jest.spyOn(
|
|
73
|
+
{ generateSignedTransaction: mockedGenerateSignedTransaction },
|
|
74
|
+
"generateSignedTransaction",
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const signerContext = jest.fn().mockImplementation(() => ({ signature: "0x7aa193705193f4" }));
|
|
78
|
+
const account = createFixtureAccount();
|
|
79
|
+
account.xpub = "0xb69a68cc64f7aa193705193f4dd598320a0a74baf7e4b50c9980c5bd60a82390";
|
|
80
|
+
const deviceId = "nanoX";
|
|
81
|
+
const rawTxn = new RawTransaction(
|
|
82
|
+
AccountAddress.fromString(account.xpub),
|
|
83
|
+
BigInt(1),
|
|
84
|
+
"" as unknown as Serializable,
|
|
85
|
+
BigInt(100),
|
|
86
|
+
BigInt(50),
|
|
87
|
+
BigInt(1),
|
|
88
|
+
{ chainId: 1 } as ChainId,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
await signTransaction(signerContext, account, deviceId, rawTxn);
|
|
92
|
+
|
|
93
|
+
expect(mockGenerateSignedTransactionSpy).toHaveBeenCalledTimes(1);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
2
|
+
import resolver from "../../signer";
|
|
3
|
+
|
|
4
|
+
describe("aptos signer", () => {
|
|
5
|
+
test("getAddress", async () => {
|
|
6
|
+
const getAddress = resolver(
|
|
7
|
+
async () =>
|
|
8
|
+
({
|
|
9
|
+
address: "address",
|
|
10
|
+
publicKey: Buffer.from("publicKey"),
|
|
11
|
+
}) as any,
|
|
12
|
+
);
|
|
13
|
+
const result = await getAddress("deviceId", {
|
|
14
|
+
path: "path",
|
|
15
|
+
currency: getCryptoCurrencyById("aptos"),
|
|
16
|
+
derivationMode: "",
|
|
17
|
+
});
|
|
18
|
+
expect(result).toMatchObject({
|
|
19
|
+
address: "address",
|
|
20
|
+
publicKey: "7075626c69634b6579",
|
|
21
|
+
path: "path",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { gql } from "@apollo/client";
|
|
2
|
+
|
|
3
|
+
export const GetDelegatedStakingActivities = gql`
|
|
4
|
+
query getDelegatedStakingActivities($delegatorAddress: String) {
|
|
5
|
+
delegated_staking_activities(
|
|
6
|
+
where: { delegator_address: { _eq: $delegatorAddress } }
|
|
7
|
+
order_by: { transaction_version: asc }
|
|
8
|
+
) {
|
|
9
|
+
amount
|
|
10
|
+
delegator_address
|
|
11
|
+
event_index
|
|
12
|
+
event_type
|
|
13
|
+
pool_address
|
|
14
|
+
transaction_version
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
export const GetAccountTransactionsData = gql`
|
|
19
|
+
query GetAccountTransactionsData($address: String, $limit: Int) {
|
|
20
|
+
address_version_from_move_resources(
|
|
21
|
+
where: { address: { _eq: $address } }
|
|
22
|
+
order_by: { transaction_version: desc }
|
|
23
|
+
limit: $limit
|
|
24
|
+
) {
|
|
25
|
+
transaction_version
|
|
26
|
+
__typename
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
export const GetAccountTransactionsDataGt = gql`
|
|
31
|
+
query GetAccountTransactionsDataGt($address: String, $limit: Int, $gt: bigint) {
|
|
32
|
+
address_version_from_move_resources(
|
|
33
|
+
where: { address: { _eq: $address }, transaction_version: { _gt: $gt } }
|
|
34
|
+
order_by: { transaction_version: desc }
|
|
35
|
+
limit: $limit
|
|
36
|
+
) {
|
|
37
|
+
transaction_version
|
|
38
|
+
__typename
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
export const GetAccountTransactionsDataLt = gql`
|
|
43
|
+
query GetAccountTransactionsDataLt($address: String, $limit: Int, $lt: bigint) {
|
|
44
|
+
address_version_from_move_resources(
|
|
45
|
+
where: { address: { _eq: $address }, transaction_version: { _lt: $lt } }
|
|
46
|
+
order_by: { transaction_version: desc }
|
|
47
|
+
limit: $limit
|
|
48
|
+
) {
|
|
49
|
+
transaction_version
|
|
50
|
+
__typename
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
4
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
5
|
+
export type Scalars = {
|
|
6
|
+
ID: string;
|
|
7
|
+
String: string;
|
|
8
|
+
Boolean: boolean;
|
|
9
|
+
Int: number;
|
|
10
|
+
Float: number;
|
|
11
|
+
bigint: any;
|
|
12
|
+
jsonb: any;
|
|
13
|
+
numeric: any;
|
|
14
|
+
timestamp: any;
|
|
15
|
+
timestamptz: any;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type GetAccountTransactionsDataQueryVariables = Exact<{
|
|
19
|
+
address?: InputMaybe<Scalars["String"]>;
|
|
20
|
+
limit?: InputMaybe<Scalars["Int"]>;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
export type GetAccountTransactionsDataQuery = {
|
|
24
|
+
__typename?: "query_root";
|
|
25
|
+
address_version_from_move_resources: Array<{
|
|
26
|
+
__typename: "address_version_from_move_resources";
|
|
27
|
+
transaction_version?: any | null;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type GetAccountTransactionsDataGtQueryVariables = Exact<{
|
|
32
|
+
address?: InputMaybe<Scalars["String"]>;
|
|
33
|
+
limit?: InputMaybe<Scalars["Int"]>;
|
|
34
|
+
gt?: InputMaybe<Scalars["bigint"]>;
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
export type GetAccountTransactionsDataGtQuery = {
|
|
38
|
+
__typename?: "query_root";
|
|
39
|
+
address_version_from_move_resources: Array<{
|
|
40
|
+
__typename: "address_version_from_move_resources";
|
|
41
|
+
transaction_version?: any | null;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type GetAccountTransactionsDataLtQueryVariables = Exact<{
|
|
46
|
+
address?: InputMaybe<Scalars["String"]>;
|
|
47
|
+
limit?: InputMaybe<Scalars["Int"]>;
|
|
48
|
+
lt?: InputMaybe<Scalars["bigint"]>;
|
|
49
|
+
}>;
|
|
50
|
+
|
|
51
|
+
export type GetAccountTransactionsDataLtQuery = {
|
|
52
|
+
__typename?: "query_root";
|
|
53
|
+
address_version_from_move_resources: Array<{
|
|
54
|
+
__typename: "address_version_from_move_resources";
|
|
55
|
+
transaction_version?: any | null;
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type DelegatedStakingActivity = {
|
|
60
|
+
amount: number;
|
|
61
|
+
delegator_address: string;
|
|
62
|
+
event_index: number;
|
|
63
|
+
event_type: string;
|
|
64
|
+
pool_address: string;
|
|
65
|
+
transaction_version: bigint;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type GetDelegatedStakingActivitiesQuery = {
|
|
69
|
+
delegated_staking_activities: Array<DelegatedStakingActivity>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type PartitionedDelegatedStakingActivities = Record<string, DelegatedStakingActivity[]>;
|
|
73
|
+
|
|
74
|
+
export type StakePrincipals = {
|
|
75
|
+
activePrincipals: number;
|
|
76
|
+
pendingInactivePrincipals: number;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type StakeDetails = {
|
|
80
|
+
active: number;
|
|
81
|
+
inactive: number;
|
|
82
|
+
pendingInactive: number;
|
|
83
|
+
canWithdrawPendingInactive: boolean;
|
|
84
|
+
poolAddress: string;
|
|
85
|
+
};
|