@ledgerhq/coin-celo 1.1.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/.eslintrc.js +22 -0
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +56 -0
- package/CHANGELOG.md +15 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +8 -0
- package/jest.integ.config.js +8 -0
- package/lib/bridge/broadcast.d.ts +5 -0
- package/lib/bridge/broadcast.d.ts.map +1 -0
- package/lib/bridge/broadcast.js +13 -0
- package/lib/bridge/broadcast.js.map +1 -0
- package/lib/bridge/buildOptimisticOperation.d.ts +4 -0
- package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib/bridge/buildOptimisticOperation.js +49 -0
- package/lib/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib/bridge/buildTransaction.d.ts +5 -0
- package/lib/bridge/buildTransaction.d.ts.map +1 -0
- package/lib/bridge/buildTransaction.js +142 -0
- package/lib/bridge/buildTransaction.js.map +1 -0
- package/lib/bridge/createTransaction.d.ts +5 -0
- package/lib/bridge/createTransaction.d.ts.map +1 -0
- package/lib/bridge/createTransaction.js +16 -0
- package/lib/bridge/createTransaction.js.map +1 -0
- package/lib/bridge/deviceTransactionConfig.d.ts +4 -0
- package/lib/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/bridge/deviceTransactionConfig.js +16 -0
- package/lib/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib/bridge/estimateMaxSpendable.d.ts +5 -0
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/estimateMaxSpendable.js +23 -0
- package/lib/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/getFeesForTransaction.d.ts +8 -0
- package/lib/bridge/getFeesForTransaction.d.ts.map +1 -0
- package/lib/bridge/getFeesForTransaction.js +93 -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 +98 -0
- package/lib/bridge/getTransactionStatus.js.map +1 -0
- package/lib/bridge/index.d.ts +11 -0
- package/lib/bridge/index.d.ts.map +1 -0
- package/lib/bridge/index.js +62 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge/preload.d.ts +10 -0
- package/lib/bridge/preload.d.ts.map +1 -0
- package/lib/bridge/preload.js +72 -0
- package/lib/bridge/preload.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 +28 -0
- package/lib/bridge/prepareTransaction.js.map +1 -0
- package/lib/bridge/serialization.d.ts +9 -0
- package/lib/bridge/serialization.d.ts.map +1 -0
- package/lib/bridge/serialization.js +92 -0
- package/lib/bridge/serialization.js.map +1 -0
- package/lib/bridge/signOperation.d.ts +10 -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 +5 -0
- package/lib/bridge/synchronisation.d.ts.map +1 -0
- package/lib/bridge/synchronisation.js +49 -0
- package/lib/bridge/synchronisation.js.map +1 -0
- package/lib/bridge/transaction.d.ts +14 -0
- package/lib/bridge/transaction.d.ts.map +1 -0
- package/lib/bridge/transaction.js +47 -0
- package/lib/bridge/transaction.js.map +1 -0
- package/lib/config.d.ts +3 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +14 -0
- package/lib/config.js.map +1 -0
- package/lib/datasets/celo.scanAccounts.1.d.ts +5 -0
- package/lib/datasets/celo.scanAccounts.1.d.ts.map +1 -0
- package/lib/datasets/celo.scanAccounts.1.js +364 -0
- package/lib/datasets/celo.scanAccounts.1.js.map +1 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +6 -0
- package/lib/errors.js.map +1 -0
- package/lib/logic.d.ts +21 -0
- package/lib/logic.d.ts.map +1 -0
- package/lib/logic.js +97 -0
- package/lib/logic.js.map +1 -0
- package/lib/network/hubble.d.ts +12 -0
- package/lib/network/hubble.d.ts.map +1 -0
- package/lib/network/hubble.js +141 -0
- package/lib/network/hubble.js.map +1 -0
- package/lib/network/index.d.ts +4 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +23 -0
- package/lib/network/index.js.map +1 -0
- package/lib/network/sdk.d.ts +27 -0
- package/lib/network/sdk.d.ts.map +1 -0
- package/lib/network/sdk.js +93 -0
- package/lib/network/sdk.js.map +1 -0
- package/lib/network/validators.d.ts +2 -0
- package/lib/network/validators.d.ts.map +1 -0
- package/lib/network/validators.js +6 -0
- package/lib/network/validators.js.map +1 -0
- package/lib/signer/hw-getAddress.d.ts +6 -0
- package/lib/signer/hw-getAddress.d.ts.map +1 -0
- package/lib/signer/hw-getAddress.js +26 -0
- package/lib/signer/hw-getAddress.js.map +1 -0
- package/lib/signer/index.d.ts +2 -0
- package/lib/signer/index.d.ts.map +1 -0
- package/lib/signer/index.js +18 -0
- package/lib/signer/index.js.map +1 -0
- package/lib/signer/signer.d.ts +16 -0
- package/lib/signer/signer.d.ts.map +1 -0
- package/lib/signer/signer.js +3 -0
- package/lib/signer/signer.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 +42 -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 +14 -0
- package/lib/test/bridgeDatasetTest.js.map +1 -0
- package/lib/test/cli-transaction.d.ts +25 -0
- package/lib/test/cli-transaction.d.ts.map +1 -0
- package/lib/test/cli-transaction.js +56 -0
- package/lib/test/cli-transaction.js.map +1 -0
- package/lib/test/please-add-coverage.test.d.ts +2 -0
- package/lib/test/please-add-coverage.test.d.ts.map +1 -0
- package/lib/test/please-add-coverage.test.js +6 -0
- package/lib/test/please-add-coverage.test.js.map +1 -0
- package/lib/test/specs/createActivateVoteMutation.d.ts +4 -0
- package/lib/test/specs/createActivateVoteMutation.d.ts.map +1 -0
- package/lib/test/specs/createActivateVoteMutation.js +37 -0
- package/lib/test/specs/createActivateVoteMutation.js.map +1 -0
- package/lib/test/specs/createLockMutation.d.ts +4 -0
- package/lib/test/specs/createLockMutation.d.ts.map +1 -0
- package/lib/test/specs/createLockMutation.js +37 -0
- package/lib/test/specs/createLockMutation.js.map +1 -0
- package/lib/test/specs/createRegisterAccountMutation.d.ts +4 -0
- package/lib/test/specs/createRegisterAccountMutation.d.ts.map +1 -0
- package/lib/test/specs/createRegisterAccountMutation.js +31 -0
- package/lib/test/specs/createRegisterAccountMutation.js.map +1 -0
- package/lib/test/specs/createRevokeVoteMutation.d.ts +4 -0
- package/lib/test/specs/createRevokeVoteMutation.d.ts.map +1 -0
- package/lib/test/specs/createRevokeVoteMutation.js +38 -0
- package/lib/test/specs/createRevokeVoteMutation.js.map +1 -0
- package/lib/test/specs/createSendMutation.d.ts +6 -0
- package/lib/test/specs/createSendMutation.d.ts.map +1 -0
- package/lib/test/specs/createSendMutation.js +45 -0
- package/lib/test/specs/createSendMutation.js.map +1 -0
- package/lib/test/specs/createUnlockMutation.d.ts +4 -0
- package/lib/test/specs/createUnlockMutation.d.ts.map +1 -0
- package/lib/test/specs/createUnlockMutation.js +37 -0
- package/lib/test/specs/createUnlockMutation.js.map +1 -0
- package/lib/test/specs/createVoteMutation.d.ts +4 -0
- package/lib/test/specs/createVoteMutation.d.ts.map +1 -0
- package/lib/test/specs/createVoteMutation.js +48 -0
- package/lib/test/specs/createVoteMutation.js.map +1 -0
- package/lib/test/specs/createWithdrawMutation.d.ts +4 -0
- package/lib/test/specs/createWithdrawMutation.d.ts.map +1 -0
- package/lib/test/specs/createWithdrawMutation.js +37 -0
- package/lib/test/specs/createWithdrawMutation.js.map +1 -0
- package/lib/test/specs/index.d.ts +9 -0
- package/lib/test/specs/index.d.ts.map +1 -0
- package/lib/test/specs/index.js +25 -0
- package/lib/test/specs/index.js.map +1 -0
- package/lib/test/speculos-deviceActions.d.ts +4 -0
- package/lib/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib/test/speculos-deviceActions.js +58 -0
- package/lib/test/speculos-deviceActions.js.map +1 -0
- package/lib/types/index.d.ts +4 -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/types.d.ts +126 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/types.js +11 -0
- package/lib/types/types.js.map +1 -0
- package/lib-es/bridge/broadcast.d.ts +5 -0
- package/lib-es/bridge/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.js +9 -0
- package/lib-es/bridge/broadcast.js.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts +4 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.js +42 -0
- package/lib-es/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib-es/bridge/buildTransaction.d.ts +5 -0
- package/lib-es/bridge/buildTransaction.d.ts.map +1 -0
- package/lib-es/bridge/buildTransaction.js +140 -0
- package/lib-es/bridge/buildTransaction.js.map +1 -0
- package/lib-es/bridge/createTransaction.d.ts +5 -0
- package/lib-es/bridge/createTransaction.d.ts.map +1 -0
- package/lib-es/bridge/createTransaction.js +12 -0
- package/lib-es/bridge/createTransaction.js.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts +4 -0
- package/lib-es/bridge/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/bridge/deviceTransactionConfig.js +14 -0
- package/lib-es/bridge/deviceTransactionConfig.js.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts +5 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.js +16 -0
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/getFeesForTransaction.d.ts +8 -0
- package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -0
- package/lib-es/bridge/getFeesForTransaction.js +91 -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 +94 -0
- package/lib-es/bridge/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/index.d.ts +11 -0
- package/lib-es/bridge/index.d.ts.map +1 -0
- package/lib-es/bridge/index.js +54 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge/preload.d.ts +10 -0
- package/lib-es/bridge/preload.d.ts.map +1 -0
- package/lib-es/bridge/preload.js +64 -0
- package/lib-es/bridge/preload.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 +21 -0
- package/lib-es/bridge/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/serialization.d.ts +9 -0
- package/lib-es/bridge/serialization.d.ts.map +1 -0
- package/lib-es/bridge/serialization.js +84 -0
- package/lib-es/bridge/serialization.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts +10 -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 +5 -0
- package/lib-es/bridge/synchronisation.d.ts.map +1 -0
- package/lib-es/bridge/synchronisation.js +45 -0
- package/lib-es/bridge/synchronisation.js.map +1 -0
- package/lib-es/bridge/transaction.d.ts +14 -0
- package/lib-es/bridge/transaction.d.ts.map +1 -0
- package/lib-es/bridge/transaction.js +42 -0
- package/lib-es/bridge/transaction.js.map +1 -0
- package/lib-es/config.d.ts +3 -0
- package/lib-es/config.d.ts.map +1 -0
- package/lib-es/config.js +11 -0
- package/lib-es/config.js.map +1 -0
- package/lib-es/datasets/celo.scanAccounts.1.d.ts +5 -0
- package/lib-es/datasets/celo.scanAccounts.1.d.ts.map +1 -0
- package/lib-es/datasets/celo.scanAccounts.1.js +359 -0
- package/lib-es/datasets/celo.scanAccounts.1.js.map +1 -0
- package/lib-es/errors.d.ts +4 -0
- package/lib-es/errors.d.ts.map +1 -0
- package/lib-es/errors.js +3 -0
- package/lib-es/errors.js.map +1 -0
- package/lib-es/logic.d.ts +21 -0
- package/lib-es/logic.d.ts.map +1 -0
- package/lib-es/logic.js +77 -0
- package/lib-es/logic.js.map +1 -0
- package/lib-es/network/hubble.d.ts +12 -0
- package/lib-es/network/hubble.d.ts.map +1 -0
- package/lib-es/network/hubble.js +133 -0
- package/lib-es/network/hubble.js.map +1 -0
- package/lib-es/network/index.d.ts +4 -0
- package/lib-es/network/index.d.ts.map +1 -0
- package/lib-es/network/index.js +4 -0
- package/lib-es/network/index.js.map +1 -0
- package/lib-es/network/sdk.d.ts +27 -0
- package/lib-es/network/sdk.d.ts.map +1 -0
- package/lib-es/network/sdk.js +85 -0
- package/lib-es/network/sdk.js.map +1 -0
- package/lib-es/network/validators.d.ts +2 -0
- package/lib-es/network/validators.d.ts.map +1 -0
- package/lib-es/network/validators.js +2 -0
- package/lib-es/network/validators.js.map +1 -0
- package/lib-es/signer/hw-getAddress.d.ts +6 -0
- package/lib-es/signer/hw-getAddress.d.ts.map +1 -0
- package/lib-es/signer/hw-getAddress.js +21 -0
- package/lib-es/signer/hw-getAddress.js.map +1 -0
- package/lib-es/signer/index.d.ts +2 -0
- package/lib-es/signer/index.d.ts.map +1 -0
- package/lib-es/signer/index.js +2 -0
- package/lib-es/signer/index.js.map +1 -0
- package/lib-es/signer/signer.d.ts +16 -0
- package/lib-es/signer/signer.d.ts.map +1 -0
- package/lib-es/signer/signer.js +2 -0
- package/lib-es/signer/signer.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 +40 -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 +8 -0
- package/lib-es/test/bridgeDatasetTest.js.map +1 -0
- package/lib-es/test/cli-transaction.d.ts +25 -0
- package/lib-es/test/cli-transaction.d.ts.map +1 -0
- package/lib-es/test/cli-transaction.js +50 -0
- package/lib-es/test/cli-transaction.js.map +1 -0
- package/lib-es/test/please-add-coverage.test.d.ts +1 -0
- package/lib-es/test/please-add-coverage.test.d.ts.map +1 -0
- package/lib-es/test/please-add-coverage.test.js +5 -0
- package/lib-es/test/please-add-coverage.test.js.map +1 -0
- package/lib-es/test/specs/createActivateVoteMutation.d.ts +4 -0
- package/lib-es/test/specs/createActivateVoteMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createActivateVoteMutation.js +30 -0
- package/lib-es/test/specs/createActivateVoteMutation.js.map +1 -0
- package/lib-es/test/specs/createLockMutation.d.ts +4 -0
- package/lib-es/test/specs/createLockMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createLockMutation.js +30 -0
- package/lib-es/test/specs/createLockMutation.js.map +1 -0
- package/lib-es/test/specs/createRegisterAccountMutation.d.ts +4 -0
- package/lib-es/test/specs/createRegisterAccountMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createRegisterAccountMutation.js +24 -0
- package/lib-es/test/specs/createRegisterAccountMutation.js.map +1 -0
- package/lib-es/test/specs/createRevokeVoteMutation.d.ts +4 -0
- package/lib-es/test/specs/createRevokeVoteMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createRevokeVoteMutation.js +31 -0
- package/lib-es/test/specs/createRevokeVoteMutation.js.map +1 -0
- package/lib-es/test/specs/createSendMutation.d.ts +6 -0
- package/lib-es/test/specs/createSendMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createSendMutation.js +37 -0
- package/lib-es/test/specs/createSendMutation.js.map +1 -0
- package/lib-es/test/specs/createUnlockMutation.d.ts +4 -0
- package/lib-es/test/specs/createUnlockMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createUnlockMutation.js +30 -0
- package/lib-es/test/specs/createUnlockMutation.js.map +1 -0
- package/lib-es/test/specs/createVoteMutation.d.ts +4 -0
- package/lib-es/test/specs/createVoteMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createVoteMutation.js +41 -0
- package/lib-es/test/specs/createVoteMutation.js.map +1 -0
- package/lib-es/test/specs/createWithdrawMutation.d.ts +4 -0
- package/lib-es/test/specs/createWithdrawMutation.d.ts.map +1 -0
- package/lib-es/test/specs/createWithdrawMutation.js +30 -0
- package/lib-es/test/specs/createWithdrawMutation.js.map +1 -0
- package/lib-es/test/specs/index.d.ts +9 -0
- package/lib-es/test/specs/index.d.ts.map +1 -0
- package/lib-es/test/specs/index.js +9 -0
- package/lib-es/test/specs/index.js.map +1 -0
- package/lib-es/test/speculos-deviceActions.d.ts +4 -0
- package/lib-es/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib-es/test/speculos-deviceActions.js +55 -0
- package/lib-es/test/speculos-deviceActions.js.map +1 -0
- package/lib-es/types/index.d.ts +4 -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/types.d.ts +126 -0
- package/lib-es/types/types.d.ts.map +1 -0
- package/lib-es/types/types.js +7 -0
- package/lib-es/types/types.js.map +1 -0
- package/package.json +156 -0
- package/src/bridge/broadcast.ts +14 -0
- package/src/bridge/buildOptimisticOperation.ts +53 -0
- package/src/bridge/buildTransaction.ts +154 -0
- package/src/bridge/createTransaction.ts +15 -0
- package/src/bridge/deviceTransactionConfig.ts +19 -0
- package/src/bridge/estimateMaxSpendable.ts +22 -0
- package/src/bridge/getFeesForTransaction.ts +115 -0
- package/src/bridge/getTransactionStatus.ts +120 -0
- package/src/bridge/index.ts +77 -0
- package/src/bridge/preload.ts +75 -0
- package/src/bridge/prepareTransaction.ts +33 -0
- package/src/bridge/serialization.ts +114 -0
- package/src/bridge/signOperation.ts +121 -0
- package/src/bridge/synchronisation.ts +60 -0
- package/src/bridge/transaction.ts +53 -0
- package/src/config.ts +12 -0
- package/src/datasets/celo.scanAccounts.1.ts +370 -0
- package/src/errors.ts +3 -0
- package/src/logic.ts +146 -0
- package/src/network/hubble.ts +183 -0
- package/src/network/index.ts +3 -0
- package/src/network/sdk.ts +101 -0
- package/src/network/validators.ts +1 -0
- package/src/signer/hw-getAddress.ts +27 -0
- package/src/signer/index.ts +1 -0
- package/src/signer/signer.ts +36 -0
- package/src/test/bot-specs.ts +55 -0
- package/src/test/bridgeDatasetTest.ts +10 -0
- package/src/test/cli-transaction.ts +70 -0
- package/src/test/please-add-coverage.test.ts +3 -0
- package/src/test/specs/createActivateVoteMutation.ts +37 -0
- package/src/test/specs/createLockMutation.ts +38 -0
- package/src/test/specs/createRegisterAccountMutation.ts +35 -0
- package/src/test/specs/createRevokeVoteMutation.ts +38 -0
- package/src/test/specs/createSendMutation.ts +41 -0
- package/src/test/specs/createUnlockMutation.ts +35 -0
- package/src/test/specs/createVoteMutation.ts +55 -0
- package/src/test/specs/createWithdrawMutation.ts +37 -0
- package/src/test/specs/index.ts +8 -0
- package/src/test/speculos-deviceActions.ts +63 -0
- package/src/types/index.ts +3 -0
- package/src/types/types.ts +155 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { DeviceAction } from "@ledgerhq/coin-framework/bot/types";
|
|
2
|
+
import type { Transaction } from "../types";
|
|
3
|
+
import {
|
|
4
|
+
deviceActionFlow,
|
|
5
|
+
formatDeviceAmount,
|
|
6
|
+
SpeculosButton,
|
|
7
|
+
} from "@ledgerhq/coin-framework/bot/specs";
|
|
8
|
+
|
|
9
|
+
const typeWording = {
|
|
10
|
+
send: "Send",
|
|
11
|
+
lock: "Lock",
|
|
12
|
+
unlock: "Unlock",
|
|
13
|
+
withdraw: "Withdraw",
|
|
14
|
+
vote: "Vote",
|
|
15
|
+
revoke: "Revoke",
|
|
16
|
+
activate: "Activate",
|
|
17
|
+
register: "Create Account",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const acceptTransaction: DeviceAction<Transaction, any> = deviceActionFlow({
|
|
21
|
+
steps: [
|
|
22
|
+
{
|
|
23
|
+
title: "Review",
|
|
24
|
+
button: SpeculosButton.RIGHT,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: "Amount",
|
|
28
|
+
button: SpeculosButton.RIGHT,
|
|
29
|
+
expectedValue: ({ account, status }) =>
|
|
30
|
+
formatDeviceAmount(account.currency, status.amount, {
|
|
31
|
+
forceFloating: true,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: "Address",
|
|
36
|
+
button: SpeculosButton.RIGHT,
|
|
37
|
+
expectedValue: ({ transaction }) => transaction.recipient,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Max Fees",
|
|
41
|
+
button: SpeculosButton.RIGHT,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "No Gateway Fee",
|
|
45
|
+
button: SpeculosButton.RIGHT,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "Validator",
|
|
49
|
+
button: SpeculosButton.RIGHT,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: "Type",
|
|
53
|
+
button: SpeculosButton.RIGHT,
|
|
54
|
+
expectedValue: ({ transaction }) => {
|
|
55
|
+
return typeWording[transaction.mode];
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: "Accept",
|
|
60
|
+
button: SpeculosButton.BOTH,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
});
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Account,
|
|
3
|
+
AccountRaw,
|
|
4
|
+
Operation,
|
|
5
|
+
OperationExtra,
|
|
6
|
+
OperationExtraRaw,
|
|
7
|
+
OperationRaw,
|
|
8
|
+
TransactionCommon,
|
|
9
|
+
TransactionCommonRaw,
|
|
10
|
+
TransactionStatusCommon,
|
|
11
|
+
TransactionStatusCommonRaw,
|
|
12
|
+
} from "@ledgerhq/types-live";
|
|
13
|
+
import { BigNumber } from "bignumber.js";
|
|
14
|
+
|
|
15
|
+
export type CeloOperationMode =
|
|
16
|
+
| "send"
|
|
17
|
+
| "lock"
|
|
18
|
+
| "unlock"
|
|
19
|
+
| "withdraw"
|
|
20
|
+
| "vote"
|
|
21
|
+
| "revoke"
|
|
22
|
+
| "activate"
|
|
23
|
+
| "register";
|
|
24
|
+
|
|
25
|
+
export type CeloVoteType = "pending" | "active";
|
|
26
|
+
export type CeloVoteStatus = CeloVoteType | "awaitingActivation";
|
|
27
|
+
|
|
28
|
+
export type CeloPendingWithdrawal = {
|
|
29
|
+
value: BigNumber;
|
|
30
|
+
time: BigNumber;
|
|
31
|
+
index: number;
|
|
32
|
+
};
|
|
33
|
+
export type CeloPendingWithdrawalRaw = {
|
|
34
|
+
value: string;
|
|
35
|
+
time: string;
|
|
36
|
+
index: string;
|
|
37
|
+
};
|
|
38
|
+
export type CeloResources = {
|
|
39
|
+
registrationStatus: boolean;
|
|
40
|
+
lockedBalance: BigNumber;
|
|
41
|
+
nonvotingLockedBalance: BigNumber;
|
|
42
|
+
pendingWithdrawals: CeloPendingWithdrawal[] | null | undefined;
|
|
43
|
+
votes: CeloVote[] | null | undefined;
|
|
44
|
+
electionAddress: string | null | undefined;
|
|
45
|
+
lockedGoldAddress: string | null | undefined;
|
|
46
|
+
maxNumGroupsVotedFor: BigNumber;
|
|
47
|
+
};
|
|
48
|
+
export type CeloResourcesRaw = {
|
|
49
|
+
registrationStatus: boolean;
|
|
50
|
+
lockedBalance: string;
|
|
51
|
+
nonvotingLockedBalance: string;
|
|
52
|
+
pendingWithdrawals: CeloPendingWithdrawalRaw[] | null | undefined;
|
|
53
|
+
votes: CeloVoteRaw[] | null | undefined;
|
|
54
|
+
electionAddress: string | null | undefined;
|
|
55
|
+
lockedGoldAddress: string | null | undefined;
|
|
56
|
+
maxNumGroupsVotedFor: string;
|
|
57
|
+
};
|
|
58
|
+
export type Transaction = TransactionCommon & {
|
|
59
|
+
family: "celo";
|
|
60
|
+
fees: BigNumber | null | undefined;
|
|
61
|
+
mode: CeloOperationMode;
|
|
62
|
+
index: number | null | undefined;
|
|
63
|
+
};
|
|
64
|
+
export type TransactionRaw = TransactionCommonRaw & {
|
|
65
|
+
family: "celo";
|
|
66
|
+
fees: string | null | undefined;
|
|
67
|
+
mode: CeloOperationMode;
|
|
68
|
+
index: number | null | undefined;
|
|
69
|
+
};
|
|
70
|
+
export type CeloValidatorGroup = {
|
|
71
|
+
address: string;
|
|
72
|
+
name: string;
|
|
73
|
+
votes: BigNumber;
|
|
74
|
+
};
|
|
75
|
+
export type CeloVote = {
|
|
76
|
+
validatorGroup: string;
|
|
77
|
+
amount: BigNumber;
|
|
78
|
+
activatable: boolean;
|
|
79
|
+
revokable: boolean;
|
|
80
|
+
type: CeloVoteType;
|
|
81
|
+
index: number;
|
|
82
|
+
};
|
|
83
|
+
export type CeloVoteRaw = {
|
|
84
|
+
validatorGroup: string;
|
|
85
|
+
amount: string;
|
|
86
|
+
activatable: boolean;
|
|
87
|
+
revokable: boolean;
|
|
88
|
+
type: CeloVoteType;
|
|
89
|
+
index: number;
|
|
90
|
+
};
|
|
91
|
+
export type FigmentIndexerTransaction = {
|
|
92
|
+
id: number;
|
|
93
|
+
height: number;
|
|
94
|
+
time: string;
|
|
95
|
+
transaction_hash: string;
|
|
96
|
+
address: string;
|
|
97
|
+
amount: number;
|
|
98
|
+
kind: string;
|
|
99
|
+
data?: {
|
|
100
|
+
Raw?: {
|
|
101
|
+
data: string;
|
|
102
|
+
topics: Array<string>;
|
|
103
|
+
address: string;
|
|
104
|
+
removed: boolean;
|
|
105
|
+
logIndex: string;
|
|
106
|
+
blockHash: string;
|
|
107
|
+
blockNumber: string;
|
|
108
|
+
transactionHash: string;
|
|
109
|
+
transactionIndex: string;
|
|
110
|
+
};
|
|
111
|
+
gas: number;
|
|
112
|
+
Account?: string;
|
|
113
|
+
Group?: string;
|
|
114
|
+
success?: boolean;
|
|
115
|
+
from?: string;
|
|
116
|
+
to?: string;
|
|
117
|
+
gas_used: number;
|
|
118
|
+
gas_price: number;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type CeloPreloadData = {
|
|
123
|
+
validatorGroups: CeloValidatorGroup[];
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type TransactionStatus = TransactionStatusCommon;
|
|
127
|
+
|
|
128
|
+
export type TransactionStatusRaw = TransactionStatusCommonRaw;
|
|
129
|
+
|
|
130
|
+
export type CeloAccount = Account & { celoResources: CeloResources };
|
|
131
|
+
|
|
132
|
+
export type CeloAccountRaw = AccountRaw & { celoResources: CeloResourcesRaw };
|
|
133
|
+
|
|
134
|
+
export type PendingStakingOperationAmounts = {
|
|
135
|
+
vote: BigNumber;
|
|
136
|
+
lock: BigNumber;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type CeloOperation = Operation<CeloOperationExtra>;
|
|
140
|
+
export type CeloOperationRaw = OperationRaw<CeloOperationExtraRaw>;
|
|
141
|
+
|
|
142
|
+
export type CeloOperationExtra = {
|
|
143
|
+
celoOperationValue: BigNumber;
|
|
144
|
+
celoSourceValidator?: string;
|
|
145
|
+
};
|
|
146
|
+
export function isCeloOperationExtra(op: OperationExtra): op is CeloOperationExtra {
|
|
147
|
+
return op !== null && typeof op === "object" && "celoOperationValue" in op;
|
|
148
|
+
}
|
|
149
|
+
export type CeloOperationExtraRaw = {
|
|
150
|
+
celoOperationValue: string;
|
|
151
|
+
celoSourceValidator?: string;
|
|
152
|
+
};
|
|
153
|
+
export function isCeloOperationExtraRaw(op: OperationExtraRaw): op is CeloOperationExtraRaw {
|
|
154
|
+
return op !== null && typeof op === "object" && "celoOperationValue" in op;
|
|
155
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"downlevelIteration": true,
|
|
7
|
+
"lib": ["es2020", "dom"],
|
|
8
|
+
"outDir": "lib",
|
|
9
|
+
"exactOptionalPropertyTypes": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["src/**/*"]
|
|
12
|
+
}
|