@ledgerhq/coin-ton 0.15.0-nightly.6 → 0.15.0-nightly.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +18 -0
- package/package.json +6 -6
- package/lib/__tests__/fixtures/api.fixtures.d.ts +0 -4
- package/lib/__tests__/fixtures/api.fixtures.d.ts.map +0 -1
- package/lib/__tests__/fixtures/api.fixtures.js +0 -37
- package/lib/__tests__/fixtures/api.fixtures.js.map +0 -1
- package/lib/__tests__/fixtures/common.fixtures.d.ts +0 -32
- package/lib/__tests__/fixtures/common.fixtures.d.ts.map +0 -1
- package/lib/__tests__/fixtures/common.fixtures.js +0 -176
- package/lib/__tests__/fixtures/common.fixtures.js.map +0 -1
- package/lib/__tests__/integration/bridge.integration.test.d.ts +0 -14
- package/lib/__tests__/integration/bridge.integration.test.d.ts.map +0 -1
- package/lib/__tests__/integration/bridge.integration.test.js +0 -213
- package/lib/__tests__/integration/bridge.integration.test.js.map +0 -1
- package/lib/__tests__/unit/api.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/api.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/api.unit.test.js +0 -77
- package/lib/__tests__/unit/api.unit.test.js.map +0 -1
- package/lib/__tests__/unit/broadcast.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/broadcast.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/broadcast.unit.test.js +0 -37
- package/lib/__tests__/unit/broadcast.unit.test.js.map +0 -1
- package/lib/__tests__/unit/createTransaction.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/createTransaction.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/createTransaction.unit.test.js +0 -25
- package/lib/__tests__/unit/createTransaction.unit.test.js.map +0 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -111
- package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +0 -1
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js +0 -30
- package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +0 -1
- package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js +0 -120
- package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +0 -1
- package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/hw-getAddress.unit.test.js +0 -54
- package/lib/__tests__/unit/hw-getAddress.unit.test.js.map +0 -1
- package/lib/__tests__/unit/logic.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/logic.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/logic.unit.test.js +0 -18
- package/lib/__tests__/unit/logic.unit.test.js.map +0 -1
- package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/prepareTransaction.unit.test.js +0 -109
- package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +0 -1
- package/lib/__tests__/unit/signOperation.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/signOperation.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/signOperation.unit.test.js +0 -72
- package/lib/__tests__/unit/signOperation.unit.test.js.map +0 -1
- package/lib/__tests__/unit/txn.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/txn.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/txn.unit.test.js +0 -298
- package/lib/__tests__/unit/txn.unit.test.js.map +0 -1
- package/lib/__tests__/unit/utils.unit.test.d.ts +0 -2
- package/lib/__tests__/unit/utils.unit.test.d.ts.map +0 -1
- package/lib/__tests__/unit/utils.unit.test.js +0 -211
- package/lib/__tests__/unit/utils.unit.test.js.map +0 -1
- package/lib/transaction.unit.test.d.ts +0 -2
- package/lib/transaction.unit.test.d.ts.map +0 -1
- package/lib/transaction.unit.test.js +0 -663
- package/lib/transaction.unit.test.js.map +0 -1
- package/lib-es/__tests__/fixtures/api.fixtures.d.ts +0 -4
- package/lib-es/__tests__/fixtures/api.fixtures.d.ts.map +0 -1
- package/lib-es/__tests__/fixtures/api.fixtures.js +0 -34
- package/lib-es/__tests__/fixtures/api.fixtures.js.map +0 -1
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts +0 -32
- package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +0 -1
- package/lib-es/__tests__/fixtures/common.fixtures.js +0 -170
- package/lib-es/__tests__/fixtures/common.fixtures.js.map +0 -1
- package/lib-es/__tests__/integration/bridge.integration.test.d.ts +0 -14
- package/lib-es/__tests__/integration/bridge.integration.test.d.ts.map +0 -1
- package/lib-es/__tests__/integration/bridge.integration.test.js +0 -207
- package/lib-es/__tests__/integration/bridge.integration.test.js.map +0 -1
- package/lib-es/__tests__/unit/api.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/api.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/api.unit.test.js +0 -52
- package/lib-es/__tests__/unit/api.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/broadcast.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/broadcast.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/broadcast.unit.test.js +0 -32
- package/lib-es/__tests__/unit/broadcast.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/createTransaction.unit.test.js +0 -20
- package/lib-es/__tests__/unit/createTransaction.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -106
- package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js +0 -25
- package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js +0 -115
- package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.js +0 -49
- package/lib-es/__tests__/unit/hw-getAddress.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/logic.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/logic.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/logic.unit.test.js +0 -16
- package/lib-es/__tests__/unit/logic.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js +0 -81
- package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/signOperation.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/signOperation.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/signOperation.unit.test.js +0 -67
- package/lib-es/__tests__/unit/signOperation.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/txn.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/txn.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/txn.unit.test.js +0 -293
- package/lib-es/__tests__/unit/txn.unit.test.js.map +0 -1
- package/lib-es/__tests__/unit/utils.unit.test.d.ts +0 -2
- package/lib-es/__tests__/unit/utils.unit.test.d.ts.map +0 -1
- package/lib-es/__tests__/unit/utils.unit.test.js +0 -186
- package/lib-es/__tests__/unit/utils.unit.test.js.map +0 -1
- package/lib-es/transaction.unit.test.d.ts +0 -2
- package/lib-es/transaction.unit.test.d.ts.map +0 -1
- package/lib-es/transaction.unit.test.js +0 -658
- package/lib-es/transaction.unit.test.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { HttpResponse, http } from "msw";
|
|
2
|
-
import { setupServer } from "msw/node";
|
|
3
|
-
import { jettonTransferResponse, jettonWallets, lastBlockNumber, tonAccount, tonEstimateFee, tonTransactionResponse, tonWallet, } from "./common.fixtures";
|
|
4
|
-
// Define the mock base URL for the TON API
|
|
5
|
-
export const API_TON_ENDPOINT = "https://ton.coin.ledger.com/api/v3";
|
|
6
|
-
// Create request handlers for the mock server
|
|
7
|
-
const handlers = [
|
|
8
|
-
// Handle GET request for masterchainInfo endpoint
|
|
9
|
-
http.get(`${API_TON_ENDPOINT}/masterchainInfo`, () => {
|
|
10
|
-
return HttpResponse.json(lastBlockNumber);
|
|
11
|
-
}),
|
|
12
|
-
// Handle GET request for transactions endpoint
|
|
13
|
-
http.get(`${API_TON_ENDPOINT}/transactions`, () => {
|
|
14
|
-
return HttpResponse.json(tonTransactionResponse);
|
|
15
|
-
}),
|
|
16
|
-
// Handle GET request for account endpoint
|
|
17
|
-
http.get(`${API_TON_ENDPOINT}/account`, () => {
|
|
18
|
-
return HttpResponse.json(tonAccount);
|
|
19
|
-
}),
|
|
20
|
-
// Handle GET request for wallet endpoint
|
|
21
|
-
http.get(`${API_TON_ENDPOINT}/wallet`, () => {
|
|
22
|
-
return HttpResponse.json(tonWallet);
|
|
23
|
-
}),
|
|
24
|
-
// Handle GET request for jetton transfers endpoint
|
|
25
|
-
http.get(`${API_TON_ENDPOINT}/jetton/transfers`, () => HttpResponse.json(jettonTransferResponse)),
|
|
26
|
-
// Handle GET request for jetton wallets endpoint
|
|
27
|
-
http.get(`${API_TON_ENDPOINT}/jetton/wallets`, () => HttpResponse.json(jettonWallets)),
|
|
28
|
-
// Handle POST request for estimate fee endpoint
|
|
29
|
-
http.post(`${API_TON_ENDPOINT}/estimateFee`, () => HttpResponse.json(tonEstimateFee)),
|
|
30
|
-
];
|
|
31
|
-
// Set up the mock server with the defined handlers
|
|
32
|
-
const mockServer = setupServer(...handlers);
|
|
33
|
-
export default mockServer;
|
|
34
|
-
//# sourceMappingURL=api.fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.fixtures.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/api.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,2CAA2C;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AAErE,8CAA8C;AAC9C,MAAM,QAAQ,GAAG;IACf,kDAAkD;IAClD,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,kBAAkB,EAAE,GAAG,EAAE;QACnD,OAAO,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5C,CAAC,CAAC;IACF,+CAA+C;IAC/C,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,eAAe,EAAE,GAAG,EAAE;QAChD,OAAO,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACnD,CAAC,CAAC;IACF,0CAA0C;IAC1C,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,UAAU,EAAE,GAAG,EAAE;QAC3C,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC,CAAC;IACF,yCAAyC;IACzC,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,SAAS,EAAE,GAAG,EAAE;QAC1C,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC;IACF,mDAAmD;IACnD,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,mBAAmB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACjG,iDAAiD;IACjD,IAAI,CAAC,GAAG,CAAC,GAAG,gBAAgB,iBAAiB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEtF,gDAAgD;IAChD,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,cAAc,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;CACtF,CAAC;AAEF,mDAAmD;AACnD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;AAE5C,eAAe,UAAU,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
|
-
import { TonAccountInfo, TonResponseEstimateFee, TonResponseJettonTransfer, TonResponseJettonWallets, TonResponseWalletInfo, TonTransactionsList } from "../../bridge/bridgeHelpers/api.types";
|
|
3
|
-
import type { TonAccount, TonSubAccount, Transaction } from "../../types";
|
|
4
|
-
export declare const mockAddress = "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol";
|
|
5
|
-
export declare const mockAccountId = "js:2:ton:b19891a06654f21c64147550b3321bef63acd25b5dd61b688b022c42fac4831d:ton";
|
|
6
|
-
export declare const tokenAccount: TonSubAccount;
|
|
7
|
-
export declare const account: TonAccount;
|
|
8
|
-
export declare const transaction: Transaction;
|
|
9
|
-
export declare const jettonTransaction: Transaction;
|
|
10
|
-
export declare const fees: {
|
|
11
|
-
in_fwd_fee: number;
|
|
12
|
-
storage_fee: number;
|
|
13
|
-
gas_fee: number;
|
|
14
|
-
fwd_fee: number;
|
|
15
|
-
};
|
|
16
|
-
export declare const totalFees: BigNumber;
|
|
17
|
-
export declare const lastBlockNumber: {
|
|
18
|
-
last: {
|
|
19
|
-
seqno: number;
|
|
20
|
-
};
|
|
21
|
-
first: {
|
|
22
|
-
seqno: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const tonAccount: TonAccountInfo;
|
|
26
|
-
export declare const tonWallet: TonResponseWalletInfo;
|
|
27
|
-
export declare const jettonWallets: TonResponseJettonWallets;
|
|
28
|
-
export declare const tonEstimateFee: TonResponseEstimateFee;
|
|
29
|
-
export declare const jettonTransferResponse: TonResponseJettonTransfer;
|
|
30
|
-
export declare const tonTransactionResponse: TonTransactionsList;
|
|
31
|
-
export declare const accountInfo: TonAccountInfo;
|
|
32
|
-
//# sourceMappingURL=common.fixtures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.fixtures.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/common.fixtures.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1E,eAAO,MAAM,WAAW,qDAAqD,CAAC;AAC9E,eAAO,MAAM,aAAa,kFACuD,CAAC;AAElF,eAAO,MAAM,YAAY,eAeP,CAAC;AAEnB,eAAO,MAAM,OAAO,YAWL,CAAC;AAEhB,eAAO,MAAM,WAAW,EAAE,WAOzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAG/B,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;CAKhB,CAAC;AAEF,eAAO,MAAM,SAAS,WAErB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;CAO3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAMxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,qBAQvB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,wBAY3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,sBAG5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAkBpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,mBAkDpC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,cAMzB,CAAC"}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
|
|
2
|
-
import BigNumber from "bignumber.js";
|
|
3
|
-
export const mockAddress = "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol";
|
|
4
|
-
export const mockAccountId = "js:2:ton:b19891a06654f21c64147550b3321bef63acd25b5dd61b688b022c42fac4831d:ton";
|
|
5
|
-
export const tokenAccount = {
|
|
6
|
-
id: "subAccountId",
|
|
7
|
-
type: "TokenAccount",
|
|
8
|
-
spendableBalance: new BigNumber("5000000"),
|
|
9
|
-
token: {
|
|
10
|
-
contractAddress: "contractAddress",
|
|
11
|
-
units: [
|
|
12
|
-
{
|
|
13
|
-
code: "NOT",
|
|
14
|
-
magnitude: 9,
|
|
15
|
-
name: "Notcoin",
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
jettonWallet: "0:A2CC9B938389950125001F6B8AF280CACA23BE045714AD69387DD546588D667E",
|
|
20
|
-
};
|
|
21
|
-
export const account = {
|
|
22
|
-
id: mockAccountId,
|
|
23
|
-
freshAddress: mockAddress,
|
|
24
|
-
freshAddressPath: "44'/607'/0'/0'/0'/0'",
|
|
25
|
-
xpub: "",
|
|
26
|
-
type: "Account",
|
|
27
|
-
currency: getCryptoCurrencyById("ton"),
|
|
28
|
-
spendableBalance: new BigNumber("1000000000"),
|
|
29
|
-
balance: new BigNumber("1000000000"),
|
|
30
|
-
seedIdentifier: "seedIdentifier",
|
|
31
|
-
subAccounts: [tokenAccount],
|
|
32
|
-
};
|
|
33
|
-
export const transaction = {
|
|
34
|
-
recipient: "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4",
|
|
35
|
-
amount: new BigNumber("1000000"),
|
|
36
|
-
useAllAmount: false,
|
|
37
|
-
comment: { isEncrypted: false, text: "" },
|
|
38
|
-
family: "ton",
|
|
39
|
-
fees: new BigNumber(1000),
|
|
40
|
-
};
|
|
41
|
-
export const jettonTransaction = {
|
|
42
|
-
...transaction,
|
|
43
|
-
subAccountId: "subAccountId",
|
|
44
|
-
};
|
|
45
|
-
export const fees = {
|
|
46
|
-
in_fwd_fee: 10000,
|
|
47
|
-
storage_fee: 10000,
|
|
48
|
-
gas_fee: 10000,
|
|
49
|
-
fwd_fee: 10000,
|
|
50
|
-
};
|
|
51
|
-
export const totalFees = BigNumber(fees.fwd_fee + fees.gas_fee + fees.in_fwd_fee + fees.storage_fee);
|
|
52
|
-
export const lastBlockNumber = {
|
|
53
|
-
last: {
|
|
54
|
-
seqno: 38574413,
|
|
55
|
-
},
|
|
56
|
-
first: {
|
|
57
|
-
seqno: 3,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
export const tonAccount = {
|
|
61
|
-
balance: "1000000000",
|
|
62
|
-
last_transaction_lt: "47055058000008",
|
|
63
|
-
last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
|
|
64
|
-
status: "active",
|
|
65
|
-
seqno: 3,
|
|
66
|
-
};
|
|
67
|
-
export const tonWallet = {
|
|
68
|
-
balance: "7726736262",
|
|
69
|
-
wallet_type: "wallet v4 r2",
|
|
70
|
-
seqno: 22,
|
|
71
|
-
wallet_id: 698983191,
|
|
72
|
-
last_transaction_lt: "47055058000008",
|
|
73
|
-
last_transaction_hash: "psVQqt6rf/Lo6xyLzxx0to0jUIx8I2/4znOVf2KhAI0=",
|
|
74
|
-
status: "active",
|
|
75
|
-
};
|
|
76
|
-
export const jettonWallets = {
|
|
77
|
-
jetton_wallets: [
|
|
78
|
-
{
|
|
79
|
-
address: "0:495AB6C978E3C0AE7FCF863A2D4504E37CE8D2D04A5E59048301BA29EC372F79",
|
|
80
|
-
balance: "1200000000000",
|
|
81
|
-
owner: "0:D02D314791CB10EF3F964CC7421E4F46348C262444946F7A64C2374700E3ED19",
|
|
82
|
-
jetton: "0:3C52A0A732A83F022E517E5C2715E0EE458A4B9772580E903FF491526C3E9137",
|
|
83
|
-
last_transaction_lt: "30345242000008",
|
|
84
|
-
code_hash: "3axDia4eCUnTVixqU0/BUA4i8id5BtVw1pt/yayZd6k=",
|
|
85
|
-
data_hash: "P8j0kENM5s4zE2w5IpD8NrrSneGQ7d0mzs5yTBNPlqo=",
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
};
|
|
89
|
-
export const tonEstimateFee = {
|
|
90
|
-
source_fees: fees,
|
|
91
|
-
destination_fees: [],
|
|
92
|
-
};
|
|
93
|
-
export const jettonTransferResponse = {
|
|
94
|
-
jetton_transfers: [
|
|
95
|
-
{
|
|
96
|
-
query_id: "1",
|
|
97
|
-
source: "UQDnqcVSV4S9m2Y9gLAQrDerQktKSx2I1uhs6r5o_H8VT4x7",
|
|
98
|
-
destination: mockAddress,
|
|
99
|
-
amount: "",
|
|
100
|
-
source_wallet: "",
|
|
101
|
-
jetton_master: "0:2F956143C461769579BAEF2E32CC2D7BC18283F40D20BB03E432CD603AC33FFC",
|
|
102
|
-
transaction_hash: "",
|
|
103
|
-
transaction_lt: "",
|
|
104
|
-
transaction_now: 0,
|
|
105
|
-
response_destination: "",
|
|
106
|
-
custom_payload: null,
|
|
107
|
-
forward_ton_amount: "",
|
|
108
|
-
forward_payload: null,
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
};
|
|
112
|
-
export const tonTransactionResponse = {
|
|
113
|
-
transactions: [
|
|
114
|
-
{
|
|
115
|
-
account: mockAddress,
|
|
116
|
-
hash: "hash",
|
|
117
|
-
lt: "lt",
|
|
118
|
-
now: 1718241443,
|
|
119
|
-
orig_status: "active",
|
|
120
|
-
end_status: "active",
|
|
121
|
-
total_fees: "0",
|
|
122
|
-
prev_trans_hash: "",
|
|
123
|
-
prev_trans_lt: "",
|
|
124
|
-
description: {
|
|
125
|
-
aborted: true,
|
|
126
|
-
destroyed: false,
|
|
127
|
-
compute_ph: {
|
|
128
|
-
success: false,
|
|
129
|
-
exit_code: -14,
|
|
130
|
-
},
|
|
131
|
-
credit_first: true,
|
|
132
|
-
},
|
|
133
|
-
block_ref: null,
|
|
134
|
-
in_msg: {
|
|
135
|
-
source: "0:959EAA8BD0E3A2662D814278D51A6F997946207D48478008BEBE7F45F3EF781F",
|
|
136
|
-
destination: mockAddress,
|
|
137
|
-
value: "13509565",
|
|
138
|
-
hash: "inMsgHash",
|
|
139
|
-
fwd_fee: "266669",
|
|
140
|
-
ihr_fee: "0",
|
|
141
|
-
created_lt: "47055058000007",
|
|
142
|
-
created_at: "1718241443",
|
|
143
|
-
opcode: "0xd53276db",
|
|
144
|
-
ihr_disabled: true,
|
|
145
|
-
bounce: false,
|
|
146
|
-
bounced: false,
|
|
147
|
-
import_fee: null,
|
|
148
|
-
message_content: {
|
|
149
|
-
hash: "Qa0w2xg42wA9taurO/aCVOqGTzjOeP3EpzD2Sl7tTss=",
|
|
150
|
-
body: "te6cckEBAQEADgAAGNUydtsAAAAAAAAAAfRC8y4=",
|
|
151
|
-
decoded: null,
|
|
152
|
-
},
|
|
153
|
-
init_state: null,
|
|
154
|
-
},
|
|
155
|
-
out_msgs: [],
|
|
156
|
-
account_state_before: null,
|
|
157
|
-
account_state_after: null,
|
|
158
|
-
mc_block_seqno: 3,
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
address_book: {},
|
|
162
|
-
};
|
|
163
|
-
export const accountInfo = {
|
|
164
|
-
balance: "7726736262",
|
|
165
|
-
last_transaction_lt: "47055058000008",
|
|
166
|
-
last_transaction_hash: "lastTransactionHash",
|
|
167
|
-
status: "active",
|
|
168
|
-
seqno: 22,
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=common.fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.fixtures.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/common.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,SAAS,MAAM,cAAc,CAAC;AAWrC,MAAM,CAAC,MAAM,WAAW,GAAG,kDAAkD,CAAC;AAC9E,MAAM,CAAC,MAAM,aAAa,GACxB,+EAA+E,CAAC;AAElF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,gBAAgB,EAAE,IAAI,SAAS,CAAC,SAAS,CAAC;IAC1C,KAAK,EAAE;QACL,eAAe,EAAE,iBAAiB;QAClC,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,KAAK;gBACX,SAAS,EAAE,CAAC;gBACZ,IAAI,EAAE,SAAS;aAChB;SACF;KACF;IACD,YAAY,EAAE,oEAAoE;CAClE,C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
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DatasetTest } from "@ledgerhq/types-live";
|
|
2
|
-
import { Transaction } from "../../types";
|
|
3
|
-
export declare const dataset: DatasetTest<Transaction>;
|
|
4
|
-
/**
|
|
5
|
-
* NOTE: if tests are added to this file,
|
|
6
|
-
* like done in libs/coin-polkadot/src/bridge.integration.test.ts for example,
|
|
7
|
-
* this file fill need to be imported in ledger-live-common
|
|
8
|
-
* libs/ledger-live-common/src/families/ton/bridge.integration.test.ts
|
|
9
|
-
* like done for polkadot.
|
|
10
|
-
* cf.
|
|
11
|
-
* - libs/coin-polkadot/src/bridge.integration.test.ts
|
|
12
|
-
* - libs/ledger-live-common/src/families/polkadot/bridge.integration.test.ts
|
|
13
|
-
*/
|
|
14
|
-
//# sourceMappingURL=bridge.integration.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/bridge.integration.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInE,OAAO,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AA+LtD,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,WAAW,CAK5C,CAAC;AAEF;;;;;;;;;GASG"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { InvalidAddress, NotEnoughBalance } from "@ledgerhq/errors";
|
|
2
|
-
import BigNumber from "bignumber.js";
|
|
3
|
-
import { TonCommentInvalid } from "../../errors";
|
|
4
|
-
import { fromTransactionRaw } from "../../transaction";
|
|
5
|
-
import { findSubAccountById } from "../../utils";
|
|
6
|
-
const PUBKEY = "86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a060";
|
|
7
|
-
const ADDRESS = "UQCOvQLYvTcbi5tL9MaDNzuVl3-J3vATimNm9yO5XPafLfV4";
|
|
8
|
-
const ADDRESS_2 = "UQAui6M4jOYOezUGfmeONA22Ars9yjd34YIGdAR1Pcpp4sgR";
|
|
9
|
-
const PATH = "44'/607'/0'/0'/0'/0'";
|
|
10
|
-
const SUBACCOUNT = "js:2:ton:86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a060:ton+ton%2Fjetton%2Feqavlwfdxgf2lxm67y4yzc17wykd9a0guwpkms1gosm~!underscore!~~!underscore!~not";
|
|
11
|
-
const ton = {
|
|
12
|
-
IgnorePrepareTransactionFields: ["fees"],
|
|
13
|
-
scanAccounts: [
|
|
14
|
-
{
|
|
15
|
-
name: "ton seed 1",
|
|
16
|
-
apdus: `
|
|
17
|
-
=> e005000019068000002c8000025f80000000800000008000000080000000
|
|
18
|
-
<= 86196cb40cd25e9e696bc808e3f2c074ce0b39f2a2a9d482a68eafef86e4a0609000
|
|
19
|
-
=> e005000019068000002c8000025f80000000800000008000000180000000
|
|
20
|
-
<= b5177c2b32f9d72fa8c673cc3d61acec6a9f68eb5e4945445fdbb48a45eb48879000
|
|
21
|
-
`,
|
|
22
|
-
test: (expect, accounts) => {
|
|
23
|
-
for (const account of accounts) {
|
|
24
|
-
expect(account.derivationMode).toEqual("ton");
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
accounts: [
|
|
30
|
-
{
|
|
31
|
-
FIXME_tests: [
|
|
32
|
-
"balance is sum of ops",
|
|
33
|
-
"transaction Subaccount Send max", // TypeError: Cannot read properties of undefined (reading 'toString') in ts.amount
|
|
34
|
-
],
|
|
35
|
-
raw: {
|
|
36
|
-
id: `js:2:ton:${PUBKEY}:ton`,
|
|
37
|
-
currencyId: "ton",
|
|
38
|
-
seedIdentifier: PUBKEY,
|
|
39
|
-
name: "TON 1",
|
|
40
|
-
derivationMode: "ton",
|
|
41
|
-
index: 0,
|
|
42
|
-
freshAddress: ADDRESS,
|
|
43
|
-
freshAddressPath: PATH,
|
|
44
|
-
xpub: PUBKEY,
|
|
45
|
-
blockHeight: 0,
|
|
46
|
-
operations: [],
|
|
47
|
-
pendingOperations: [],
|
|
48
|
-
lastSyncDate: "",
|
|
49
|
-
balance: "5000000000",
|
|
50
|
-
subAccounts: [],
|
|
51
|
-
},
|
|
52
|
-
transactions: [
|
|
53
|
-
{
|
|
54
|
-
name: "Not a valid address",
|
|
55
|
-
transaction: fromTransactionRaw({
|
|
56
|
-
family: "ton",
|
|
57
|
-
recipient: "novalidaddress",
|
|
58
|
-
fees: "10000000",
|
|
59
|
-
amount: "1000",
|
|
60
|
-
comment: { isEncrypted: false, text: "" },
|
|
61
|
-
}),
|
|
62
|
-
expectedStatus: {
|
|
63
|
-
errors: {
|
|
64
|
-
recipient: new InvalidAddress(),
|
|
65
|
-
},
|
|
66
|
-
warnings: {},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "Not enough balance",
|
|
71
|
-
transaction: fromTransactionRaw({
|
|
72
|
-
family: "ton",
|
|
73
|
-
recipient: ADDRESS_2,
|
|
74
|
-
fees: "10000000",
|
|
75
|
-
amount: (300 * 1e9).toString(),
|
|
76
|
-
comment: { isEncrypted: false, text: "" },
|
|
77
|
-
}),
|
|
78
|
-
expectedStatus: {
|
|
79
|
-
errors: {
|
|
80
|
-
amount: new NotEnoughBalance(),
|
|
81
|
-
},
|
|
82
|
-
warnings: {},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: "Invalid transferID/Memo",
|
|
87
|
-
transaction: fromTransactionRaw({
|
|
88
|
-
family: "ton",
|
|
89
|
-
recipient: ADDRESS_2,
|
|
90
|
-
fees: "1",
|
|
91
|
-
amount: (1 * 1e2).toString(),
|
|
92
|
-
comment: { isEncrypted: false, text: "😀" },
|
|
93
|
-
}),
|
|
94
|
-
expectedStatus: {
|
|
95
|
-
errors: {
|
|
96
|
-
transaction: new TonCommentInvalid(),
|
|
97
|
-
},
|
|
98
|
-
warnings: {},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: "New account and sufficient amount",
|
|
103
|
-
transaction: fromTransactionRaw({
|
|
104
|
-
family: "ton",
|
|
105
|
-
recipient: ADDRESS_2,
|
|
106
|
-
fees: "10000000",
|
|
107
|
-
amount: "10000000",
|
|
108
|
-
comment: { isEncrypted: false, text: "Valid" },
|
|
109
|
-
}),
|
|
110
|
-
expectedStatus: {
|
|
111
|
-
amount: new BigNumber("10000000"),
|
|
112
|
-
errors: {},
|
|
113
|
-
warnings: {},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
// sub account tests
|
|
117
|
-
{
|
|
118
|
-
name: "Subaccount Not a valid address",
|
|
119
|
-
transaction: fromTransactionRaw({
|
|
120
|
-
family: "ton",
|
|
121
|
-
recipient: "novalidaddress",
|
|
122
|
-
fees: "10000000",
|
|
123
|
-
amount: "1000",
|
|
124
|
-
comment: { isEncrypted: false, text: "" },
|
|
125
|
-
subAccountId: SUBACCOUNT,
|
|
126
|
-
}),
|
|
127
|
-
expectedStatus: {
|
|
128
|
-
errors: {
|
|
129
|
-
recipient: new InvalidAddress(),
|
|
130
|
-
},
|
|
131
|
-
warnings: {},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "Subaccount Not enough balance",
|
|
136
|
-
transaction: fromTransactionRaw({
|
|
137
|
-
family: "ton",
|
|
138
|
-
recipient: ADDRESS_2,
|
|
139
|
-
fees: "10000000",
|
|
140
|
-
amount: (300 * 1e9).toString(),
|
|
141
|
-
comment: { isEncrypted: false, text: "" },
|
|
142
|
-
subAccountId: SUBACCOUNT,
|
|
143
|
-
}),
|
|
144
|
-
expectedStatus: {
|
|
145
|
-
errors: {
|
|
146
|
-
amount: new NotEnoughBalance(),
|
|
147
|
-
},
|
|
148
|
-
warnings: {},
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: "Subaccount New account and sufficient amount",
|
|
153
|
-
transaction: fromTransactionRaw({
|
|
154
|
-
family: "ton",
|
|
155
|
-
recipient: ADDRESS,
|
|
156
|
-
fees: "10000000",
|
|
157
|
-
amount: "10000000",
|
|
158
|
-
comment: { isEncrypted: false, text: "Valid" },
|
|
159
|
-
subAccountId: SUBACCOUNT,
|
|
160
|
-
}),
|
|
161
|
-
expectedStatus: {
|
|
162
|
-
amount: new BigNumber("10000000"),
|
|
163
|
-
errors: {},
|
|
164
|
-
warnings: {},
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "Subaccount Send max",
|
|
169
|
-
transaction: fromTransactionRaw({
|
|
170
|
-
family: "ton",
|
|
171
|
-
recipient: ADDRESS,
|
|
172
|
-
fees: "10000000",
|
|
173
|
-
amount: "10000000",
|
|
174
|
-
comment: { isEncrypted: false, text: "Valid" },
|
|
175
|
-
useAllAmount: true,
|
|
176
|
-
subAccountId: SUBACCOUNT,
|
|
177
|
-
}),
|
|
178
|
-
expectedStatus: (account, tx) => {
|
|
179
|
-
const subAccount = findSubAccountById(account, tx.subAccountId ?? "");
|
|
180
|
-
return {
|
|
181
|
-
amount: subAccount?.spendableBalance,
|
|
182
|
-
errors: {},
|
|
183
|
-
warnings: {},
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
};
|
|
191
|
-
export const dataset = {
|
|
192
|
-
implementations: ["js"],
|
|
193
|
-
currencies: {
|
|
194
|
-
ton,
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* NOTE: if tests are added to this file,
|
|
199
|
-
* like done in libs/coin-polkadot/src/bridge.integration.test.ts for example,
|
|
200
|
-
* this file fill need to be imported in ledger-live-common
|
|
201
|
-
* libs/ledger-live-common/src/families/ton/bridge.integration.test.ts
|
|
202
|
-
* like done for polkadot.
|
|
203
|
-
* cf.
|
|
204
|
-
* - libs/coin-polkadot/src/bridge.integration.test.ts
|
|
205
|
-
* - libs/ledger-live-common/src/families/polkadot/bridge.integration.test.ts
|
|
206
|
-
*/
|
|
207
|
-
//# sourceMappingURL=bridge.integration.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.integration.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/bridge.integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,GAAG,kEAAkE,CAAC;AAClF,MAAM,OAAO,GAAG,kDAAkD,CAAC;AACnE,MAAM,SAAS,GAAG,kDAAkD,CAAC;AACrE,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,UAAU,GACd,yKAAyK,CAAC;AAE5K,MAAM,GAAG,GAAgC;IACvC,8BAA8B,EAAE,CAAC,MAAM,CAAC;IACxC,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE;;;;;OAKN;YACD,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;gBACzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;SACF;KACF;IACD,QAAQ,EAAE;QACR;YACE,WAAW,EAAE;gBACX,uBAAuB;gBACvB,iCAAiC,EAAE,mFAAmF;aACvH;YACD,GAAG,EAAE;gBACH,EAAE,EAAE,YAAY,MAAM,MAAM;gBAC5B,UAAU,EAAE,KAAK;gBACjB,cAAc,EAAE,MA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,gBAAgB;4BACpC,MAAM,EAAE,EAAE;4BACV,QAAQ,EAAE,EAAE;yBACb,CAAC;oBACJ,CAAC;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAA6B;IAC/C,eAAe,EAAE,CAAC,IAAI,CAAC;IACvB,UAAU,EAAE;QACV,GAAG;KACJ;CACF,CAAC;AAEF;;;;;;;;;GASG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/api.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { estimateFee, fetchAccountInfo, fetchJettonTransactions, fetchJettonWallets, fetchLastBlockNumber, fetchTransactions, } from "../../bridge/bridgeHelpers/api";
|
|
2
|
-
import { setCoinConfig } from "../../config";
|
|
3
|
-
import mockServer, { API_TON_ENDPOINT } from "../fixtures/api.fixtures";
|
|
4
|
-
import { jettonTransferResponse, jettonWallets, lastBlockNumber, mockAddress, tonAccount, tonEstimateFee, tonTransactionResponse, tonWallet, } from "../fixtures/common.fixtures";
|
|
5
|
-
describe("getAccount", () => {
|
|
6
|
-
beforeAll(() => {
|
|
7
|
-
setCoinConfig(() => ({
|
|
8
|
-
status: {
|
|
9
|
-
type: "active",
|
|
10
|
-
},
|
|
11
|
-
infra: {
|
|
12
|
-
API_TON_ENDPOINT: API_TON_ENDPOINT,
|
|
13
|
-
KNOWN_JETTONS: [],
|
|
14
|
-
},
|
|
15
|
-
}));
|
|
16
|
-
mockServer.listen();
|
|
17
|
-
});
|
|
18
|
-
afterAll(() => {
|
|
19
|
-
mockServer.close();
|
|
20
|
-
});
|
|
21
|
-
it("should return last block number", async () => {
|
|
22
|
-
const result = await fetchLastBlockNumber();
|
|
23
|
-
expect(result).toEqual(lastBlockNumber.last.seqno);
|
|
24
|
-
});
|
|
25
|
-
it("should return the transactions of an address", async () => {
|
|
26
|
-
const result = await fetchTransactions(mockAddress);
|
|
27
|
-
expect(result).toEqual(tonTransactionResponse);
|
|
28
|
-
});
|
|
29
|
-
it("should return the ton account info of an address", async () => {
|
|
30
|
-
const result = await fetchAccountInfo(mockAddress);
|
|
31
|
-
expect(result).toEqual({
|
|
32
|
-
balance: tonAccount.balance,
|
|
33
|
-
last_transaction_lt: tonAccount.last_transaction_lt,
|
|
34
|
-
last_transaction_hash: tonAccount.last_transaction_hash,
|
|
35
|
-
status: tonAccount.status,
|
|
36
|
-
seqno: tonWallet.seqno,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it("should return the jetton transactions", async () => {
|
|
40
|
-
const result = await fetchJettonTransactions(mockAddress);
|
|
41
|
-
expect(result).toEqual(jettonTransferResponse.jetton_transfers);
|
|
42
|
-
});
|
|
43
|
-
it("should return the jetton wallets", async () => {
|
|
44
|
-
const result = await fetchJettonWallets();
|
|
45
|
-
expect(result).toEqual(jettonWallets.jetton_wallets);
|
|
46
|
-
});
|
|
47
|
-
it("should return the estimated fees", async () => {
|
|
48
|
-
const result = await estimateFee(mockAddress, "");
|
|
49
|
-
expect(result).toEqual(tonEstimateFee.source_fees);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=api.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/api.unit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,cAAc,EACd,sBAAs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SACvB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,WAAW,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/broadcast.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { encodeOperationId } from "@ledgerhq/coin-framework/lib/operation";
|
|
2
|
-
import { broadcastTx } from "../../bridge/bridgeHelpers/api";
|
|
3
|
-
import broadcast from "../../broadcast";
|
|
4
|
-
import { buildOptimisticOperation } from "../../signOperation";
|
|
5
|
-
import { account, transaction } from "../fixtures/common.fixtures";
|
|
6
|
-
jest.mock("../../bridge/bridgeHelpers/api");
|
|
7
|
-
const mockedHash = "validHash";
|
|
8
|
-
describe("broadcast", () => {
|
|
9
|
-
beforeAll(() => {
|
|
10
|
-
const broadcastTxMock = jest.mocked(broadcastTx);
|
|
11
|
-
broadcastTxMock.mockReturnValue(Promise.resolve(mockedHash));
|
|
12
|
-
});
|
|
13
|
-
it("should broadcast the coin transaction and add the hash in the optimistic transaction", async () => {
|
|
14
|
-
const optimisticCoinOperation = buildOptimisticOperation(account, transaction);
|
|
15
|
-
const finalOperation = await broadcast({
|
|
16
|
-
account,
|
|
17
|
-
signedOperation: {
|
|
18
|
-
operation: optimisticCoinOperation,
|
|
19
|
-
signature: "0xS1gn4tUR3",
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
expect(broadcastTx).toHaveBeenCalled();
|
|
23
|
-
expect(finalOperation).toEqual({
|
|
24
|
-
...optimisticCoinOperation,
|
|
25
|
-
id: encodeOperationId(account.id, mockedHash, "OUT"),
|
|
26
|
-
hash: mockedHash,
|
|
27
|
-
subOperations: [],
|
|
28
|
-
nftOperations: [],
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=broadcast.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/broadcast.unit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEnE,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAC5C,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACjD,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,KAAK,IAAI,EAAE;QACpG,MAAM,uBAAuB,GAAG,wBAAwB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAE/E,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC;YACrC,OAAO;YACP,eAAe,EAAE;gBACf,SAAS,EAAE,uBAAuB;gBAClC,SAAS,EAAE,aAAa;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;YAC7B,GAAG,uBAAuB;YAC1B,EAAE,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC;YACpD,IAAI,EAAE,UAAU;YAChB,aAAa,EAAE,EAAE;YACjB,aAAa,EAAE,EAAE;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTransaction.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/createTransaction.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
|
-
import createTransaction from "../../createTransaction";
|
|
3
|
-
import { account } from "../fixtures/common.fixtures";
|
|
4
|
-
describe("createTransaction", () => {
|
|
5
|
-
it("should create a valid transaction", async () => {
|
|
6
|
-
const res = createTransaction(account);
|
|
7
|
-
expect(res).toEqual({
|
|
8
|
-
family: "ton",
|
|
9
|
-
amount: new BigNumber(0),
|
|
10
|
-
fees: new BigNumber(0),
|
|
11
|
-
recipient: "",
|
|
12
|
-
useAllAmount: false,
|
|
13
|
-
comment: {
|
|
14
|
-
isEncrypted: false,
|
|
15
|
-
text: "",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=createTransaction.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTransaction.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/createTransaction.unit.test.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,GAAG,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;YACxB,IAAI,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;YACtB,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,IAAI,EAAE,EAAE;aACT;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/deviceTransactionConfig.unit.test.ts"],"names":[],"mappings":""}
|