@ledgerhq/coin-celo 1.3.0 → 1.3.1-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/.unimportedrc.json +3 -6
- package/CHANGELOG.md +8 -0
- package/lib/__tests__/bridge/buildOptimisticOperation.test.d.ts +2 -0
- package/lib/__tests__/bridge/buildOptimisticOperation.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/buildOptimisticOperation.test.js +23 -0
- package/lib/__tests__/bridge/buildOptimisticOperation.test.js.map +1 -0
- package/lib/__tests__/bridge/buildTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/buildTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/buildTransaction.test.js +412 -0
- package/lib/__tests__/bridge/buildTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/createTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/createTransaction.test.js +22 -0
- package/lib/__tests__/bridge/createTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.js +21 -0
- package/lib/__tests__/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts +2 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.js +108 -0
- package/lib/__tests__/bridge/estimateMaxSpendable.test.js.map +1 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.js +211 -0
- package/lib/__tests__/bridge/getFeesForTransaction.test.js.map +1 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.d.ts +2 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.js +214 -0
- package/lib/__tests__/bridge/getTransactionStatus.test.js.map +1 -0
- package/lib/__tests__/bridge/logic.test.d.ts +2 -0
- package/lib/__tests__/bridge/logic.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/logic.test.js +490 -0
- package/lib/__tests__/bridge/logic.test.js.map +1 -0
- package/lib/__tests__/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib/__tests__/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib/__tests__/bridge/prepareTransaction.test.js +239 -0
- package/lib/__tests__/bridge/prepareTransaction.test.js.map +1 -0
- package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -1
- package/lib/bridge/buildOptimisticOperation.js +5 -2
- package/lib/bridge/buildOptimisticOperation.js.map +1 -1
- package/lib/bridge/buildTransaction.d.ts.map +1 -1
- package/lib/bridge/buildTransaction.js +29 -6
- package/lib/bridge/buildTransaction.js.map +1 -1
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/estimateMaxSpendable.js +9 -1
- package/lib/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/fixtures.d.ts +36 -0
- package/lib/bridge/fixtures.d.ts.map +1 -0
- package/lib/bridge/fixtures.js +98 -0
- package/lib/bridge/fixtures.js.map +1 -0
- package/lib/bridge/getFeesForTransaction.d.ts.map +1 -1
- package/lib/bridge/getFeesForTransaction.js +32 -5
- package/lib/bridge/getFeesForTransaction.js.map +1 -1
- package/lib/bridge/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/getTransactionStatus.js +18 -4
- package/lib/bridge/getTransactionStatus.js.map +1 -1
- package/lib/bridge/index.d.ts.map +1 -1
- package/lib/bridge/index.js.map +1 -1
- package/lib/bridge/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/prepareTransaction.js +33 -4
- package/lib/bridge/prepareTransaction.js.map +1 -1
- package/lib/bridge/signOperation.d.ts.map +1 -1
- package/lib/bridge/signOperation.js +11 -3
- package/lib/bridge/signOperation.js.map +1 -1
- package/lib/bridge/synchronisation.d.ts.map +1 -1
- package/lib/bridge/synchronisation.js +7 -3
- package/lib/bridge/synchronisation.js.map +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +8 -0
- package/lib/config.js.map +1 -1
- package/lib/constants.d.ts +6 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +15 -0
- package/lib/constants.js.map +1 -0
- package/lib/types/types.d.ts +1 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib-es/__tests__/bridge/buildOptimisticOperation.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/buildOptimisticOperation.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/buildOptimisticOperation.test.js +18 -0
- package/lib-es/__tests__/bridge/buildOptimisticOperation.test.js.map +1 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.js +407 -0
- package/lib-es/__tests__/bridge/buildTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/createTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/createTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/createTransaction.test.js +17 -0
- package/lib-es/__tests__/bridge/createTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js +16 -0
- package/lib-es/__tests__/bridge/deviceTransactionConfig.test.js.map +1 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js +103 -0
- package/lib-es/__tests__/bridge/estimateMaxSpendable.test.js.map +1 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.js +206 -0
- package/lib-es/__tests__/bridge/getFeesForTransaction.test.js.map +1 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.js +209 -0
- package/lib-es/__tests__/bridge/getTransactionStatus.test.js.map +1 -0
- package/lib-es/__tests__/bridge/logic.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/logic.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/logic.test.js +485 -0
- package/lib-es/__tests__/bridge/logic.test.js.map +1 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts +2 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.d.ts.map +1 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.js +234 -0
- package/lib-es/__tests__/bridge/prepareTransaction.test.js.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -1
- package/lib-es/bridge/buildOptimisticOperation.js +5 -2
- package/lib-es/bridge/buildOptimisticOperation.js.map +1 -1
- package/lib-es/bridge/buildTransaction.d.ts.map +1 -1
- package/lib-es/bridge/buildTransaction.js +29 -6
- package/lib-es/bridge/buildTransaction.js.map +1 -1
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/estimateMaxSpendable.js +10 -2
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/fixtures.d.ts +36 -0
- package/lib-es/bridge/fixtures.d.ts.map +1 -0
- package/lib-es/bridge/fixtures.js +89 -0
- package/lib-es/bridge/fixtures.js.map +1 -0
- package/lib-es/bridge/getFeesForTransaction.d.ts.map +1 -1
- package/lib-es/bridge/getFeesForTransaction.js +29 -5
- package/lib-es/bridge/getFeesForTransaction.js.map +1 -1
- package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/getTransactionStatus.js +18 -4
- package/lib-es/bridge/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/index.d.ts.map +1 -1
- package/lib-es/bridge/index.js.map +1 -1
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/prepareTransaction.js +33 -4
- 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 +11 -3
- package/lib-es/bridge/signOperation.js.map +1 -1
- package/lib-es/bridge/synchronisation.d.ts.map +1 -1
- package/lib-es/bridge/synchronisation.js +7 -3
- package/lib-es/bridge/synchronisation.js.map +1 -1
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/config.js +8 -0
- package/lib-es/config.js.map +1 -1
- package/lib-es/constants.d.ts +6 -0
- package/lib-es/constants.d.ts.map +1 -0
- package/lib-es/constants.js +11 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/types/types.d.ts +1 -0
- package/lib-es/types/types.d.ts.map +1 -1
- package/lib-es/types/types.js.map +1 -1
- package/package.json +9 -8
- package/src/__tests__/bridge/buildOptimisticOperation.test.ts +29 -0
- package/src/__tests__/bridge/buildTransaction.test.ts +502 -0
- package/src/__tests__/bridge/createTransaction.test.ts +17 -0
- package/src/__tests__/bridge/deviceTransactionConfig.test.ts +16 -0
- package/src/__tests__/bridge/estimateMaxSpendable.test.ts +112 -0
- package/src/__tests__/bridge/getFeesForTransaction.test.ts +233 -0
- package/src/__tests__/bridge/getTransactionStatus.test.ts +261 -0
- package/src/__tests__/bridge/logic.test.ts +538 -0
- package/src/__tests__/bridge/prepareTransaction.test.ts +261 -0
- package/src/bridge/buildOptimisticOperation.ts +6 -2
- package/src/bridge/buildTransaction.ts +38 -7
- package/src/bridge/estimateMaxSpendable.ts +18 -2
- package/src/bridge/fixtures.ts +103 -0
- package/src/bridge/getFeesForTransaction.ts +39 -5
- package/src/bridge/getTransactionStatus.ts +21 -4
- package/src/bridge/index.ts +0 -1
- package/src/bridge/prepareTransaction.ts +39 -6
- package/src/bridge/signOperation.ts +19 -4
- package/src/bridge/synchronisation.ts +10 -4
- package/src/config.ts +8 -0
- package/src/constants.ts +15 -0
- package/src/logic.ts +1 -1
- package/src/types/types.ts +1 -0
- package/lib/test/please-add-coverage.test.d.ts +0 -2
- package/lib/test/please-add-coverage.test.d.ts.map +0 -1
- package/lib/test/please-add-coverage.test.js +0 -6
- package/lib/test/please-add-coverage.test.js.map +0 -1
- package/lib-es/test/please-add-coverage.test.d.ts +0 -1
- package/lib-es/test/please-add-coverage.test.d.ts.map +0 -1
- package/lib-es/test/please-add-coverage.test.js +0 -5
- package/lib-es/test/please-add-coverage.test.js.map +0 -1
- package/src/test/please-add-coverage.test.ts +0 -3
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
1
|
import { AccountBridge } from "@ledgerhq/types-live";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
3
|
import { isValidAddress } from "@celo/utils/lib/address";
|
|
4
4
|
import getFeesForTransaction from "./getFeesForTransaction";
|
|
5
5
|
import { CeloAccount, Transaction } from "../types";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { findSubAccountById } from "@ledgerhq/coin-framework/account/index";
|
|
7
|
+
import { CELO_STABLE_TOKENS, MAX_PRIORITY_FEE_PER_GAS } from "../constants";
|
|
8
|
+
import { celoKit } from "../network/sdk";
|
|
8
9
|
|
|
9
10
|
export const prepareTransaction: AccountBridge<
|
|
10
11
|
Transaction,
|
|
11
12
|
CeloAccount
|
|
12
13
|
>["prepareTransaction"] = async (account, transaction) => {
|
|
14
|
+
const kit = celoKit();
|
|
15
|
+
|
|
13
16
|
if (transaction.recipient && !isValidAddress(transaction.recipient)) return transaction;
|
|
14
17
|
|
|
15
18
|
if (["send", "vote"].includes(transaction.mode) && !transaction.recipient) return transaction;
|
|
@@ -23,11 +26,41 @@ export const prepareTransaction: AccountBridge<
|
|
|
23
26
|
|
|
24
27
|
const fees = await getFeesForTransaction({ account, transaction });
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const tokenAccount = findSubAccountById(account, transaction.subAccountId || "");
|
|
30
|
+
const isTokenTransaction = tokenAccount?.type === "TokenAccount";
|
|
31
|
+
|
|
32
|
+
const amount =
|
|
33
|
+
transaction.useAllAmount && isTokenTransaction ? tokenAccount.balance : transaction.amount;
|
|
34
|
+
|
|
35
|
+
let token;
|
|
36
|
+
if (isTokenTransaction) {
|
|
37
|
+
if (CELO_STABLE_TOKENS.includes(tokenAccount.token.id)) {
|
|
38
|
+
token = await kit.contracts.getStableToken();
|
|
39
|
+
} else {
|
|
40
|
+
token = await kit.contracts.getErc20(tokenAccount.token.contractAddress);
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
token = await kit.contracts.getGoldToken();
|
|
28
44
|
}
|
|
29
45
|
|
|
30
|
-
|
|
46
|
+
const block = await kit.connection.web3.eth.getBlock("latest");
|
|
47
|
+
const baseFee = BigInt(block.baseFeePerGas || MAX_PRIORITY_FEE_PER_GAS);
|
|
48
|
+
const maxFeePerGas = baseFee + MAX_PRIORITY_FEE_PER_GAS;
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
...transaction,
|
|
52
|
+
amount,
|
|
53
|
+
fees,
|
|
54
|
+
maxFeePerGas: maxFeePerGas.toString(),
|
|
55
|
+
maxPriorityFeePerGas: await kit.connection.getMaxPriorityFeePerGas(),
|
|
56
|
+
...(isTokenTransaction
|
|
57
|
+
? {
|
|
58
|
+
data: Buffer.from(
|
|
59
|
+
token.transfer(transaction.recipient, amount.toFixed()).txo.encodeABI(),
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
: {}),
|
|
63
|
+
};
|
|
31
64
|
};
|
|
32
65
|
|
|
33
66
|
export default prepareTransaction;
|
|
@@ -3,7 +3,7 @@ import { Observable } from "rxjs";
|
|
|
3
3
|
import { FeeNotLoaded } from "@ledgerhq/errors";
|
|
4
4
|
import type { Account, AccountBridge, DeviceId, SignOperationEvent } from "@ledgerhq/types-live";
|
|
5
5
|
import { encodeTransaction, recoverTransaction } from "@celo/wallet-base";
|
|
6
|
-
|
|
6
|
+
import { findSubAccountById } from "@ledgerhq/coin-framework/account/index";
|
|
7
7
|
import { buildOptimisticOperation } from "./buildOptimisticOperation";
|
|
8
8
|
import type { Transaction, CeloAccount } from "../types/types";
|
|
9
9
|
import buildTransaction from "./buildTransaction";
|
|
@@ -11,6 +11,7 @@ import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
|
11
11
|
import { EvmSignature } from "@ledgerhq/coin-evm/types/signer";
|
|
12
12
|
import { determineFees } from "../network/sdk";
|
|
13
13
|
import { CeloSigner } from "../signer";
|
|
14
|
+
import { CeloTx } from "@celo/connect";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Sign Transaction with Ledger hardware
|
|
@@ -33,15 +34,29 @@ export const buildSignOperation =
|
|
|
33
34
|
const { fees } = transaction;
|
|
34
35
|
if (!fees) throw new FeeNotLoaded();
|
|
35
36
|
const unsignedTransaction = await buildTransaction(account as CeloAccount, transaction);
|
|
37
|
+
|
|
36
38
|
const { chainId, to } = unsignedTransaction;
|
|
37
39
|
|
|
40
|
+
const subAccount = findSubAccountById(account, transaction.subAccountId ?? "");
|
|
41
|
+
const isTokenTransaction = subAccount?.type === "TokenAccount";
|
|
42
|
+
|
|
38
43
|
await signerContext(deviceId, signer => {
|
|
39
|
-
return signer.verifyTokenInfo(
|
|
44
|
+
return signer.verifyTokenInfo(
|
|
45
|
+
isTokenTransaction ? subAccount.token.contractAddress : to!,
|
|
46
|
+
chainId!,
|
|
47
|
+
);
|
|
40
48
|
});
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
const finalTransaction: CeloTx = {
|
|
51
|
+
...unsignedTransaction,
|
|
52
|
+
to: isTokenTransaction ? subAccount.token.contractAddress : to!,
|
|
53
|
+
value: isTokenTransaction ? 0 : unsignedTransaction.value!,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
await determineFees(finalTransaction);
|
|
42
57
|
|
|
43
58
|
const rlpEncodedTransaction = await signerContext(deviceId, signer => {
|
|
44
|
-
return signer.rlpEncodedTxForLedger(
|
|
59
|
+
return signer.rlpEncodedTxForLedger(finalTransaction);
|
|
45
60
|
});
|
|
46
61
|
o.next({ type: "device-signature-requested" });
|
|
47
62
|
|
|
@@ -5,10 +5,11 @@ import { encodeAccountId } from "@ledgerhq/coin-framework/account";
|
|
|
5
5
|
import { getAccountDetails } from "../network";
|
|
6
6
|
import { CeloAccount } from "../types/types";
|
|
7
7
|
import { celoKit } from "../network/sdk";
|
|
8
|
+
import { getAccountShape as evmGetAccountShape } from "@ledgerhq/coin-evm/bridge/synchronization";
|
|
8
9
|
|
|
9
10
|
const kit = celoKit();
|
|
10
11
|
|
|
11
|
-
export const getAccountShape: GetAccountShape<CeloAccount> = async info => {
|
|
12
|
+
export const getAccountShape: GetAccountShape<CeloAccount> = async (info, config) => {
|
|
12
13
|
const { address, currency, initialAccount, derivationMode } = info;
|
|
13
14
|
const oldOperations = initialAccount?.operations || [];
|
|
14
15
|
const election = await kit.contracts.getElection();
|
|
@@ -36,13 +37,18 @@ export const getAccountShape: GetAccountShape<CeloAccount> = async info => {
|
|
|
36
37
|
|
|
37
38
|
const votes = accountRegistrationStatus ? await getVotes(address) : [];
|
|
38
39
|
|
|
40
|
+
const fromEvm = await evmGetAccountShape(info, config);
|
|
41
|
+
|
|
39
42
|
const operations = mergeOps(oldOperations, newOperations);
|
|
40
|
-
|
|
43
|
+
|
|
44
|
+
const shape: Partial<CeloAccount> = {
|
|
41
45
|
id: accountId,
|
|
42
46
|
balance,
|
|
43
|
-
spendableBalance,
|
|
44
|
-
operationsCount: operations.length,
|
|
45
47
|
blockHeight,
|
|
48
|
+
operationsCount: operations.length,
|
|
49
|
+
spendableBalance,
|
|
50
|
+
subAccounts: fromEvm.subAccounts || [],
|
|
51
|
+
syncHash: fromEvm.syncHash,
|
|
46
52
|
celoResources: {
|
|
47
53
|
registrationStatus: accountRegistrationStatus,
|
|
48
54
|
lockedBalance,
|
package/src/config.ts
CHANGED
|
@@ -7,6 +7,14 @@ export const celoConfig: Record<string, ConfigInfo> = {
|
|
|
7
7
|
status: {
|
|
8
8
|
type: "active",
|
|
9
9
|
},
|
|
10
|
+
node: {
|
|
11
|
+
type: "external",
|
|
12
|
+
uri: "https://celo.coin.ledger.com/archive",
|
|
13
|
+
},
|
|
14
|
+
explorer: {
|
|
15
|
+
type: "blockscout",
|
|
16
|
+
uri: "https://celo.blockscout.com/api",
|
|
17
|
+
},
|
|
10
18
|
},
|
|
11
19
|
},
|
|
12
20
|
};
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StableToken } from "@celo/contractkit";
|
|
2
|
+
|
|
3
|
+
const CELO_STAKE_TOKENS_PAIR: Record<string, StableToken> = {
|
|
4
|
+
cEUR: StableToken.cEUR,
|
|
5
|
+
cREAL: StableToken.cREAL,
|
|
6
|
+
cUSD: StableToken.cUSD,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const CELO_STABLE_TOKENS = Object.keys(CELO_STAKE_TOKENS_PAIR);
|
|
10
|
+
|
|
11
|
+
export const getStableTokenEnum = (tokenTicker: string): StableToken =>
|
|
12
|
+
CELO_STAKE_TOKENS_PAIR[tokenTicker];
|
|
13
|
+
|
|
14
|
+
export const MAX_PRIORITY_FEE_PER_GAS = 1_000_000_000n;
|
|
15
|
+
export const MAX_FEES_THRESHOLD_MULTIPLIER = 4;
|
package/src/logic.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PendingStakingOperationAmounts,
|
|
8
8
|
} from "./types/types";
|
|
9
9
|
import { BigNumber } from "bignumber.js";
|
|
10
|
-
import { Operation } from "@ledgerhq/types-live";
|
|
10
|
+
import { Account, Operation, TokenAccount } from "@ledgerhq/types-live";
|
|
11
11
|
|
|
12
12
|
export const PRELOAD_MAX_AGE = 10 * 60 * 1000; // 10 minutes, used for max age in preload strategy
|
|
13
13
|
const LEDGER_BY_FIGMENT_VALIDATOR_GROUP_ADDRESS = "0x0861a61Bf679A30680510EcC238ee43B82C5e843";
|
package/src/types/types.ts
CHANGED
|
@@ -60,6 +60,7 @@ export type Transaction = TransactionCommon & {
|
|
|
60
60
|
fees: BigNumber | null | undefined;
|
|
61
61
|
mode: CeloOperationMode;
|
|
62
62
|
index: number | null | undefined;
|
|
63
|
+
data?: Buffer | null | undefined;
|
|
63
64
|
};
|
|
64
65
|
export type TransactionRaw = TransactionCommonRaw & {
|
|
65
66
|
family: "celo";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"please-add-coverage.test.d.ts","sourceRoot":"","sources":["../../src/test/please-add-coverage.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"please-add-coverage.test.js","sourceRoot":"","sources":["../../src/test/please-add-coverage.test.ts"],"names":[],"mappings":";;AAAA,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=please-add-coverage.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"please-add-coverage.test.d.ts","sourceRoot":"","sources":["../../src/test/please-add-coverage.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"please-add-coverage.test.js","sourceRoot":"","sources":["../../src/test/please-add-coverage.test.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
|