@ledgerhq/coin-cardano 0.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 +20 -0
- package/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +35 -0
- package/CHANGELOG.md +19 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +8 -0
- package/lib/account.d.ts +7 -0
- package/lib/account.d.ts.map +1 -0
- package/lib/account.js +41 -0
- package/lib/account.js.map +1 -0
- package/lib/address.unit.test.d.ts +2 -0
- package/lib/address.unit.test.d.ts.map +1 -0
- package/lib/address.unit.test.js +21 -0
- package/lib/address.unit.test.js.map +1 -0
- package/lib/api/api-types.d.ts +106 -0
- package/lib/api/api-types.d.ts.map +1 -0
- package/lib/api/api-types.js +9 -0
- package/lib/api/api-types.js.map +1 -0
- package/lib/api/getDelegationInfo.d.ts +4 -0
- package/lib/api/getDelegationInfo.d.ts.map +1 -0
- package/lib/api/getDelegationInfo.js +48 -0
- package/lib/api/getDelegationInfo.js.map +1 -0
- package/lib/api/getNetworkInfo.d.ts +5 -0
- package/lib/api/getNetworkInfo.d.ts.map +1 -0
- package/lib/api/getNetworkInfo.js +46 -0
- package/lib/api/getNetworkInfo.js.map +1 -0
- package/lib/api/getPools.d.ts +5 -0
- package/lib/api/getPools.d.ts.map +1 -0
- package/lib/api/getPools.js +45 -0
- package/lib/api/getPools.js.map +1 -0
- package/lib/api/getTransactions.d.ts +10 -0
- package/lib/api/getTransactions.d.ts.map +1 -0
- package/lib/api/getTransactions.js +139 -0
- package/lib/api/getTransactions.js.map +1 -0
- package/lib/api/submitTransaction.d.ts +7 -0
- package/lib/api/submitTransaction.d.ts.map +1 -0
- package/lib/api/submitTransaction.js +34 -0
- package/lib/api/submitTransaction.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 +70 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge.integration.test.d.ts +4 -0
- package/lib/bridge.integration.test.d.ts.map +1 -0
- package/lib/bridge.integration.test.js +113 -0
- package/lib/bridge.integration.test.js.map +1 -0
- package/lib/broadcast.d.ts +8 -0
- package/lib/broadcast.d.ts.map +1 -0
- package/lib/broadcast.js +28 -0
- package/lib/broadcast.js.map +1 -0
- package/lib/buildOptimisticOperation.d.ts +4 -0
- package/lib/buildOptimisticOperation.d.ts.map +1 -0
- package/lib/buildOptimisticOperation.js +125 -0
- package/lib/buildOptimisticOperation.js.map +1 -0
- package/lib/buildSubAccounts.d.ts +26 -0
- package/lib/buildSubAccounts.d.ts.map +1 -0
- package/lib/buildSubAccounts.js +124 -0
- package/lib/buildSubAccounts.js.map +1 -0
- package/lib/buildTransaction.d.ts +11 -0
- package/lib/buildTransaction.d.ts.map +1 -0
- package/lib/buildTransaction.js +342 -0
- package/lib/buildTransaction.js.map +1 -0
- package/lib/cli-transaction.d.ts +18 -0
- package/lib/cli-transaction.d.ts.map +1 -0
- package/lib/cli-transaction.js +66 -0
- package/lib/cli-transaction.js.map +1 -0
- package/lib/constants.d.ts +8 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +12 -0
- package/lib/constants.js.map +1 -0
- package/lib/createTransaction.d.ts +9 -0
- package/lib/createTransaction.d.ts.map +1 -0
- package/lib/createTransaction.js +23 -0
- package/lib/createTransaction.js.map +1 -0
- package/lib/datasets/rawAccount.1.d.ts +3 -0
- package/lib/datasets/rawAccount.1.d.ts.map +1 -0
- package/lib/datasets/rawAccount.1.js +20 -0
- package/lib/datasets/rawAccount.1.js.map +1 -0
- package/lib/datasets/scanAccounts.d.ts +5 -0
- package/lib/datasets/scanAccounts.d.ts.map +1 -0
- package/lib/datasets/scanAccounts.js +27 -0
- package/lib/datasets/scanAccounts.js.map +1 -0
- package/lib/deviceTransactionConfig.d.ts +11 -0
- package/lib/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/deviceTransactionConfig.js +106 -0
- package/lib/deviceTransactionConfig.js.map +1 -0
- package/lib/errors.d.ts +22 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +18 -0
- package/lib/errors.js.map +1 -0
- package/lib/estimateMaxSpendable.d.ts +9 -0
- package/lib/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/estimateMaxSpendable.js +53 -0
- package/lib/estimateMaxSpendable.js.map +1 -0
- package/lib/getTransactionStatus.d.ts +4 -0
- package/lib/getTransactionStatus.d.ts.map +1 -0
- package/lib/getTransactionStatus.js +214 -0
- package/lib/getTransactionStatus.js.map +1 -0
- package/lib/getTransactionStatus.unit.test.d.ts +2 -0
- package/lib/getTransactionStatus.unit.test.d.ts.map +1 -0
- package/lib/getTransactionStatus.unit.test.js +54 -0
- package/lib/getTransactionStatus.unit.test.js.map +1 -0
- package/lib/hw-getAddress.d.ts +6 -0
- package/lib/hw-getAddress.d.ts.map +1 -0
- package/lib/hw-getAddress.js +37 -0
- package/lib/hw-getAddress.js.map +1 -0
- package/lib/logic.d.ts +88 -0
- package/lib/logic.d.ts.map +1 -0
- package/lib/logic.js +264 -0
- package/lib/logic.js.map +1 -0
- package/lib/logic.unit.test.d.ts +2 -0
- package/lib/logic.unit.test.d.ts.map +1 -0
- package/lib/logic.unit.test.js +40 -0
- package/lib/logic.unit.test.js.map +1 -0
- package/lib/networks.d.ts +3 -0
- package/lib/networks.d.ts.map +1 -0
- package/lib/networks.js +36 -0
- package/lib/networks.js.map +1 -0
- package/lib/postSyncPatch.d.ts +6 -0
- package/lib/postSyncPatch.d.ts.map +1 -0
- package/lib/postSyncPatch.js +35 -0
- package/lib/postSyncPatch.js.map +1 -0
- package/lib/prepareTransaction.d.ts +10 -0
- package/lib/prepareTransaction.d.ts.map +1 -0
- package/lib/prepareTransaction.js +44 -0
- package/lib/prepareTransaction.js.map +1 -0
- package/lib/serialization.d.ts +7 -0
- package/lib/serialization.d.ts.map +1 -0
- package/lib/serialization.js +146 -0
- package/lib/serialization.js.map +1 -0
- package/lib/signOperation.d.ts +9 -0
- package/lib/signOperation.d.ts.map +1 -0
- package/lib/signOperation.js +71 -0
- package/lib/signOperation.js.map +1 -0
- package/lib/signer.d.ts +92 -0
- package/lib/signer.d.ts.map +1 -0
- package/lib/signer.js +3 -0
- package/lib/signer.js.map +1 -0
- package/lib/specs.d.ts +7 -0
- package/lib/specs.d.ts.map +1 -0
- package/lib/specs.js +218 -0
- package/lib/specs.js.map +1 -0
- package/lib/speculos-deviceActions.d.ts +4 -0
- package/lib/speculos-deviceActions.d.ts.map +1 -0
- package/lib/speculos-deviceActions.js +128 -0
- package/lib/speculos-deviceActions.js.map +1 -0
- package/lib/synchronisation.d.ts +6 -0
- package/lib/synchronisation.d.ts.map +1 -0
- package/lib/synchronisation.js +237 -0
- package/lib/synchronisation.js.map +1 -0
- package/lib/synchronisation.unit.test.d.ts +2 -0
- package/lib/synchronisation.unit.test.d.ts.map +1 -0
- package/lib/synchronisation.unit.test.js +129 -0
- package/lib/synchronisation.unit.test.js.map +1 -0
- package/lib/transaction.d.ts +15 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +43 -0
- package/lib/transaction.js.map +1 -0
- package/lib/types.d.ts +188 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +18 -0
- package/lib/types.js.map +1 -0
- package/lib/typhonSerializer.d.ts +17 -0
- package/lib/typhonSerializer.d.ts.map +1 -0
- package/lib/typhonSerializer.js +213 -0
- package/lib/typhonSerializer.js.map +1 -0
- package/lib/utils.d.ts +2 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +8 -0
- package/lib/utils.js.map +1 -0
- package/lib-es/account.d.ts +7 -0
- package/lib-es/account.d.ts.map +1 -0
- package/lib-es/account.js +34 -0
- package/lib-es/account.js.map +1 -0
- package/lib-es/address.unit.test.d.ts +2 -0
- package/lib-es/address.unit.test.d.ts.map +1 -0
- package/lib-es/address.unit.test.js +19 -0
- package/lib-es/address.unit.test.js.map +1 -0
- package/lib-es/api/api-types.d.ts +106 -0
- package/lib-es/api/api-types.d.ts.map +1 -0
- package/lib-es/api/api-types.js +6 -0
- package/lib-es/api/api-types.js.map +1 -0
- package/lib-es/api/getDelegationInfo.d.ts +4 -0
- package/lib-es/api/getDelegationInfo.d.ts.map +1 -0
- package/lib-es/api/getDelegationInfo.js +41 -0
- package/lib-es/api/getDelegationInfo.js.map +1 -0
- package/lib-es/api/getNetworkInfo.d.ts +5 -0
- package/lib-es/api/getNetworkInfo.d.ts.map +1 -0
- package/lib-es/api/getNetworkInfo.js +39 -0
- package/lib-es/api/getNetworkInfo.js.map +1 -0
- package/lib-es/api/getPools.d.ts +5 -0
- package/lib-es/api/getPools.d.ts.map +1 -0
- package/lib-es/api/getPools.js +37 -0
- package/lib-es/api/getPools.js.map +1 -0
- package/lib-es/api/getTransactions.d.ts +10 -0
- package/lib-es/api/getTransactions.d.ts.map +1 -0
- package/lib-es/api/getTransactions.js +132 -0
- package/lib-es/api/getTransactions.js.map +1 -0
- package/lib-es/api/submitTransaction.d.ts +7 -0
- package/lib-es/api/submitTransaction.d.ts.map +1 -0
- package/lib-es/api/submitTransaction.js +27 -0
- package/lib-es/api/submitTransaction.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 +61 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge.integration.test.d.ts +4 -0
- package/lib-es/bridge.integration.test.d.ts.map +1 -0
- package/lib-es/bridge.integration.test.js +107 -0
- package/lib-es/bridge.integration.test.js.map +1 -0
- package/lib-es/broadcast.d.ts +8 -0
- package/lib-es/broadcast.d.ts.map +1 -0
- package/lib-es/broadcast.js +24 -0
- package/lib-es/broadcast.js.map +1 -0
- package/lib-es/buildOptimisticOperation.d.ts +4 -0
- package/lib-es/buildOptimisticOperation.d.ts.map +1 -0
- package/lib-es/buildOptimisticOperation.js +118 -0
- package/lib-es/buildOptimisticOperation.js.map +1 -0
- package/lib-es/buildSubAccounts.d.ts +26 -0
- package/lib-es/buildSubAccounts.d.ts.map +1 -0
- package/lib-es/buildSubAccounts.js +114 -0
- package/lib-es/buildSubAccounts.js.map +1 -0
- package/lib-es/buildTransaction.d.ts +11 -0
- package/lib-es/buildTransaction.d.ts.map +1 -0
- package/lib-es/buildTransaction.js +335 -0
- package/lib-es/buildTransaction.js.map +1 -0
- package/lib-es/cli-transaction.d.ts +18 -0
- package/lib-es/cli-transaction.d.ts.map +1 -0
- package/lib-es/cli-transaction.js +60 -0
- package/lib-es/cli-transaction.js.map +1 -0
- package/lib-es/constants.d.ts +8 -0
- package/lib-es/constants.d.ts.map +1 -0
- package/lib-es/constants.js +9 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/createTransaction.d.ts +9 -0
- package/lib-es/createTransaction.d.ts.map +1 -0
- package/lib-es/createTransaction.js +16 -0
- package/lib-es/createTransaction.js.map +1 -0
- package/lib-es/datasets/rawAccount.1.d.ts +3 -0
- package/lib-es/datasets/rawAccount.1.d.ts.map +1 -0
- package/lib-es/datasets/rawAccount.1.js +17 -0
- package/lib-es/datasets/rawAccount.1.js.map +1 -0
- package/lib-es/datasets/scanAccounts.d.ts +5 -0
- package/lib-es/datasets/scanAccounts.d.ts.map +1 -0
- package/lib-es/datasets/scanAccounts.js +24 -0
- package/lib-es/datasets/scanAccounts.js.map +1 -0
- package/lib-es/deviceTransactionConfig.d.ts +11 -0
- package/lib-es/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/deviceTransactionConfig.js +101 -0
- package/lib-es/deviceTransactionConfig.js.map +1 -0
- package/lib-es/errors.d.ts +22 -0
- package/lib-es/errors.d.ts.map +1 -0
- package/lib-es/errors.js +15 -0
- package/lib-es/errors.js.map +1 -0
- package/lib-es/estimateMaxSpendable.d.ts +9 -0
- package/lib-es/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/estimateMaxSpendable.js +49 -0
- package/lib-es/estimateMaxSpendable.js.map +1 -0
- package/lib-es/getTransactionStatus.d.ts +4 -0
- package/lib-es/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/getTransactionStatus.js +210 -0
- package/lib-es/getTransactionStatus.js.map +1 -0
- package/lib-es/getTransactionStatus.unit.test.d.ts +2 -0
- package/lib-es/getTransactionStatus.unit.test.d.ts.map +1 -0
- package/lib-es/getTransactionStatus.unit.test.js +49 -0
- package/lib-es/getTransactionStatus.unit.test.js.map +1 -0
- package/lib-es/hw-getAddress.d.ts +6 -0
- package/lib-es/hw-getAddress.d.ts.map +1 -0
- package/lib-es/hw-getAddress.js +35 -0
- package/lib-es/hw-getAddress.js.map +1 -0
- package/lib-es/logic.d.ts +88 -0
- package/lib-es/logic.d.ts.map +1 -0
- package/lib-es/logic.js +236 -0
- package/lib-es/logic.js.map +1 -0
- package/lib-es/logic.unit.test.d.ts +2 -0
- package/lib-es/logic.unit.test.d.ts.map +1 -0
- package/lib-es/logic.unit.test.js +35 -0
- package/lib-es/logic.unit.test.js.map +1 -0
- package/lib-es/networks.d.ts +3 -0
- package/lib-es/networks.d.ts.map +1 -0
- package/lib-es/networks.js +32 -0
- package/lib-es/networks.js.map +1 -0
- package/lib-es/postSyncPatch.d.ts +6 -0
- package/lib-es/postSyncPatch.d.ts.map +1 -0
- package/lib-es/postSyncPatch.js +31 -0
- package/lib-es/postSyncPatch.js.map +1 -0
- package/lib-es/prepareTransaction.d.ts +10 -0
- package/lib-es/prepareTransaction.d.ts.map +1 -0
- package/lib-es/prepareTransaction.js +40 -0
- package/lib-es/prepareTransaction.js.map +1 -0
- package/lib-es/serialization.d.ts +7 -0
- package/lib-es/serialization.d.ts.map +1 -0
- package/lib-es/serialization.js +139 -0
- package/lib-es/serialization.js.map +1 -0
- package/lib-es/signOperation.d.ts +9 -0
- package/lib-es/signOperation.d.ts.map +1 -0
- package/lib-es/signOperation.js +64 -0
- package/lib-es/signOperation.js.map +1 -0
- package/lib-es/signer.d.ts +92 -0
- package/lib-es/signer.d.ts.map +1 -0
- package/lib-es/signer.js +2 -0
- package/lib-es/signer.js.map +1 -0
- package/lib-es/specs.d.ts +7 -0
- package/lib-es/specs.d.ts.map +1 -0
- package/lib-es/specs.js +213 -0
- package/lib-es/specs.js.map +1 -0
- package/lib-es/speculos-deviceActions.d.ts +4 -0
- package/lib-es/speculos-deviceActions.d.ts.map +1 -0
- package/lib-es/speculos-deviceActions.js +125 -0
- package/lib-es/speculos-deviceActions.js.map +1 -0
- package/lib-es/synchronisation.d.ts +6 -0
- package/lib-es/synchronisation.d.ts.map +1 -0
- package/lib-es/synchronisation.js +230 -0
- package/lib-es/synchronisation.js.map +1 -0
- package/lib-es/synchronisation.unit.test.d.ts +2 -0
- package/lib-es/synchronisation.unit.test.d.ts.map +1 -0
- package/lib-es/synchronisation.unit.test.js +124 -0
- package/lib-es/synchronisation.unit.test.js.map +1 -0
- package/lib-es/transaction.d.ts +15 -0
- package/lib-es/transaction.d.ts.map +1 -0
- package/lib-es/transaction.js +37 -0
- package/lib-es/transaction.js.map +1 -0
- package/lib-es/types.d.ts +188 -0
- package/lib-es/types.d.ts.map +1 -0
- package/lib-es/types.js +15 -0
- package/lib-es/types.js.map +1 -0
- package/lib-es/typhonSerializer.d.ts +17 -0
- package/lib-es/typhonSerializer.d.ts.map +1 -0
- package/lib-es/typhonSerializer.js +207 -0
- package/lib-es/typhonSerializer.js.map +1 -0
- package/lib-es/utils.d.ts +2 -0
- package/lib-es/utils.d.ts.map +1 -0
- package/lib-es/utils.js +5 -0
- package/lib-es/utils.js.map +1 -0
- package/package.json +91 -0
- package/src/account.ts +39 -0
- package/src/address.unit.test.ts +32 -0
- package/src/api/api-types.ts +115 -0
- package/src/api/getDelegationInfo.ts +39 -0
- package/src/api/getNetworkInfo.ts +34 -0
- package/src/api/getPools.ts +35 -0
- package/src/api/getTransactions.ts +218 -0
- package/src/api/submitTransaction.ts +24 -0
- package/src/bridge/index.ts +69 -0
- package/src/bridge.integration.test.ts +113 -0
- package/src/broadcast.ts +21 -0
- package/src/buildOptimisticOperation.ts +181 -0
- package/src/buildSubAccounts.ts +170 -0
- package/src/buildTransaction.ts +435 -0
- package/src/cli-transaction.ts +82 -0
- package/src/constants.ts +10 -0
- package/src/createTransaction.ts +18 -0
- package/src/datasets/rawAccount.1.ts +19 -0
- package/src/datasets/scanAccounts.ts +23 -0
- package/src/deviceTransactionConfig.ts +128 -0
- package/src/errors.ts +18 -0
- package/src/estimateMaxSpendable.ts +61 -0
- package/src/getTransactionStatus.ts +251 -0
- package/src/getTransactionStatus.unit.test.ts +45 -0
- package/src/hw-getAddress.ts +37 -0
- package/src/logic.ts +330 -0
- package/src/logic.unit.test.ts +39 -0
- package/src/networks.ts +33 -0
- package/src/postSyncPatch.ts +42 -0
- package/src/prepareTransaction.ts +41 -0
- package/src/serialization.ts +219 -0
- package/src/signOperation.ts +82 -0
- package/src/signer.ts +98 -0
- package/src/specs.ts +253 -0
- package/src/speculos-deviceActions.ts +132 -0
- package/src/synchronisation.ts +347 -0
- package/src/synchronisation.unit.test.ts +137 -0
- package/src/transaction.ts +66 -0
- package/src/types.ts +227 -0
- package/src/typhonSerializer.ts +259 -0
- package/src/utils.ts +4 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { FeeNotLoaded } from "@ledgerhq/errors";
|
|
3
|
+
import { Bip32PublicKey } from "@stricahq/bip32ed25519";
|
|
4
|
+
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
5
|
+
import { AccountBridge, SignOperationEvent } from "@ledgerhq/types-live";
|
|
6
|
+
import { Transaction as TyphonTransaction, types as TyphonTypes } from "@stricahq/typhonjs";
|
|
7
|
+
import { buildOptimisticOperation } from "./buildOptimisticOperation";
|
|
8
|
+
import type { CardanoAccount, Transaction } from "./types";
|
|
9
|
+
import { getExtendedPublicKeyFromHex } from "./logic";
|
|
10
|
+
import { buildTransaction } from "./buildTransaction";
|
|
11
|
+
import { getNetworkParameters } from "./networks";
|
|
12
|
+
import { CardanoSigner, Witness } from "./signer";
|
|
13
|
+
import typhonSerializer from "./typhonSerializer";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sign Transaction with Ledger hardware
|
|
17
|
+
*/
|
|
18
|
+
export const buildSignOperation =
|
|
19
|
+
(
|
|
20
|
+
signerContext: SignerContext<CardanoSigner>,
|
|
21
|
+
): AccountBridge<Transaction, CardanoAccount>["signOperation"] =>
|
|
22
|
+
({ account, deviceId, transaction }): Observable<SignOperationEvent> =>
|
|
23
|
+
new Observable(o => {
|
|
24
|
+
async function main() {
|
|
25
|
+
o.next({ type: "device-signature-requested" });
|
|
26
|
+
|
|
27
|
+
if (!transaction.fees) {
|
|
28
|
+
throw new FeeNotLoaded();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const unsignedTransaction = await buildTransaction(account, transaction);
|
|
32
|
+
const signerTransaction = typhonSerializer(unsignedTransaction, account.index);
|
|
33
|
+
|
|
34
|
+
const networkParams = getNetworkParameters(account.currency.id);
|
|
35
|
+
const signedData = await signerContext(deviceId, signer =>
|
|
36
|
+
signer.sign({
|
|
37
|
+
transaction: signerTransaction,
|
|
38
|
+
networkParams,
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const accountPubKey = getExtendedPublicKeyFromHex(account.xpub as string);
|
|
43
|
+
const signed = signTx(unsignedTransaction, accountPubKey, signedData.witnesses);
|
|
44
|
+
|
|
45
|
+
o.next({ type: "device-signature-granted" });
|
|
46
|
+
|
|
47
|
+
const operation = buildOptimisticOperation(account, unsignedTransaction, transaction);
|
|
48
|
+
|
|
49
|
+
o.next({
|
|
50
|
+
type: "signed",
|
|
51
|
+
signedOperation: {
|
|
52
|
+
operation,
|
|
53
|
+
signature: signed.payload,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
main().then(
|
|
58
|
+
() => o.complete(),
|
|
59
|
+
e => o.error(e),
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Adds signatures to unsigned transaction
|
|
65
|
+
*/
|
|
66
|
+
const signTx = (
|
|
67
|
+
unsignedTransaction: TyphonTransaction,
|
|
68
|
+
accountKey: Bip32PublicKey,
|
|
69
|
+
witnesses: Array<Witness>,
|
|
70
|
+
) => {
|
|
71
|
+
witnesses.forEach(witness => {
|
|
72
|
+
const [, , , chainType, index] = witness.path;
|
|
73
|
+
const publicKey = accountKey.derive(chainType).derive(index).toPublicKey().toBytes();
|
|
74
|
+
const vKeyWitness: TyphonTypes.VKeyWitness = {
|
|
75
|
+
signature: Buffer.from(witness.witnessSignatureHex, "hex"),
|
|
76
|
+
publicKey: Buffer.from(publicKey),
|
|
77
|
+
};
|
|
78
|
+
unsignedTransaction.addWitness(vKeyWitness);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return unsignedTransaction.buildTransaction();
|
|
82
|
+
};
|
package/src/signer.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { CardanoLikeNetworkParameters } from "./types";
|
|
2
|
+
|
|
3
|
+
export type CardanoAddress = {
|
|
4
|
+
addressHex: string;
|
|
5
|
+
};
|
|
6
|
+
// Coming from @cardano-foundation/ledgerjs-hw-app-cardano code (type SignedTransactionData)
|
|
7
|
+
type BIP32Path = Array<number>;
|
|
8
|
+
export type Witness = {
|
|
9
|
+
path: BIP32Path;
|
|
10
|
+
witnessSignatureHex: string;
|
|
11
|
+
};
|
|
12
|
+
export type CardanoSignature = {
|
|
13
|
+
txHashHex: string;
|
|
14
|
+
witnesses: Array<Witness>;
|
|
15
|
+
};
|
|
16
|
+
// Coming from @cardano-foundation/ledgerjs-hw-app-cardano code (type ExtendedPublicKey)
|
|
17
|
+
export type CardanoExtendedPublicKey = {
|
|
18
|
+
publicKeyHex: string;
|
|
19
|
+
chainCodeHex: string;
|
|
20
|
+
};
|
|
21
|
+
export type GetAddressRequest = {
|
|
22
|
+
path: string;
|
|
23
|
+
stakingPathString: string;
|
|
24
|
+
networkParams: CardanoLikeNetworkParameters;
|
|
25
|
+
verify?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type SignerTxInput = {
|
|
29
|
+
txHashHex: string;
|
|
30
|
+
outputIndex: number;
|
|
31
|
+
path: string | null;
|
|
32
|
+
};
|
|
33
|
+
export type SignerTxOutput = {
|
|
34
|
+
amount: string;
|
|
35
|
+
destination:
|
|
36
|
+
| {
|
|
37
|
+
isDeviceOwnedAddress: false;
|
|
38
|
+
params: {
|
|
39
|
+
addressHex: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
isDeviceOwnedAddress: true;
|
|
44
|
+
params: {
|
|
45
|
+
spendingPath: string;
|
|
46
|
+
stakingPath: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
tokenBundle: Array<{
|
|
50
|
+
policyIdHex: string;
|
|
51
|
+
tokens: Array<{
|
|
52
|
+
assetNameHex: string;
|
|
53
|
+
amount: string;
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
export type SignerTxCertificate =
|
|
58
|
+
| {
|
|
59
|
+
type: "REGISTRATION" | "DEREGISTRATION";
|
|
60
|
+
params: {
|
|
61
|
+
stakeCredential: {
|
|
62
|
+
keyPath: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
type: "DELEGATION";
|
|
68
|
+
params: {
|
|
69
|
+
stakeCredential: {
|
|
70
|
+
keyPath: string;
|
|
71
|
+
};
|
|
72
|
+
poolKeyHashHex: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export type SignerTxWithdrawal = {
|
|
76
|
+
stakeCredential: {
|
|
77
|
+
keyPath: string;
|
|
78
|
+
};
|
|
79
|
+
amount: string;
|
|
80
|
+
};
|
|
81
|
+
export type SignerTransaction = {
|
|
82
|
+
inputs: Array<SignerTxInput>;
|
|
83
|
+
outputs: Array<SignerTxOutput>;
|
|
84
|
+
certificates: Array<SignerTxCertificate>;
|
|
85
|
+
withdrawals: Array<SignerTxWithdrawal>;
|
|
86
|
+
fee: string;
|
|
87
|
+
ttl?: string;
|
|
88
|
+
auxiliaryData: string | null;
|
|
89
|
+
};
|
|
90
|
+
export type CardanoSignRequest = {
|
|
91
|
+
transaction: SignerTransaction;
|
|
92
|
+
networkParams: CardanoLikeNetworkParameters;
|
|
93
|
+
};
|
|
94
|
+
export interface CardanoSigner {
|
|
95
|
+
getAddress(addressRequest: GetAddressRequest): Promise<CardanoAddress>;
|
|
96
|
+
getPublicKey(accountPath: string): Promise<CardanoExtendedPublicKey>;
|
|
97
|
+
sign(signRequest: CardanoSignRequest): Promise<CardanoSignature>;
|
|
98
|
+
}
|
package/src/specs.ts
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import expect from "expect";
|
|
2
|
+
import type { AppSpec } from "@ledgerhq/coin-framework/bot/types";
|
|
3
|
+
import type { CardanoAccount, CardanoOperationExtra, CardanoResources, Transaction } from "./types";
|
|
4
|
+
import { botTest, genericTestDestination, pickSiblings } from "@ledgerhq/coin-framework/bot/specs";
|
|
5
|
+
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
|
|
6
|
+
import { DeviceModelId } from "@ledgerhq/devices";
|
|
7
|
+
import BigNumber from "bignumber.js";
|
|
8
|
+
import invariant from "invariant";
|
|
9
|
+
import { utils as TyphonUtils } from "@stricahq/typhonjs";
|
|
10
|
+
import { mergeTokens } from "./logic";
|
|
11
|
+
import { formatCurrencyUnit, parseCurrencyUnit } from "@ledgerhq/coin-framework/currencies/index";
|
|
12
|
+
import { SubAccount } from "@ledgerhq/types-live";
|
|
13
|
+
import { acceptTransaction } from "./speculos-deviceActions";
|
|
14
|
+
|
|
15
|
+
const maxAccounts = 5;
|
|
16
|
+
const currency = getCryptoCurrencyById("cardano");
|
|
17
|
+
const minBalanceRequired = parseCurrencyUnit(currency.units[0], "2.2");
|
|
18
|
+
const minBalanceRequiredForMaxSend = parseCurrencyUnit(currency.units[0], "1");
|
|
19
|
+
const minBalanceRequiredForDelegate = parseCurrencyUnit(currency.units[0], "3");
|
|
20
|
+
const minSpendableRequiredForTokenTx = parseCurrencyUnit(currency.units[0], "1");
|
|
21
|
+
|
|
22
|
+
const cardano: AppSpec<Transaction> = {
|
|
23
|
+
name: "cardano",
|
|
24
|
+
currency: getCryptoCurrencyById("cardano"),
|
|
25
|
+
appQuery: {
|
|
26
|
+
model: DeviceModelId.nanoSP,
|
|
27
|
+
appName: "CardanoADA",
|
|
28
|
+
// FIXME latest (v7) app version requires to update cardano libs
|
|
29
|
+
appVersion: "6.1.2",
|
|
30
|
+
},
|
|
31
|
+
minViableAmount: minBalanceRequired,
|
|
32
|
+
genericDeviceAction: acceptTransaction,
|
|
33
|
+
testTimeout: 5 * 60 * 1000,
|
|
34
|
+
mutations: [
|
|
35
|
+
{
|
|
36
|
+
name: "move ~10% token",
|
|
37
|
+
maxRun: 1,
|
|
38
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
39
|
+
invariant(maxSpendable.gte(minSpendableRequiredForTokenTx), "balance is too low");
|
|
40
|
+
const sibling = pickSiblings(siblings, maxAccounts);
|
|
41
|
+
const recipient = sibling.freshAddress;
|
|
42
|
+
const transaction = bridge.createTransaction(account);
|
|
43
|
+
|
|
44
|
+
const subAccount = account.subAccounts?.find(subAccount =>
|
|
45
|
+
subAccount.balance.gt(1),
|
|
46
|
+
) as SubAccount;
|
|
47
|
+
invariant(subAccount, "No token account with balance");
|
|
48
|
+
|
|
49
|
+
const updates = [
|
|
50
|
+
{ subAccountId: subAccount.id },
|
|
51
|
+
{ recipient },
|
|
52
|
+
{
|
|
53
|
+
amount: new BigNumber(subAccount.balance.dividedBy(10)).dp(0, BigNumber.ROUND_CEIL),
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
transaction,
|
|
59
|
+
updates,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
test: ({ operation, transaction }): void => {
|
|
63
|
+
botTest("subOperations is defined", () => expect(operation.subOperations).toBeTruthy());
|
|
64
|
+
|
|
65
|
+
botTest("there's only one subOperation", () =>
|
|
66
|
+
expect(operation.subOperations?.length).toEqual(1),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const subOperation = operation.subOperations && operation.subOperations[0];
|
|
70
|
+
|
|
71
|
+
botTest("subOperation have correct tx amount", () =>
|
|
72
|
+
expect(subOperation?.value).toEqual(transaction.amount),
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
testDestination: genericTestDestination,
|
|
78
|
+
name: "move ~50%",
|
|
79
|
+
maxRun: 1,
|
|
80
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
81
|
+
invariant(maxSpendable.gt(minBalanceRequired), "balance is too low");
|
|
82
|
+
const sibling = pickSiblings(siblings, maxAccounts);
|
|
83
|
+
const recipient = sibling.freshAddress;
|
|
84
|
+
const transaction = bridge.createTransaction(account);
|
|
85
|
+
|
|
86
|
+
const updates = [
|
|
87
|
+
{ recipient },
|
|
88
|
+
{
|
|
89
|
+
amount: new BigNumber(account.balance.dividedBy(2)).dp(0, BigNumber.ROUND_CEIL),
|
|
90
|
+
},
|
|
91
|
+
{ memo: "LedgerLiveBot" },
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
transaction,
|
|
96
|
+
updates,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
test: ({ accountBeforeTransaction, operation, transaction }): void => {
|
|
100
|
+
const cardanoResources = (accountBeforeTransaction as CardanoAccount)
|
|
101
|
+
.cardanoResources as CardanoResources;
|
|
102
|
+
|
|
103
|
+
const extra: CardanoOperationExtra = {
|
|
104
|
+
memo: transaction.memo,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
if (cardanoResources.delegation?.rewards.gt(0)) {
|
|
108
|
+
extra.rewards = formatCurrencyUnit(
|
|
109
|
+
accountBeforeTransaction.currency.units[0],
|
|
110
|
+
new BigNumber(cardanoResources.delegation.rewards),
|
|
111
|
+
{
|
|
112
|
+
showCode: true,
|
|
113
|
+
disableRounding: true,
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
botTest("operation extra matches memo", () => expect(operation.extra).toEqual(extra));
|
|
119
|
+
|
|
120
|
+
botTest("optimistic value matches transaction amount", () =>
|
|
121
|
+
expect(transaction.amount).toEqual(operation.value.minus(operation.fee)),
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "send max",
|
|
127
|
+
maxRun: 1,
|
|
128
|
+
testDestination: genericTestDestination,
|
|
129
|
+
transaction: ({ account, siblings, bridge, maxSpendable }) => {
|
|
130
|
+
invariant(maxSpendable.gt(minBalanceRequiredForMaxSend), "balance is too low");
|
|
131
|
+
const sibling = pickSiblings(siblings, maxAccounts);
|
|
132
|
+
const recipient = sibling.freshAddress;
|
|
133
|
+
const transaction = bridge.createTransaction(account);
|
|
134
|
+
|
|
135
|
+
const updates = [{ recipient }, { useAllAmount: true }];
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
transaction,
|
|
139
|
+
updates,
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
test: ({ account }): void => {
|
|
143
|
+
const cardanoResources = (account as CardanoAccount).cardanoResources as CardanoResources;
|
|
144
|
+
const utxoTokens = cardanoResources.utxos.map(u => u.tokens).flat();
|
|
145
|
+
const tokenBalance = mergeTokens(utxoTokens);
|
|
146
|
+
const requiredAdaForTokens = tokenBalance.length
|
|
147
|
+
? TyphonUtils.calculateMinUtxoAmount(
|
|
148
|
+
tokenBalance,
|
|
149
|
+
new BigNumber(cardanoResources.protocolParams.lovelacePerUtxoWord),
|
|
150
|
+
false,
|
|
151
|
+
)
|
|
152
|
+
: new BigNumber(0);
|
|
153
|
+
|
|
154
|
+
botTest("remaining balance equals requiredAdaForTokens)", () =>
|
|
155
|
+
expect(account.balance).toEqual(requiredAdaForTokens),
|
|
156
|
+
);
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "delegate to pool",
|
|
161
|
+
maxRun: 1,
|
|
162
|
+
transaction: ({ account, bridge, maxSpendable }) => {
|
|
163
|
+
invariant(maxSpendable.gte(minBalanceRequiredForDelegate), "balance is too low");
|
|
164
|
+
const transaction = bridge.createTransaction(account);
|
|
165
|
+
return {
|
|
166
|
+
transaction,
|
|
167
|
+
updates: [
|
|
168
|
+
{
|
|
169
|
+
mode: "delegate",
|
|
170
|
+
poolId: "7df262feae9201d1b2e32d4c825ca91b29fbafb2b8e556f6efb7f549",
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
test: ({ operation, transaction, accountBeforeTransaction }): void => {
|
|
176
|
+
botTest("check delegate operation type", () => {
|
|
177
|
+
expect(operation.type).toEqual("DELEGATE");
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
botTest("check operation value", () => {
|
|
181
|
+
const cardanoResources = (accountBeforeTransaction as CardanoAccount).cardanoResources;
|
|
182
|
+
const isStakeKeyRegistered = cardanoResources.delegation?.status ?? false;
|
|
183
|
+
let opValue = transaction.fees as BigNumber;
|
|
184
|
+
if (!isStakeKeyRegistered) {
|
|
185
|
+
opValue = opValue.plus(cardanoResources.protocolParams.stakeKeyDeposit);
|
|
186
|
+
}
|
|
187
|
+
expect(operation.value.toString()).toEqual(opValue.toString());
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "redelegate to pool",
|
|
193
|
+
maxRun: 1,
|
|
194
|
+
transaction: ({ account, bridge, maxSpendable }) => {
|
|
195
|
+
invariant(maxSpendable.gte(minBalanceRequiredForDelegate), "balance is too low");
|
|
196
|
+
invariant(
|
|
197
|
+
(account as CardanoAccount).cardanoResources.delegation?.poolId,
|
|
198
|
+
"account should already be delegated to redelegate",
|
|
199
|
+
);
|
|
200
|
+
const transaction = bridge.createTransaction(account);
|
|
201
|
+
return {
|
|
202
|
+
transaction,
|
|
203
|
+
updates: [
|
|
204
|
+
{
|
|
205
|
+
mode: "delegate",
|
|
206
|
+
poolId: "da50099e7aa1d926e1888990b1c404caf554dd6f68a1cb0322999d1d",
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
test: ({ operation, transaction }): void => {
|
|
212
|
+
botTest("check delegate operation type", () => {
|
|
213
|
+
expect(operation.type).toEqual("DELEGATE");
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
botTest("op value should be equal to fees", () => {
|
|
217
|
+
expect(operation.value.toString()).toEqual(transaction.fees?.toString());
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "undelegate",
|
|
223
|
+
maxRun: 1,
|
|
224
|
+
transaction: ({ account, bridge, maxSpendable }) => {
|
|
225
|
+
invariant(maxSpendable.gte(minBalanceRequiredForDelegate), "balance is too low");
|
|
226
|
+
invariant(
|
|
227
|
+
(account as CardanoAccount).cardanoResources.delegation?.poolId,
|
|
228
|
+
"account should already be delegated to undelegate",
|
|
229
|
+
);
|
|
230
|
+
const transaction = bridge.createTransaction(account);
|
|
231
|
+
return {
|
|
232
|
+
transaction,
|
|
233
|
+
updates: [
|
|
234
|
+
{
|
|
235
|
+
mode: "undelegate",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
test: ({ operation, transaction }): void => {
|
|
241
|
+
botTest("check undelegate operation type", () => {
|
|
242
|
+
expect(operation.type).toEqual("UNDELEGATE");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
botTest("op value should be equal to fees", () => {
|
|
246
|
+
expect(operation.value.toString()).toEqual(transaction.fees?.toString());
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export default { cardano };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { DeviceAction } from "@ledgerhq/coin-framework/bot/types";
|
|
2
|
+
import type { Transaction } from "./types";
|
|
3
|
+
import { getAccountStakeCredential, getBipPathString } from "./logic";
|
|
4
|
+
import {
|
|
5
|
+
deviceActionFlow,
|
|
6
|
+
formatDeviceAmount,
|
|
7
|
+
SpeculosButton,
|
|
8
|
+
} from "@ledgerhq/coin-framework/bot/specs";
|
|
9
|
+
|
|
10
|
+
export const acceptTransaction: DeviceAction<Transaction, any> = deviceActionFlow({
|
|
11
|
+
steps: [
|
|
12
|
+
{
|
|
13
|
+
title: "New ordinary",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
title: "transaction?",
|
|
17
|
+
button: SpeculosButton.BOTH,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: "Warning:",
|
|
21
|
+
button: SpeculosButton.BOTH,
|
|
22
|
+
expectedValue: () => "cannot verify network id: no outputs or withrawals",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "Auxiliary data hash",
|
|
26
|
+
button: SpeculosButton.BOTH,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Send to address (1/3)",
|
|
30
|
+
button: SpeculosButton.RIGHT,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Send to address (2/3)",
|
|
34
|
+
button: SpeculosButton.RIGHT,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "Send to address (3/3)",
|
|
38
|
+
button: SpeculosButton.BOTH,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: "Send to address (1/2)",
|
|
42
|
+
button: SpeculosButton.RIGHT,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: "Send to address (2/2)",
|
|
46
|
+
button: SpeculosButton.BOTH,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "Send",
|
|
50
|
+
button: SpeculosButton.BOTH,
|
|
51
|
+
ignoreAssertionFailure: true,
|
|
52
|
+
expectedValue: ({ account, status }) => formatDeviceAmount(account.currency, status.amount),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: "Asset fingerprint",
|
|
56
|
+
button: SpeculosButton.BOTH,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: "Token amount",
|
|
60
|
+
button: SpeculosButton.BOTH,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: "Confirm",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: "output?",
|
|
67
|
+
button: SpeculosButton.BOTH,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: "Transaction fee",
|
|
71
|
+
button: SpeculosButton.BOTH,
|
|
72
|
+
ignoreAssertionFailure: true,
|
|
73
|
+
expectedValue: ({ account, status }) =>
|
|
74
|
+
formatDeviceAmount(account.currency, status.estimatedFees),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: "Register",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: "Deregister",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: "stake key",
|
|
84
|
+
button: SpeculosButton.BOTH,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "Stake key",
|
|
88
|
+
button: SpeculosButton.BOTH,
|
|
89
|
+
expectedValue: ({ account }) => {
|
|
90
|
+
const stakeCred = getAccountStakeCredential(account.xpub as string, account.index);
|
|
91
|
+
const bipPath = getBipPathString({
|
|
92
|
+
account: stakeCred.path.account,
|
|
93
|
+
chain: stakeCred.path.chain,
|
|
94
|
+
index: stakeCred.path.index,
|
|
95
|
+
});
|
|
96
|
+
return `m/${bipPath}`;
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: "Transaction TTL",
|
|
101
|
+
button: SpeculosButton.BOTH,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: "...",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: "registration?",
|
|
108
|
+
button: SpeculosButton.BOTH,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: "deregistration?",
|
|
112
|
+
button: SpeculosButton.BOTH,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: "Delegate stake (1/2)",
|
|
116
|
+
button: SpeculosButton.RIGHT,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: "Delegate stake (2/2)",
|
|
120
|
+
button: SpeculosButton.BOTH,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: "delegation?",
|
|
124
|
+
button: SpeculosButton.BOTH,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
title: "transaction?",
|
|
128
|
+
final: true,
|
|
129
|
+
button: SpeculosButton.BOTH,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
});
|