@ledgerhq/coin-aptos 2.0.0 → 2.1.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/CHANGELOG.md +14 -0
- package/lib/__tests__/api/craftTransaction.unit.test.d.ts +2 -0
- package/lib/__tests__/api/craftTransaction.unit.test.d.ts.map +1 -0
- package/lib/__tests__/api/craftTransaction.unit.test.js +187 -0
- package/lib/__tests__/api/craftTransaction.unit.test.js.map +1 -0
- package/lib/__tests__/api/getBalance.unit.test.d.ts +2 -0
- package/lib/__tests__/api/getBalance.unit.test.d.ts.map +1 -0
- package/lib/__tests__/api/getBalance.unit.test.js +41 -0
- package/lib/__tests__/api/getBalance.unit.test.js.map +1 -0
- package/lib/__tests__/api/index.integ.test.js +276 -9
- package/lib/__tests__/api/index.integ.test.js.map +1 -1
- package/lib/__tests__/api/index.test.js +1 -1
- package/lib/__tests__/api/index.test.js.map +1 -1
- package/lib/__tests__/bridge/logic.test.js +8 -558
- package/lib/__tests__/bridge/logic.test.js.map +1 -1
- package/lib/__tests__/bridge/signOperation.test.js +7 -11
- package/lib/__tests__/bridge/signOperation.test.js.map +1 -1
- package/lib/__tests__/index.test.js +1 -1
- package/lib/__tests__/index.test.js.map +1 -1
- package/lib/__tests__/logic/buildTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/{bridge → logic}/buildTransaction.test.js +14 -8
- package/lib/__tests__/logic/buildTransaction.test.js.map +1 -0
- package/lib/__tests__/logic/calculateAmount.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/calculateAmount.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/calculateAmount.unit.test.js +45 -0
- package/lib/__tests__/logic/calculateAmount.unit.test.js.map +1 -0
- package/lib/__tests__/logic/combine.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/combine.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/combine.unit.test.js +47 -0
- package/lib/__tests__/logic/combine.unit.test.js.map +1 -0
- package/lib/__tests__/logic/compareAddress.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/compareAddress.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/compareAddress.unit.test.js +26 -0
- package/lib/__tests__/logic/compareAddress.unit.test.js.map +1 -0
- package/lib/__tests__/logic/createTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/{bridge → logic}/createTransaction.test.js +1 -1
- package/lib/__tests__/logic/createTransaction.test.js.map +1 -0
- package/lib/__tests__/logic/getCoinAndAmounts.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/getCoinAndAmounts.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/getCoinAndAmounts.unit.test.js +186 -0
- package/lib/__tests__/logic/getCoinAndAmounts.unit.test.js.map +1 -0
- package/lib/__tests__/logic/getFunctionAddress.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/getFunctionAddress.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/getFunctionAddress.unit.test.js +29 -0
- package/lib/__tests__/logic/getFunctionAddress.unit.test.js.map +1 -0
- package/lib/__tests__/logic/getResourceAddress.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/getResourceAddress.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/getResourceAddress.unit.test.js +218 -0
- package/lib/__tests__/logic/getResourceAddress.unit.test.js.map +1 -0
- package/lib/__tests__/logic/isTestnet.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/isTestnet.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/isTestnet.unit.test.js +12 -0
- package/lib/__tests__/logic/isTestnet.unit.test.js.map +1 -0
- package/lib/__tests__/logic/normalizeAddress.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/normalizeAddress.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/normalizeAddress.unit.test.js +12 -0
- package/lib/__tests__/logic/normalizeAddress.unit.test.js.map +1 -0
- package/lib/__tests__/logic/processRecipients.unit.test.d.ts +2 -0
- package/lib/__tests__/logic/processRecipients.unit.test.d.ts.map +1 -0
- package/lib/__tests__/logic/processRecipients.unit.test.js +79 -0
- package/lib/__tests__/logic/processRecipients.unit.test.js.map +1 -0
- package/lib/__tests__/network/client.test.js +613 -9
- package/lib/__tests__/network/client.test.js.map +1 -1
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js +7 -12
- package/lib/api/index.js.map +1 -1
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/getFeesForTransaction.d.ts.map +1 -1
- package/lib/bridge/getFeesForTransaction.js +1 -1
- package/lib/bridge/getFeesForTransaction.js.map +1 -1
- package/lib/bridge/index.js +1 -1
- package/lib/bridge/index.js.map +1 -1
- package/lib/bridge/logic.d.ts +1 -17
- package/lib/bridge/logic.d.ts.map +1 -1
- package/lib/bridge/logic.js +12 -204
- package/lib/bridge/logic.js.map +1 -1
- package/lib/bridge/prepareTransaction.js +1 -1
- package/lib/bridge/prepareTransaction.js.map +1 -1
- package/lib/bridge/signOperation.d.ts.map +1 -1
- package/lib/bridge/signOperation.js +1 -1
- package/lib/bridge/signOperation.js.map +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/constants.d.ts +7 -4
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +8 -4
- package/lib/constants.js.map +1 -1
- package/lib/logic/buildTransaction.d.ts +9 -0
- package/lib/logic/buildTransaction.d.ts.map +1 -0
- package/lib/logic/buildTransaction.js +47 -0
- package/lib/logic/buildTransaction.js.map +1 -0
- package/lib/logic/calculateAmount.d.ts +3 -0
- package/lib/logic/calculateAmount.d.ts.map +1 -0
- package/lib/logic/calculateAmount.js +13 -0
- package/lib/logic/calculateAmount.js.map +1 -0
- package/lib/logic/combine.d.ts +4 -0
- package/lib/logic/combine.d.ts.map +1 -0
- package/lib/logic/combine.js +34 -0
- package/lib/logic/combine.js.map +1 -0
- package/lib/logic/craftTransaction.d.ts +5 -0
- package/lib/logic/craftTransaction.d.ts.map +1 -0
- package/lib/logic/craftTransaction.js +68 -0
- package/lib/logic/craftTransaction.js.map +1 -0
- package/lib/logic/createTransaction.d.ts.map +1 -0
- package/lib/logic/createTransaction.js.map +1 -0
- package/lib/logic/getBalance.d.ts +5 -0
- package/lib/logic/getBalance.d.ts.map +1 -0
- package/lib/logic/getBalance.js +12 -0
- package/lib/logic/getBalance.js.map +1 -0
- package/lib/logic/getCoinAndAmounts.d.ts +13 -0
- package/lib/logic/getCoinAndAmounts.d.ts.map +1 -0
- package/lib/logic/getCoinAndAmounts.js +112 -0
- package/lib/logic/getCoinAndAmounts.js.map +1 -0
- package/lib/logic/getFunctionAddress.d.ts +3 -0
- package/lib/logic/getFunctionAddress.d.ts.map +1 -0
- package/lib/logic/getFunctionAddress.js +12 -0
- package/lib/logic/getFunctionAddress.js.map +1 -0
- package/lib/logic/getResourceAddress.d.ts +4 -0
- package/lib/logic/getResourceAddress.d.ts.map +1 -0
- package/lib/logic/getResourceAddress.js +17 -0
- package/lib/logic/getResourceAddress.js.map +1 -0
- package/lib/logic/isTestnet.d.ts +2 -0
- package/lib/logic/isTestnet.d.ts.map +1 -0
- package/lib/logic/isTestnet.js +9 -0
- package/lib/logic/isTestnet.js.map +1 -0
- package/lib/logic/isWriteSetChangeWriteResource.d.ts +3 -0
- package/lib/logic/isWriteSetChangeWriteResource.d.ts.map +1 -0
- package/lib/logic/isWriteSetChangeWriteResource.js +8 -0
- package/lib/logic/isWriteSetChangeWriteResource.js.map +1 -0
- package/lib/logic/normalizeAddress.d.ts +2 -0
- package/lib/logic/normalizeAddress.d.ts.map +1 -0
- package/lib/logic/normalizeAddress.js +12 -0
- package/lib/logic/normalizeAddress.js.map +1 -0
- package/lib/logic/normalizeTransactionOptions.d.ts +3 -0
- package/lib/logic/normalizeTransactionOptions.d.ts.map +1 -0
- package/lib/logic/normalizeTransactionOptions.js +21 -0
- package/lib/logic/normalizeTransactionOptions.js.map +1 -0
- package/lib/logic/processRecipients.d.ts +6 -0
- package/lib/logic/processRecipients.d.ts.map +1 -0
- package/lib/logic/processRecipients.js +58 -0
- package/lib/logic/processRecipients.js.map +1 -0
- package/lib/logic/transactionsToOperations.d.ts +7 -0
- package/lib/logic/transactionsToOperations.d.ts.map +1 -0
- package/lib/logic/transactionsToOperations.js +89 -0
- package/lib/logic/transactionsToOperations.js.map +1 -0
- package/lib/network/client.d.ts +6 -4
- package/lib/network/client.d.ts.map +1 -1
- package/lib/network/client.js +50 -14
- package/lib/network/client.js.map +1 -1
- package/lib/network/index.d.ts.map +1 -1
- package/lib/network/index.js +4 -7
- package/lib/network/index.js.map +1 -1
- package/lib/types/assets.d.ts +5 -1
- package/lib/types/assets.d.ts.map +1 -1
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib-es/__tests__/api/craftTransaction.unit.test.d.ts +2 -0
- package/lib-es/__tests__/api/craftTransaction.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/api/craftTransaction.unit.test.js +185 -0
- package/lib-es/__tests__/api/craftTransaction.unit.test.js.map +1 -0
- package/lib-es/__tests__/api/getBalance.unit.test.d.ts +2 -0
- package/lib-es/__tests__/api/getBalance.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/api/getBalance.unit.test.js +36 -0
- package/lib-es/__tests__/api/getBalance.unit.test.js.map +1 -0
- package/lib-es/__tests__/api/index.integ.test.js +277 -10
- package/lib-es/__tests__/api/index.integ.test.js.map +1 -1
- package/lib-es/__tests__/api/index.test.js +1 -1
- package/lib-es/__tests__/api/index.test.js.map +1 -1
- package/lib-es/__tests__/bridge/logic.test.js +8 -558
- package/lib-es/__tests__/bridge/logic.test.js.map +1 -1
- package/lib-es/__tests__/bridge/signOperation.test.js +7 -11
- package/lib-es/__tests__/bridge/signOperation.test.js.map +1 -1
- package/lib-es/__tests__/index.test.js +1 -1
- package/lib-es/__tests__/index.test.js.map +1 -1
- package/lib-es/__tests__/logic/buildTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/{bridge → logic}/buildTransaction.test.js +11 -5
- package/lib-es/__tests__/logic/buildTransaction.test.js.map +1 -0
- package/lib-es/__tests__/logic/calculateAmount.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/calculateAmount.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/calculateAmount.unit.test.js +40 -0
- package/lib-es/__tests__/logic/calculateAmount.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/combine.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/combine.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/combine.unit.test.js +45 -0
- package/lib-es/__tests__/logic/combine.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/compareAddress.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/compareAddress.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/compareAddress.unit.test.js +24 -0
- package/lib-es/__tests__/logic/compareAddress.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/createTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/{bridge → logic}/createTransaction.test.js +1 -1
- package/lib-es/__tests__/logic/createTransaction.test.js.map +1 -0
- package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.js +181 -0
- package/lib-es/__tests__/logic/getCoinAndAmounts.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/getFunctionAddress.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/getFunctionAddress.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/getFunctionAddress.unit.test.js +27 -0
- package/lib-es/__tests__/logic/getFunctionAddress.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/getResourceAddress.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/getResourceAddress.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/getResourceAddress.unit.test.js +216 -0
- package/lib-es/__tests__/logic/getResourceAddress.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/isTestnet.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/isTestnet.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/isTestnet.unit.test.js +10 -0
- package/lib-es/__tests__/logic/isTestnet.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/normalizeAddress.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/normalizeAddress.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/normalizeAddress.unit.test.js +10 -0
- package/lib-es/__tests__/logic/normalizeAddress.unit.test.js.map +1 -0
- package/lib-es/__tests__/logic/processRecipients.unit.test.d.ts +2 -0
- package/lib-es/__tests__/logic/processRecipients.unit.test.d.ts.map +1 -0
- package/lib-es/__tests__/logic/processRecipients.unit.test.js +74 -0
- package/lib-es/__tests__/logic/processRecipients.unit.test.js.map +1 -0
- package/lib-es/__tests__/network/client.test.js +614 -10
- package/lib-es/__tests__/network/client.test.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js +7 -12
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -1
- package/lib-es/bridge/getFeesForTransaction.js +1 -1
- package/lib-es/bridge/getFeesForTransaction.js.map +1 -1
- package/lib-es/bridge/index.js +1 -1
- package/lib-es/bridge/index.js.map +1 -1
- package/lib-es/bridge/logic.d.ts +1 -17
- package/lib-es/bridge/logic.d.ts.map +1 -1
- package/lib-es/bridge/logic.js +6 -187
- package/lib-es/bridge/logic.js.map +1 -1
- package/lib-es/bridge/prepareTransaction.js +1 -1
- package/lib-es/bridge/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/signOperation.js +1 -1
- package/lib-es/bridge/signOperation.js.map +1 -1
- package/lib-es/config.d.ts +1 -1
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/constants.d.ts +7 -4
- package/lib-es/constants.d.ts.map +1 -1
- package/lib-es/constants.js +7 -3
- package/lib-es/constants.js.map +1 -1
- package/lib-es/logic/buildTransaction.d.ts +9 -0
- package/lib-es/logic/buildTransaction.d.ts.map +1 -0
- package/lib-es/logic/buildTransaction.js +43 -0
- package/lib-es/logic/buildTransaction.js.map +1 -0
- package/lib-es/logic/calculateAmount.d.ts +3 -0
- package/lib-es/logic/calculateAmount.d.ts.map +1 -0
- package/lib-es/logic/calculateAmount.js +9 -0
- package/lib-es/logic/calculateAmount.js.map +1 -0
- package/lib-es/logic/combine.d.ts +4 -0
- package/lib-es/logic/combine.d.ts.map +1 -0
- package/lib-es/logic/combine.js +29 -0
- package/lib-es/logic/combine.js.map +1 -0
- package/lib-es/logic/craftTransaction.d.ts +5 -0
- package/lib-es/logic/craftTransaction.d.ts.map +1 -0
- package/lib-es/logic/craftTransaction.js +38 -0
- package/lib-es/logic/craftTransaction.js.map +1 -0
- package/lib-es/logic/createTransaction.d.ts.map +1 -0
- package/lib-es/logic/createTransaction.js.map +1 -0
- package/lib-es/logic/getBalance.d.ts +5 -0
- package/lib-es/logic/getBalance.d.ts.map +1 -0
- package/lib-es/logic/getBalance.js +8 -0
- package/lib-es/logic/getBalance.js.map +1 -0
- package/lib-es/logic/getCoinAndAmounts.d.ts +13 -0
- package/lib-es/logic/getCoinAndAmounts.d.ts.map +1 -0
- package/lib-es/logic/getCoinAndAmounts.js +101 -0
- package/lib-es/logic/getCoinAndAmounts.js.map +1 -0
- package/lib-es/logic/getFunctionAddress.d.ts +3 -0
- package/lib-es/logic/getFunctionAddress.d.ts.map +1 -0
- package/lib-es/logic/getFunctionAddress.js +8 -0
- package/lib-es/logic/getFunctionAddress.js.map +1 -0
- package/lib-es/logic/getResourceAddress.d.ts +4 -0
- package/lib-es/logic/getResourceAddress.d.ts.map +1 -0
- package/lib-es/logic/getResourceAddress.js +13 -0
- package/lib-es/logic/getResourceAddress.js.map +1 -0
- package/lib-es/logic/isTestnet.d.ts +2 -0
- package/lib-es/logic/isTestnet.d.ts.map +1 -0
- package/lib-es/logic/isTestnet.js +5 -0
- package/lib-es/logic/isTestnet.js.map +1 -0
- package/lib-es/logic/isWriteSetChangeWriteResource.d.ts +3 -0
- package/lib-es/logic/isWriteSetChangeWriteResource.d.ts.map +1 -0
- package/lib-es/logic/isWriteSetChangeWriteResource.js +4 -0
- package/lib-es/logic/isWriteSetChangeWriteResource.js.map +1 -0
- package/lib-es/logic/normalizeAddress.d.ts +2 -0
- package/lib-es/logic/normalizeAddress.d.ts.map +1 -0
- package/lib-es/logic/normalizeAddress.js +8 -0
- package/lib-es/logic/normalizeAddress.js.map +1 -0
- package/lib-es/logic/normalizeTransactionOptions.d.ts +3 -0
- package/lib-es/logic/normalizeTransactionOptions.d.ts.map +1 -0
- package/lib-es/logic/normalizeTransactionOptions.js +17 -0
- package/lib-es/logic/normalizeTransactionOptions.js.map +1 -0
- package/lib-es/logic/processRecipients.d.ts +6 -0
- package/lib-es/logic/processRecipients.d.ts.map +1 -0
- package/lib-es/logic/processRecipients.js +54 -0
- package/lib-es/logic/processRecipients.js.map +1 -0
- package/lib-es/logic/transactionsToOperations.d.ts +7 -0
- package/lib-es/logic/transactionsToOperations.d.ts.map +1 -0
- package/lib-es/logic/transactionsToOperations.js +81 -0
- package/lib-es/logic/transactionsToOperations.js.map +1 -0
- package/lib-es/network/client.d.ts +6 -4
- package/lib-es/network/client.d.ts.map +1 -1
- package/lib-es/network/client.js +50 -14
- package/lib-es/network/client.js.map +1 -1
- package/lib-es/network/index.d.ts.map +1 -1
- package/lib-es/network/index.js +5 -8
- package/lib-es/network/index.js.map +1 -1
- package/lib-es/types/assets.d.ts +5 -1
- package/lib-es/types/assets.d.ts.map +1 -1
- package/lib-es/types/index.d.ts +4 -0
- package/lib-es/types/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/__tests__/api/craftTransaction.unit.test.ts +243 -0
- package/src/__tests__/api/getBalance.unit.test.ts +44 -0
- package/src/__tests__/api/index.integ.test.ts +355 -12
- package/src/__tests__/api/index.test.ts +1 -1
- package/src/__tests__/bridge/logic.test.ts +9 -654
- package/src/__tests__/bridge/signOperation.test.ts +7 -11
- package/src/__tests__/index.test.ts +1 -1
- package/src/__tests__/{bridge → logic}/buildTransaction.test.ts +14 -7
- package/src/__tests__/logic/calculateAmount.unit.test.ts +51 -0
- package/src/__tests__/logic/combine.unit.test.ts +65 -0
- package/src/__tests__/logic/compareAddress.unit.test.ts +27 -0
- package/src/__tests__/{bridge → logic}/createTransaction.test.ts +1 -1
- package/src/__tests__/logic/getCoinAndAmounts.unit.test.ts +195 -0
- package/src/__tests__/logic/getFunctionAddress.unit.test.ts +33 -0
- package/src/__tests__/logic/getResourceAddress.unit.test.ts +241 -0
- package/src/__tests__/logic/isTestnet.unit.test.ts +11 -0
- package/src/__tests__/logic/normalizeAddress.unit.test.ts +15 -0
- package/src/__tests__/logic/processRecipients.unit.test.ts +95 -0
- package/src/__tests__/network/client.test.ts +650 -11
- package/src/api/index.ts +10 -13
- package/src/bridge/estimateMaxSpendable.ts +1 -1
- package/src/bridge/getFeesForTransaction.ts +1 -1
- package/src/bridge/index.ts +1 -1
- package/src/bridge/logic.ts +8 -279
- package/src/bridge/prepareTransaction.ts +1 -1
- package/src/bridge/signOperation.ts +1 -1
- package/src/config.ts +1 -1
- package/src/constants.ts +8 -4
- package/src/logic/buildTransaction.ts +70 -0
- package/src/logic/calculateAmount.ts +15 -0
- package/src/logic/combine.ts +51 -0
- package/src/logic/craftTransaction.ts +65 -0
- package/src/logic/getBalance.ts +15 -0
- package/src/logic/getCoinAndAmounts.ts +141 -0
- package/src/logic/getFunctionAddress.ts +9 -0
- package/src/logic/getResourceAddress.ts +24 -0
- package/src/logic/isTestnet.ts +5 -0
- package/src/logic/isWriteSetChangeWriteResource.ts +7 -0
- package/src/logic/normalizeAddress.ts +8 -0
- package/src/logic/normalizeTransactionOptions.ts +18 -0
- package/src/logic/processRecipients.ts +88 -0
- package/src/logic/transactionsToOperations.ts +106 -0
- package/src/network/client.ts +88 -29
- package/src/network/index.ts +4 -13
- package/src/types/assets.ts +6 -1
- package/src/types/index.ts +5 -0
- package/lib/__tests__/bridge/buildTransaction.test.d.ts.map +0 -1
- package/lib/__tests__/bridge/buildTransaction.test.js.map +0 -1
- package/lib/__tests__/bridge/createTransaction.test.d.ts.map +0 -1
- package/lib/__tests__/bridge/createTransaction.test.js.map +0 -1
- package/lib/bridge/buildTransaction.d.ts +0 -7
- package/lib/bridge/buildTransaction.d.ts.map +0 -1
- package/lib/bridge/buildTransaction.js +0 -45
- package/lib/bridge/buildTransaction.js.map +0 -1
- package/lib/bridge/createTransaction.d.ts.map +0 -1
- package/lib/bridge/createTransaction.js.map +0 -1
- package/lib-es/__tests__/bridge/buildTransaction.test.d.ts.map +0 -1
- package/lib-es/__tests__/bridge/buildTransaction.test.js.map +0 -1
- package/lib-es/__tests__/bridge/createTransaction.test.d.ts.map +0 -1
- package/lib-es/__tests__/bridge/createTransaction.test.js.map +0 -1
- package/lib-es/bridge/buildTransaction.d.ts +0 -7
- package/lib-es/bridge/buildTransaction.d.ts.map +0 -1
- package/lib-es/bridge/buildTransaction.js +0 -43
- package/lib-es/bridge/buildTransaction.js.map +0 -1
- package/lib-es/bridge/createTransaction.d.ts.map +0 -1
- package/lib-es/bridge/createTransaction.js.map +0 -1
- package/src/bridge/buildTransaction.ts +0 -62
- /package/lib/__tests__/{bridge → logic}/buildTransaction.test.d.ts +0 -0
- /package/lib/__tests__/{bridge → logic}/createTransaction.test.d.ts +0 -0
- /package/lib/{bridge → logic}/createTransaction.d.ts +0 -0
- /package/lib/{bridge → logic}/createTransaction.js +0 -0
- /package/lib-es/__tests__/{bridge → logic}/buildTransaction.test.d.ts +0 -0
- /package/lib-es/__tests__/{bridge → logic}/createTransaction.test.d.ts +0 -0
- /package/lib-es/{bridge → logic}/createTransaction.d.ts +0 -0
- /package/lib-es/{bridge → logic}/createTransaction.js +0 -0
- /package/src/{bridge → logic}/createTransaction.ts +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import { APTOS_ASSET_ID, APTOS_FUNGIBLE_STORE, APTOS_OBJECT_CORE } from "../constants";
|
|
3
|
+
import {
|
|
4
|
+
AptosFungibleoObjectCoreResourceData,
|
|
5
|
+
AptosFungibleStoreResourceData,
|
|
6
|
+
AptosMoveResource,
|
|
7
|
+
AptosTransaction,
|
|
8
|
+
} from "../types";
|
|
9
|
+
import { MoveResource, WriteSetChangeWriteResource, Event } from "@aptos-labs/ts-sdk";
|
|
10
|
+
import { getResourceAddress } from "./getResourceAddress";
|
|
11
|
+
import { isWriteSetChangeWriteResource } from "./isWriteSetChangeWriteResource";
|
|
12
|
+
|
|
13
|
+
const CLEAN_HEX_REGEXP = /^0x0*|^0+/;
|
|
14
|
+
|
|
15
|
+
export function compareAddress(addressA: string, addressB: string) {
|
|
16
|
+
return (
|
|
17
|
+
addressA.replace(CLEAN_HEX_REGEXP, "").toLowerCase() ===
|
|
18
|
+
addressB.replace(CLEAN_HEX_REGEXP, "").toLowerCase()
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function checkFAOwner(tx: AptosTransaction, event: Event, user_address: string): boolean {
|
|
23
|
+
for (const change of tx.changes) {
|
|
24
|
+
if (isWriteSetChangeWriteResource(change)) {
|
|
25
|
+
const storeData = change.data as MoveResource<AptosFungibleoObjectCoreResourceData>;
|
|
26
|
+
if (
|
|
27
|
+
change.address == event.data.store &&
|
|
28
|
+
storeData.type == APTOS_OBJECT_CORE &&
|
|
29
|
+
storeData.data.owner == user_address
|
|
30
|
+
) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the address from a string like "0x1::coin::CoinStore<address::module::type>"
|
|
40
|
+
* @param {string} str - The input string containing the address.
|
|
41
|
+
* @returns {string | null} - The extracted address or null if not found.
|
|
42
|
+
*/
|
|
43
|
+
function extractAddress(str: string): string | null {
|
|
44
|
+
const match = /<([^<>]+)>$/.exec(str);
|
|
45
|
+
return match ? match[1] : null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function getEventCoinAddress(
|
|
49
|
+
change: WriteSetChangeWriteResource,
|
|
50
|
+
event: Event,
|
|
51
|
+
event_name: string,
|
|
52
|
+
): string | null {
|
|
53
|
+
const change_data = change.data;
|
|
54
|
+
|
|
55
|
+
const mr = change_data as MoveResource<AptosMoveResource>; // -> this is data that we want to parse
|
|
56
|
+
|
|
57
|
+
if (!(event_name in mr.data)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const change_event_data = mr.data[event_name];
|
|
62
|
+
if (
|
|
63
|
+
change_event_data.guid.id.addr !== event.guid.account_address ||
|
|
64
|
+
change_event_data.guid.id.creation_num !== event.guid.creation_number
|
|
65
|
+
) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const address = extractAddress(mr.type);
|
|
70
|
+
|
|
71
|
+
return address;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function getEventFAAddress(
|
|
75
|
+
change: WriteSetChangeWriteResource,
|
|
76
|
+
event: Event,
|
|
77
|
+
_event_name: string,
|
|
78
|
+
): string | null {
|
|
79
|
+
const change_data = change.data;
|
|
80
|
+
|
|
81
|
+
if (change_data.type !== APTOS_FUNGIBLE_STORE) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const mr = change_data as MoveResource<AptosFungibleStoreResourceData>;
|
|
86
|
+
|
|
87
|
+
if (change.address !== event.data.store) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return mr.data.metadata.inner;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function getCoinAndAmounts(
|
|
95
|
+
tx: AptosTransaction,
|
|
96
|
+
address: string,
|
|
97
|
+
): { coin_id: string | null; amount_in: BigNumber; amount_out: BigNumber } {
|
|
98
|
+
let coin_id: string | null = null;
|
|
99
|
+
let amount_in = BigNumber(0);
|
|
100
|
+
let amount_out = BigNumber(0);
|
|
101
|
+
|
|
102
|
+
// collect all events related to the address and calculate the overall amounts
|
|
103
|
+
tx.events.forEach(event => {
|
|
104
|
+
switch (event.type) {
|
|
105
|
+
case "0x1::coin::WithdrawEvent":
|
|
106
|
+
if (compareAddress(event.guid.account_address, address)) {
|
|
107
|
+
coin_id = getResourceAddress(tx, event, "withdraw_events", getEventCoinAddress);
|
|
108
|
+
amount_out = amount_out.plus(event.data.amount);
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
case "0x1::coin::DepositEvent":
|
|
112
|
+
if (compareAddress(event.guid.account_address, address)) {
|
|
113
|
+
coin_id = getResourceAddress(tx, event, "deposit_events", getEventCoinAddress);
|
|
114
|
+
amount_in = amount_in.plus(event.data.amount);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "0x1::fungible_asset::Withdraw":
|
|
118
|
+
if (checkFAOwner(tx, event, address)) {
|
|
119
|
+
coin_id = getResourceAddress(tx, event, "withdraw_events", getEventFAAddress);
|
|
120
|
+
amount_out = amount_out.plus(event.data.amount);
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "0x1::fungible_asset::Deposit":
|
|
124
|
+
if (checkFAOwner(tx, event, address)) {
|
|
125
|
+
coin_id = getResourceAddress(tx, event, "deposit_events", getEventFAAddress);
|
|
126
|
+
amount_in = amount_in.plus(event.data.amount);
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
case "0x1::transaction_fee::FeeStatement":
|
|
130
|
+
if (tx.sender === address) {
|
|
131
|
+
coin_id ??= APTOS_ASSET_ID;
|
|
132
|
+
if (coin_id === APTOS_ASSET_ID) {
|
|
133
|
+
const fees = BigNumber(tx.gas_unit_price).times(BigNumber(tx.gas_used));
|
|
134
|
+
amount_out = amount_out.plus(fees);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return { coin_id, amount_in, amount_out };
|
|
141
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputEntryFunctionData } from "@aptos-labs/ts-sdk";
|
|
2
|
+
|
|
3
|
+
export function getFunctionAddress(payload: InputEntryFunctionData): string | undefined {
|
|
4
|
+
if (payload.function) {
|
|
5
|
+
const parts = payload.function.split("::");
|
|
6
|
+
return parts.length === 3 && parts[0].length ? parts[0] : undefined;
|
|
7
|
+
}
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WriteSetChangeWriteResource, Event } from "@aptos-labs/ts-sdk";
|
|
2
|
+
import { AptosTransaction } from "../types";
|
|
3
|
+
import { isWriteSetChangeWriteResource } from "./isWriteSetChangeWriteResource";
|
|
4
|
+
|
|
5
|
+
export function getResourceAddress(
|
|
6
|
+
tx: AptosTransaction,
|
|
7
|
+
event: Event,
|
|
8
|
+
event_name: string,
|
|
9
|
+
getAddressProcessor: (
|
|
10
|
+
change: WriteSetChangeWriteResource,
|
|
11
|
+
event: Event,
|
|
12
|
+
event_name: string,
|
|
13
|
+
) => string | null,
|
|
14
|
+
): string | null {
|
|
15
|
+
for (const change of tx.changes) {
|
|
16
|
+
if (isWriteSetChangeWriteResource(change)) {
|
|
17
|
+
const address = getAddressProcessor(change, event, event_name);
|
|
18
|
+
if (address !== null) {
|
|
19
|
+
return address;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WriteSetChange, WriteSetChangeWriteResource } from "@aptos-labs/ts-sdk";
|
|
2
|
+
|
|
3
|
+
export function isWriteSetChangeWriteResource(
|
|
4
|
+
change: WriteSetChange,
|
|
5
|
+
): change is WriteSetChangeWriteResource {
|
|
6
|
+
return (change as WriteSetChangeWriteResource).data !== undefined;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TransactionOptions } from "../types";
|
|
2
|
+
|
|
3
|
+
export function normalizeTransactionOptions(options: TransactionOptions): TransactionOptions {
|
|
4
|
+
// FIXME: this is wrong. TransactionOptions is
|
|
5
|
+
// {
|
|
6
|
+
// maxGasAmount: string;
|
|
7
|
+
// gasUnitPrice: string;
|
|
8
|
+
// sequenceNumber?: string;
|
|
9
|
+
// expirationTimestampSecs?: string;
|
|
10
|
+
// }
|
|
11
|
+
// meaning we can't return undefined in check method.
|
|
12
|
+
// This method is useless, not deleting as it breaks code and this iteration is coin modularisation.
|
|
13
|
+
const check = (v: any) => ((v ?? "").toString().trim() ? v : undefined);
|
|
14
|
+
return {
|
|
15
|
+
maxGasAmount: check(options.maxGasAmount),
|
|
16
|
+
gasUnitPrice: check(options.gasUnitPrice),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { InputEntryFunctionData } from "@aptos-labs/ts-sdk";
|
|
2
|
+
import { Operation } from "@ledgerhq/types-live";
|
|
3
|
+
import { Operation as APIOperation } from "@ledgerhq/coin-framework/api/types";
|
|
4
|
+
import { AptosAsset } from "../types/assets";
|
|
5
|
+
import {
|
|
6
|
+
BATCH_TRANSFER_TYPES,
|
|
7
|
+
COIN_TRANSFER_TYPES,
|
|
8
|
+
DELEGATION_POOL_TYPES,
|
|
9
|
+
FA_TRANSFER_TYPES,
|
|
10
|
+
} from "../constants";
|
|
11
|
+
import { compareAddress } from "./getCoinAndAmounts";
|
|
12
|
+
import { normalizeAddress } from "./normalizeAddress";
|
|
13
|
+
|
|
14
|
+
const transferLikeFunctions = (payload: InputEntryFunctionData) =>
|
|
15
|
+
COIN_TRANSFER_TYPES.includes(payload.function) ||
|
|
16
|
+
DELEGATION_POOL_TYPES.includes(payload.function);
|
|
17
|
+
|
|
18
|
+
const addLikeFunctionsToRecipients = (
|
|
19
|
+
op: Operation | APIOperation<AptosAsset>,
|
|
20
|
+
payload: InputEntryFunctionData,
|
|
21
|
+
) => {
|
|
22
|
+
if (
|
|
23
|
+
payload.functionArguments &&
|
|
24
|
+
payload.functionArguments.length > 0 &&
|
|
25
|
+
typeof payload.functionArguments[0] === "string"
|
|
26
|
+
) {
|
|
27
|
+
op.recipients.push(normalizeAddress(payload.functionArguments[0]));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const addFungibleToRecipients = (
|
|
32
|
+
op: Operation | APIOperation<AptosAsset>,
|
|
33
|
+
payload: InputEntryFunctionData,
|
|
34
|
+
) => {
|
|
35
|
+
if (
|
|
36
|
+
payload.functionArguments &&
|
|
37
|
+
payload.functionArguments.length > 1 &&
|
|
38
|
+
typeof payload.functionArguments[0] === "object" &&
|
|
39
|
+
typeof payload.functionArguments[1] === "string"
|
|
40
|
+
) {
|
|
41
|
+
op.recipients.push(normalizeAddress(payload.functionArguments[1].toString()));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const addBatchedFunctions = (
|
|
46
|
+
op: Operation | APIOperation<AptosAsset>,
|
|
47
|
+
payload: InputEntryFunctionData,
|
|
48
|
+
address: string,
|
|
49
|
+
) => {
|
|
50
|
+
if (
|
|
51
|
+
!(
|
|
52
|
+
payload.functionArguments &&
|
|
53
|
+
payload.functionArguments.length > 0 &&
|
|
54
|
+
Array.isArray(payload.functionArguments[0])
|
|
55
|
+
)
|
|
56
|
+
) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (const recipient of payload.functionArguments[0]) {
|
|
60
|
+
if (recipient && compareAddress(recipient.toString(), address)) {
|
|
61
|
+
op.recipients.push(normalizeAddress(recipient.toString()));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export function processRecipients(
|
|
67
|
+
payload: InputEntryFunctionData,
|
|
68
|
+
address: string,
|
|
69
|
+
op: Operation | APIOperation<AptosAsset>,
|
|
70
|
+
function_address: string,
|
|
71
|
+
): void {
|
|
72
|
+
// get recipients by 3 groups
|
|
73
|
+
if (transferLikeFunctions(payload)) {
|
|
74
|
+
// 1. Transfer like functions (includes some delegation pool functions)
|
|
75
|
+
addLikeFunctionsToRecipients(op, payload);
|
|
76
|
+
} else if (FA_TRANSFER_TYPES.includes(payload.function)) {
|
|
77
|
+
// 1. Transfer like functions (includes some delegation pool functions)
|
|
78
|
+
addFungibleToRecipients(op, payload);
|
|
79
|
+
} else if (BATCH_TRANSFER_TYPES.includes(payload.function)) {
|
|
80
|
+
// 2. Batch function, to validate we are in the recipients list
|
|
81
|
+
if (!compareAddress(op.senders[0], address)) {
|
|
82
|
+
addBatchedFunctions(op, payload, address);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
// 3. other smart contracts, in this case smart contract will be treated as a recipient
|
|
86
|
+
op.recipients.push(function_address);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { AptosTransaction } from "../types";
|
|
2
|
+
import { Operation } from "@ledgerhq/coin-framework/api/types";
|
|
3
|
+
import { AptosAsset } from "../types/assets";
|
|
4
|
+
import BigNumber from "bignumber.js";
|
|
5
|
+
import { EntryFunctionPayloadResponse, InputEntryFunctionData } from "@aptos-labs/ts-sdk";
|
|
6
|
+
import { APTOS_ASSET_ID, DIRECTION } from "../constants";
|
|
7
|
+
import { compareAddress, getCoinAndAmounts } from "./getCoinAndAmounts";
|
|
8
|
+
import { calculateAmount } from "./calculateAmount";
|
|
9
|
+
import { processRecipients } from "./processRecipients";
|
|
10
|
+
import { getFunctionAddress } from "./getFunctionAddress";
|
|
11
|
+
import { normalizeAddress } from "./normalizeAddress";
|
|
12
|
+
|
|
13
|
+
export const convertFunctionPayloadResponseToInputEntryFunctionData = (
|
|
14
|
+
payload: EntryFunctionPayloadResponse,
|
|
15
|
+
): InputEntryFunctionData => ({
|
|
16
|
+
function: payload.function,
|
|
17
|
+
typeArguments: payload.type_arguments,
|
|
18
|
+
functionArguments: payload.arguments,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const detectType = (address: string, tx: AptosTransaction, value: BigNumber): DIRECTION => {
|
|
22
|
+
let type = compareAddress(tx.sender, address) ? DIRECTION.OUT : DIRECTION.IN;
|
|
23
|
+
|
|
24
|
+
if (!value) {
|
|
25
|
+
// skip transaction that result no Aptos change
|
|
26
|
+
type = DIRECTION.UNKNOWN;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return type;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const getTokenStandard = (coin_id: string): string => {
|
|
33
|
+
const parts = coin_id.split("::");
|
|
34
|
+
if (parts.length === 3) {
|
|
35
|
+
return "coin";
|
|
36
|
+
}
|
|
37
|
+
return "fungible_asset";
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export function transactionsToOperations(
|
|
41
|
+
address: string,
|
|
42
|
+
txs: (AptosTransaction | null)[],
|
|
43
|
+
): Operation<AptosAsset>[] {
|
|
44
|
+
const operations: Operation<AptosAsset>[] = [];
|
|
45
|
+
|
|
46
|
+
return txs.reduce((acc, tx) => {
|
|
47
|
+
if (tx === null) {
|
|
48
|
+
return acc;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const payload = convertFunctionPayloadResponseToInputEntryFunctionData(
|
|
52
|
+
tx.payload as EntryFunctionPayloadResponse,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const function_address = getFunctionAddress(payload);
|
|
56
|
+
|
|
57
|
+
if (!function_address) {
|
|
58
|
+
return acc; // skip transaction without functions in payload
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const { coin_id, amount_in, amount_out } = getCoinAndAmounts(tx, address);
|
|
62
|
+
const value = calculateAmount(tx.sender, address, amount_in, amount_out);
|
|
63
|
+
const type = detectType(address, tx, value);
|
|
64
|
+
|
|
65
|
+
const op: Operation<AptosAsset> = {
|
|
66
|
+
id: tx.hash,
|
|
67
|
+
type,
|
|
68
|
+
senders: [],
|
|
69
|
+
recipients: [],
|
|
70
|
+
value: BigInt(0),
|
|
71
|
+
asset: { type: "native" },
|
|
72
|
+
details: {
|
|
73
|
+
hasFailed: !tx.success,
|
|
74
|
+
},
|
|
75
|
+
tx: {
|
|
76
|
+
hash: tx.hash,
|
|
77
|
+
block: { height: 0 },
|
|
78
|
+
fees: BigInt(0),
|
|
79
|
+
date: new Date(parseInt(tx.timestamp) / 1000),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const fees = new BigNumber(tx.gas_used).multipliedBy(new BigNumber(tx.gas_unit_price));
|
|
84
|
+
op.tx.fees = BigInt(fees.toString());
|
|
85
|
+
|
|
86
|
+
op.value = BigInt(value.isNaN() ? 0 : value.toString());
|
|
87
|
+
op.senders.push(normalizeAddress(tx.sender));
|
|
88
|
+
|
|
89
|
+
processRecipients(payload, address, op, function_address);
|
|
90
|
+
|
|
91
|
+
if (op.type !== DIRECTION.UNKNOWN && coin_id !== null) {
|
|
92
|
+
if (coin_id === APTOS_ASSET_ID) {
|
|
93
|
+
acc.push(op);
|
|
94
|
+
return acc;
|
|
95
|
+
} else {
|
|
96
|
+
op.asset = {
|
|
97
|
+
type: "token",
|
|
98
|
+
standard: getTokenStandard(coin_id),
|
|
99
|
+
contractAddress: coin_id,
|
|
100
|
+
};
|
|
101
|
+
acc.push(op);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return acc;
|
|
105
|
+
}, operations);
|
|
106
|
+
}
|
package/src/network/client.ts
CHANGED
|
@@ -1,41 +1,54 @@
|
|
|
1
1
|
import { ApolloClient, InMemoryCache } from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
AccountData,
|
|
4
|
+
type AccountData,
|
|
5
5
|
Aptos,
|
|
6
|
-
AptosApiType,
|
|
7
6
|
AptosConfig,
|
|
8
7
|
Ed25519PublicKey,
|
|
9
|
-
GasEstimation,
|
|
10
|
-
InputEntryFunctionData,
|
|
11
|
-
InputGenerateTransactionOptions,
|
|
8
|
+
type GasEstimation,
|
|
9
|
+
type InputEntryFunctionData,
|
|
10
|
+
type InputGenerateTransactionOptions,
|
|
12
11
|
MimeType,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
type RawTransaction,
|
|
13
|
+
type SimpleTransaction,
|
|
14
|
+
type TransactionResponse,
|
|
15
|
+
type UserTransactionResponse,
|
|
16
|
+
type Block,
|
|
17
|
+
type AptosSettings,
|
|
18
|
+
Hex,
|
|
19
|
+
postAptosFullNode,
|
|
20
|
+
type PendingTransactionResponse,
|
|
22
21
|
} from "@aptos-labs/ts-sdk";
|
|
23
22
|
import { getEnv } from "@ledgerhq/live-env";
|
|
24
23
|
import network from "@ledgerhq/live-network";
|
|
25
24
|
import BigNumber from "bignumber.js";
|
|
26
25
|
import isUndefined from "lodash/isUndefined";
|
|
27
|
-
import { APTOS_ASSET_ID, DEFAULT_GAS, DEFAULT_GAS_PRICE, ESTIMATE_GAS_MUL } from "../constants";
|
|
28
|
-
import { isTestnet } from "../bridge/logic";
|
|
29
|
-
import type { AptosTransaction, TransactionOptions } from "../types";
|
|
30
|
-
import { GetAccountTransactionsData, GetAccountTransactionsDataGt } from "./graphql/queries";
|
|
31
26
|
import {
|
|
27
|
+
APTOS_ASSET_ID,
|
|
28
|
+
DEFAULT_GAS,
|
|
29
|
+
DEFAULT_GAS_PRICE,
|
|
30
|
+
ESTIMATE_GAS_MUL,
|
|
31
|
+
TOKEN_TYPE,
|
|
32
|
+
} from "../constants";
|
|
33
|
+
import type { AptosBalance, AptosTransaction, TransactionOptions } from "../types";
|
|
34
|
+
import { GetAccountTransactionsData, GetAccountTransactionsDataGt } from "./graphql/queries";
|
|
35
|
+
import type {
|
|
32
36
|
GetAccountTransactionsDataQuery,
|
|
33
37
|
GetAccountTransactionsDataGtQueryVariables,
|
|
34
38
|
} from "./graphql/types";
|
|
35
39
|
import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
36
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
BlockInfo,
|
|
42
|
+
FeeEstimation,
|
|
43
|
+
Operation,
|
|
44
|
+
Pagination,
|
|
45
|
+
TransactionIntent,
|
|
46
|
+
} from "@ledgerhq/coin-framework/api/types";
|
|
37
47
|
import { AptosAsset, AptosExtra, AptosFeeParameters, AptosSender } from "../types/assets";
|
|
38
48
|
import { log } from "@ledgerhq/logs";
|
|
49
|
+
import { transactionsToOperations } from "../logic/transactionsToOperations";
|
|
50
|
+
import { isTestnet } from "../logic/isTestnet";
|
|
51
|
+
import { normalizeAddress } from "../logic/normalizeAddress";
|
|
39
52
|
|
|
40
53
|
const getApiEndpoint = (currencyId: string) =>
|
|
41
54
|
isTestnet(currencyId) ? getEnv("APTOS_TESTNET_API_ENDPOINT") : getEnv("APTOS_API_ENDPOINT");
|
|
@@ -140,25 +153,26 @@ export class AptosAPI {
|
|
|
140
153
|
});
|
|
141
154
|
}
|
|
142
155
|
|
|
143
|
-
async broadcast(
|
|
144
|
-
const txBytes =
|
|
145
|
-
|
|
146
|
-
|
|
156
|
+
async broadcast(tx: string): Promise<string> {
|
|
157
|
+
const txBytes = Hex.fromHexString(tx).toUint8Array();
|
|
158
|
+
|
|
159
|
+
const pendingTx = await postAptosFullNode<Uint8Array, PendingTransactionResponse>({
|
|
147
160
|
aptosConfig: this.aptosClient.config,
|
|
148
161
|
body: txBytes,
|
|
149
162
|
path: "transactions",
|
|
150
|
-
type: AptosApiType.FULLNODE,
|
|
151
163
|
originMethod: "",
|
|
164
|
+
contentType: MimeType.BCS_SIGNED_TRANSACTION,
|
|
152
165
|
});
|
|
166
|
+
|
|
153
167
|
return pendingTx.data.hash;
|
|
154
168
|
}
|
|
155
169
|
|
|
156
170
|
async getBalance(address: string, token: TokenCurrency): Promise<BigNumber> {
|
|
157
171
|
if (token.tokenType === "coin") {
|
|
158
172
|
return await this.getCoinBalance(address, token.contractAddress);
|
|
159
|
-
} else {
|
|
160
|
-
return await this.getFABalance(address, token.contractAddress);
|
|
161
173
|
}
|
|
174
|
+
|
|
175
|
+
return await this.getFABalance(address, token.contractAddress);
|
|
162
176
|
}
|
|
163
177
|
|
|
164
178
|
async getLastBlock(): Promise<BlockInfo> {
|
|
@@ -167,7 +181,7 @@ export class AptosAPI {
|
|
|
167
181
|
return {
|
|
168
182
|
height: Number(block.block_height),
|
|
169
183
|
hash: block.block_hash,
|
|
170
|
-
time: new Date(Number(block.block_timestamp)),
|
|
184
|
+
time: new Date(Number(block.block_timestamp) / 1_000),
|
|
171
185
|
};
|
|
172
186
|
}
|
|
173
187
|
|
|
@@ -213,14 +227,30 @@ export class AptosAPI {
|
|
|
213
227
|
transactionIntent: TransactionIntent<AptosAsset, AptosExtra, AptosSender>,
|
|
214
228
|
): Promise<FeeEstimation<AptosFeeParameters>> {
|
|
215
229
|
const publicKeyEd = new Ed25519PublicKey(transactionIntent.sender.xpub);
|
|
216
|
-
const fn: MoveFunctionId = "0x1::aptos_account::transfer_coins";
|
|
217
230
|
|
|
218
231
|
const txPayload: InputEntryFunctionData = {
|
|
219
|
-
function:
|
|
232
|
+
function: "0x1::aptos_account::transfer_coins",
|
|
220
233
|
typeArguments: [APTOS_ASSET_ID],
|
|
221
234
|
functionArguments: [transactionIntent.recipient, transactionIntent.amount],
|
|
222
235
|
};
|
|
223
236
|
|
|
237
|
+
if (transactionIntent.asset.type === "token") {
|
|
238
|
+
const { standard } = transactionIntent.asset;
|
|
239
|
+
|
|
240
|
+
if (standard === TOKEN_TYPE.FUNGIBLE_ASSET) {
|
|
241
|
+
txPayload.function = "0x1::primary_fungible_store::transfer";
|
|
242
|
+
txPayload.typeArguments = ["0x1::fungible_asset::Metadata"];
|
|
243
|
+
txPayload.functionArguments = [
|
|
244
|
+
transactionIntent.asset.contractAddress,
|
|
245
|
+
transactionIntent.recipient,
|
|
246
|
+
transactionIntent.amount,
|
|
247
|
+
];
|
|
248
|
+
} else if (standard === TOKEN_TYPE.COIN) {
|
|
249
|
+
txPayload.function = "0x1::aptos_account::transfer_coins";
|
|
250
|
+
txPayload.typeArguments = [transactionIntent.asset.contractAddress];
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
224
254
|
const txOptions: TransactionOptions = {
|
|
225
255
|
maxGasAmount: DEFAULT_GAS.toString(),
|
|
226
256
|
gasUnitPrice: DEFAULT_GAS_PRICE.toString(),
|
|
@@ -249,6 +279,17 @@ export class AptosAPI {
|
|
|
249
279
|
};
|
|
250
280
|
}
|
|
251
281
|
|
|
282
|
+
async listOperations(
|
|
283
|
+
rawAddress: string,
|
|
284
|
+
pagination: Pagination,
|
|
285
|
+
): Promise<[Operation<AptosAsset>[], string]> {
|
|
286
|
+
const address = normalizeAddress(rawAddress);
|
|
287
|
+
const transactions = await this.getAccountInfo(address, pagination.minHeight.toString());
|
|
288
|
+
const newOperations = transactionsToOperations(address, transactions.transactions);
|
|
289
|
+
|
|
290
|
+
return [newOperations, ""];
|
|
291
|
+
}
|
|
292
|
+
|
|
252
293
|
private async fetchTransactions(address: string, gt?: string) {
|
|
253
294
|
if (!address) {
|
|
254
295
|
return [];
|
|
@@ -312,4 +353,22 @@ export class AptosAPI {
|
|
|
312
353
|
hash: block.block_hash,
|
|
313
354
|
};
|
|
314
355
|
}
|
|
356
|
+
|
|
357
|
+
async getBalances(address: string): Promise<AptosBalance[]> {
|
|
358
|
+
const response = await this.aptosClient.getCurrentFungibleAssetBalances({
|
|
359
|
+
options: {
|
|
360
|
+
offset: 0,
|
|
361
|
+
limit: 1000,
|
|
362
|
+
where: {
|
|
363
|
+
asset_type: { _eq: APTOS_ASSET_ID }, // to return all asset balances (native / token) we should remove this filter
|
|
364
|
+
owner_address: { _eq: address },
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
return response.map(x => ({
|
|
370
|
+
contractAddress: x.asset_type ?? "-",
|
|
371
|
+
amount: BigNumber(x.amount),
|
|
372
|
+
}));
|
|
373
|
+
}
|
|
315
374
|
}
|
package/src/network/index.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AccountAddress,
|
|
3
|
-
AccountAuthenticatorEd25519,
|
|
4
3
|
Ed25519PublicKey,
|
|
5
4
|
Ed25519Signature,
|
|
6
|
-
generateSignedTransaction,
|
|
7
5
|
generateSigningMessageForTransaction,
|
|
8
|
-
Hex,
|
|
9
6
|
RawTransaction,
|
|
10
7
|
SimpleTransaction,
|
|
11
8
|
} from "@aptos-labs/ts-sdk";
|
|
@@ -13,6 +10,7 @@ import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
|
13
10
|
import { Account } from "@ledgerhq/types-live";
|
|
14
11
|
import { AptosSigner } from "../types";
|
|
15
12
|
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
|
|
13
|
+
import { combineSignedTransaction } from "../logic/combine";
|
|
16
14
|
export * from "./client";
|
|
17
15
|
|
|
18
16
|
export async function signTransaction(
|
|
@@ -41,15 +39,8 @@ export async function signTransaction(
|
|
|
41
39
|
async signer => await signer.signTransaction(derivationPath, Buffer.from(signingMessage)),
|
|
42
40
|
);
|
|
43
41
|
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const authenticator = new AccountAuthenticatorEd25519(
|
|
47
|
-
new Ed25519PublicKey(publicKey.toString("hex")),
|
|
48
|
-
signature,
|
|
49
|
-
);
|
|
42
|
+
const signature = new Ed25519Signature(response.signature.toString("hex"));
|
|
43
|
+
const pubkey = new Ed25519PublicKey(publicKey.toString("hex"));
|
|
50
44
|
|
|
51
|
-
return
|
|
52
|
-
transaction: { rawTransaction: rawTxn } as SimpleTransaction,
|
|
53
|
-
senderAuthenticator: authenticator,
|
|
54
|
-
});
|
|
45
|
+
return combineSignedTransaction(rawTxn, signature, pubkey);
|
|
55
46
|
}
|
package/src/types/assets.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Asset } from "@ledgerhq/coin-framework/api/types";
|
|
2
2
|
|
|
3
|
-
export type AptosAsset = Asset
|
|
3
|
+
export type AptosAsset = Asset<AptosTokenInformation>;
|
|
4
|
+
|
|
5
|
+
export type AptosTokenInformation = {
|
|
6
|
+
standard: string;
|
|
7
|
+
contractAddress: string;
|
|
8
|
+
};
|
|
4
9
|
|
|
5
10
|
export type AptosExtra = Record<string, unknown>;
|
|
6
11
|
|
package/src/types/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildTransaction.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/bridge/buildTransaction.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildTransaction.test.js","sourceRoot":"","sources":["../../../src/__tests__/bridge/buildTransaction.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAKqC;AACrC,qFAA6D;AAC7D,2CAAyC;AACzC,8CAAiE;AAIjE,MAAM,mBAAmB,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAEhD,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,2BAA2B,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,WAAW,EAAE,GAAG;IAChB,iBAAiB,EA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