@ledgerhq/coin-ton 0.15.0 → 0.15.1-nightly.1
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/.unimportedrc.json +2 -1
- package/CHANGELOG.md +16 -0
- package/lib/{__tests__/integration/bridge.integration.test.d.ts → test/bridge.dataset.d.ts} +2 -2
- package/lib/test/bridge.dataset.d.ts.map +1 -0
- package/lib/{__tests__/integration/bridge.integration.test.js → test/bridge.dataset.js} +4 -4
- package/lib/test/bridge.dataset.js.map +1 -0
- package/lib/transaction.d.ts.map +1 -1
- package/lib/transaction.js +44 -0
- package/lib/transaction.js.map +1 -1
- package/lib/types.d.ts +40 -2
- package/lib/types.d.ts.map +1 -1
- package/lib-es/{__tests__/integration/bridge.integration.test.d.ts → test/bridge.dataset.d.ts} +2 -2
- package/lib-es/test/bridge.dataset.d.ts.map +1 -0
- package/lib-es/{__tests__/integration/bridge.integration.test.js → test/bridge.dataset.js} +4 -4
- package/lib-es/test/bridge.dataset.js.map +1 -0
- package/lib-es/transaction.d.ts.map +1 -1
- package/lib-es/transaction.js +44 -0
- package/lib-es/transaction.js.map +1 -1
- package/lib-es/types.d.ts +40 -2
- package/lib-es/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/{__tests__/integration/bridge.integration.test.ts → test/bridge.dataset.ts} +4 -4
- package/src/transaction.ts +44 -0
- package/src/transaction.unit.test.ts +71 -8
- package/src/types.ts +52 -2
- 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.map +0 -1
- 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 -600
- 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.map +0 -1
- 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 -595
- package/lib-es/transaction.unit.test.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/broadcast.unit.test.ts"],"names":[],"mappings":";;;;;AAAA,sEAA2E;AAC3E,wDAA6D;AAC7D,gEAAwC;AACxC,uDAA+D;AAC/D,iEAAmE;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,iBAAW,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,IAAA,wCAAwB,EAAC,yBAAO,EAAE,6BAAW,CAAC,CAAC;QAE/E,MAAM,cAAc,GAAG,MAAM,IAAA,mBAAS,EAAC;YACrC,OAAO,EAAP,yBAAO;YACP,eAAe,EAAE;gBACf,SAAS,EAAE,uBAAuB;gBAClC,SAAS,EAAE,aAAa;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,iBAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;YAC7B,GAAG,uBAAuB;YAC1B,EAAE,EAAE,IAAA,6BAAiB,EAAC,yBAAO,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,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
7
|
-
const createTransaction_1 = __importDefault(require("../../createTransaction"));
|
|
8
|
-
const common_fixtures_1 = require("../fixtures/common.fixtures");
|
|
9
|
-
describe("createTransaction", () => {
|
|
10
|
-
it("should create a valid transaction", async () => {
|
|
11
|
-
const res = (0, createTransaction_1.default)(common_fixtures_1.account);
|
|
12
|
-
expect(res).toEqual({
|
|
13
|
-
family: "ton",
|
|
14
|
-
amount: new bignumber_js_1.default(0),
|
|
15
|
-
fees: new bignumber_js_1.default(0),
|
|
16
|
-
recipient: "",
|
|
17
|
-
useAllAmount: false,
|
|
18
|
-
comment: {
|
|
19
|
-
isEncrypted: false,
|
|
20
|
-
text: "",
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
//# 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,gEAAqC;AACrC,gFAAwD;AACxD,iEAAsD;AAEtD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,GAAG,GAAG,IAAA,2BAAiB,EAAC,yBAAO,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;YACxB,IAAI,EAAE,IAAI,sBAAS,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":""}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const index_1 = require("@ledgerhq/coin-framework/currencies/index");
|
|
7
|
-
const index_2 = require("@ledgerhq/coin-framework/lib/account/index");
|
|
8
|
-
const core_1 = require("@ton/core");
|
|
9
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
10
|
-
const constants_1 = require("../../constants");
|
|
11
|
-
const deviceTransactionConfig_1 = __importDefault(require("../../deviceTransactionConfig"));
|
|
12
|
-
const common_fixtures_1 = require("../fixtures/common.fixtures");
|
|
13
|
-
const status = {
|
|
14
|
-
errors: {},
|
|
15
|
-
warnings: {},
|
|
16
|
-
estimatedFees: new bignumber_js_1.default(0),
|
|
17
|
-
amount: new bignumber_js_1.default(0),
|
|
18
|
-
totalSpent: new bignumber_js_1.default(0),
|
|
19
|
-
};
|
|
20
|
-
describe("deviceTransactionConfig", () => {
|
|
21
|
-
describe("TON transaction", () => {
|
|
22
|
-
it("should return the fields for a transaction when there is a valid comment", async () => {
|
|
23
|
-
const transaction = {
|
|
24
|
-
...common_fixtures_1.transaction,
|
|
25
|
-
comment: { isEncrypted: false, text: "validComment" },
|
|
26
|
-
};
|
|
27
|
-
const res = await (0, deviceTransactionConfig_1.default)({
|
|
28
|
-
account: common_fixtures_1.account,
|
|
29
|
-
parentAccount: undefined,
|
|
30
|
-
transaction,
|
|
31
|
-
status,
|
|
32
|
-
});
|
|
33
|
-
expect(res).toEqual([
|
|
34
|
-
{
|
|
35
|
-
type: "address",
|
|
36
|
-
label: "To",
|
|
37
|
-
address: transaction.recipient,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
type: "amount",
|
|
41
|
-
label: "Amount",
|
|
42
|
-
},
|
|
43
|
-
{ type: "fees", label: "Fee" },
|
|
44
|
-
{ type: "text", label: "Comment", value: "validComment" },
|
|
45
|
-
]);
|
|
46
|
-
});
|
|
47
|
-
it("should return the fields for a transaction when useAllAmount is true and there is a valid comment", async () => {
|
|
48
|
-
const transaction = {
|
|
49
|
-
...common_fixtures_1.transaction,
|
|
50
|
-
useAllAmount: true,
|
|
51
|
-
comment: { isEncrypted: false, text: "validComment" },
|
|
52
|
-
};
|
|
53
|
-
const res = await (0, deviceTransactionConfig_1.default)({
|
|
54
|
-
account: common_fixtures_1.account,
|
|
55
|
-
parentAccount: undefined,
|
|
56
|
-
transaction,
|
|
57
|
-
status,
|
|
58
|
-
});
|
|
59
|
-
expect(res).toEqual([
|
|
60
|
-
{
|
|
61
|
-
type: "address",
|
|
62
|
-
label: "To",
|
|
63
|
-
address: transaction.recipient,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: "text",
|
|
67
|
-
label: "Amount",
|
|
68
|
-
value: "ALL YOUR TONs",
|
|
69
|
-
},
|
|
70
|
-
{ type: "fees", label: "Fee" },
|
|
71
|
-
{ type: "text", label: "Comment", value: "validComment" },
|
|
72
|
-
]);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
describe("Jetton transaction", () => {
|
|
76
|
-
it("should return the fields for a jetton transaction", async () => {
|
|
77
|
-
if (common_fixtures_1.account.subAccounts?.[0]) {
|
|
78
|
-
const res = await (0, deviceTransactionConfig_1.default)({
|
|
79
|
-
account: common_fixtures_1.account.subAccounts[0],
|
|
80
|
-
parentAccount: common_fixtures_1.account,
|
|
81
|
-
transaction: common_fixtures_1.jettonTransaction,
|
|
82
|
-
status,
|
|
83
|
-
});
|
|
84
|
-
expect(res).toEqual([
|
|
85
|
-
{
|
|
86
|
-
type: "address",
|
|
87
|
-
label: "To",
|
|
88
|
-
address: common_fixtures_1.jettonTransaction.recipient,
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
type: "text",
|
|
92
|
-
label: "Jetton amount",
|
|
93
|
-
value: (0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(common_fixtures_1.account.subAccounts[0]).units[0], common_fixtures_1.jettonTransaction.amount, {
|
|
94
|
-
showCode: true,
|
|
95
|
-
disableRounding: true,
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: "text",
|
|
100
|
-
label: "Amount",
|
|
101
|
-
value: (0, index_1.formatCurrencyUnit)((0, index_2.getAccountCurrency)(common_fixtures_1.account).units[0], (0, bignumber_js_1.default)((0, core_1.toNano)(constants_1.TOKEN_TRANSFER_MAX_FEE).toString()), {
|
|
102
|
-
showCode: true,
|
|
103
|
-
disableRounding: true,
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
106
|
-
]);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
//# sourceMappingURL=deviceTransactionConfig.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deviceTransactionConfig.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/deviceTransactionConfig.unit.test.ts"],"names":[],"mappings":";;;;;AAAA,qEAA+E;AAC/E,sEAAgF;AAChF,oCAAmC;AACnC,gEAAqC;AACrC,+CAAyD;AACzD,4FAAuE;AACvE,iEAIqC;AAErC,MAAM,MAAM,GAAG;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AAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EACnD,mCAAiB,CAAC,MAAM,EACxB;4BACE,QAAQ,EAAE,IAAI;4BACd,eAAe,EAAE,IAAI;yBACtB,CACF;qBACF;oBACD;wBACE,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,IAAA,0BAAkB,EACvB,IAAA,0BAAkB,EAAC,yBAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EACpC,IAAA,sBAAS,EAAC,IAAA,aAAM,EAAC,kCAAsB,CAAC,CAAC,QAAQ,EAAE,CAAC,EACpD;4BACE,QAAQ,EAAE,IAAI;4BACd,eAAe,EAAE,IAAI;yBACtB,CACF;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"estimateMaxSpendable.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/estimateMaxSpendable.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const api_1 = require("../../bridge/bridgeHelpers/api");
|
|
7
|
-
const estimateMaxSpendable_1 = __importDefault(require("../../estimateMaxSpendable"));
|
|
8
|
-
const common_fixtures_1 = require("../fixtures/common.fixtures");
|
|
9
|
-
jest.mock("../../bridge/bridgeHelpers/api");
|
|
10
|
-
describe("estimateMaxSpendable", () => {
|
|
11
|
-
beforeAll(() => {
|
|
12
|
-
const fetchAccountInfoMock = jest.mocked(api_1.fetchAccountInfo);
|
|
13
|
-
fetchAccountInfoMock.mockReturnValue(Promise.resolve(common_fixtures_1.accountInfo));
|
|
14
|
-
const fetchEstimateFeeMock = jest.mocked(api_1.estimateFee);
|
|
15
|
-
fetchEstimateFeeMock.mockReturnValue(Promise.resolve(common_fixtures_1.fees));
|
|
16
|
-
});
|
|
17
|
-
it("should return the max spendable for a TON transaction", async () => {
|
|
18
|
-
const res = await (0, estimateMaxSpendable_1.default)({ account: common_fixtures_1.account, transaction: common_fixtures_1.transaction });
|
|
19
|
-
expect(res).toEqual(common_fixtures_1.account.balance.minus(common_fixtures_1.totalFees));
|
|
20
|
-
});
|
|
21
|
-
it("should return the max spendable for a jetton transfer", async () => {
|
|
22
|
-
const res = await (0, estimateMaxSpendable_1.default)({
|
|
23
|
-
account: common_fixtures_1.tokenAccount,
|
|
24
|
-
parentAccount: common_fixtures_1.account,
|
|
25
|
-
transaction: common_fixtures_1.jettonTransaction,
|
|
26
|
-
});
|
|
27
|
-
expect(res).toEqual(common_fixtures_1.tokenAccount.spendableBalance);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=estimateMaxSpendable.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"estimateMaxSpendable.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/estimateMaxSpendable.unit.test.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+E;AAC/E,sFAA8D;AAC9D,iEAQqC;AAErC,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAE5C,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,sBAAgB,CAAC,CAAC;QAC3D,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,6BAAW,CAAC,CAAC,CAAC;QACnE,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAW,CAAC,CAAC;QACtD,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAI,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,GAAG,GAAG,MAAM,IAAA,8BAAoB,EAAC,EAAE,OAAO,EAAP,yBAAO,EAAE,WAAW,EAAX,6BAAW,EAAE,CAAC,CAAC;QACjE,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,yBAAO,CAAC,OAAO,CAAC,KAAK,CAAC,2BAAS,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,GAAG,GAAG,MAAM,IAAA,8BAAoB,EAAC;YACrC,OAAO,EAAE,8BAAY;YACrB,aAAa,EAAE,yBAAO;YACtB,WAAW,EAAE,mCAAiB;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,8BAAY,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionStatus.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/getTransactionStatus.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const errors_1 = require("@ledgerhq/errors");
|
|
7
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
-
const errors_2 = require("../../errors");
|
|
9
|
-
const getTransactionStatus_1 = __importDefault(require("../../getTransactionStatus"));
|
|
10
|
-
const common_fixtures_1 = require("../fixtures/common.fixtures");
|
|
11
|
-
describe("getTransactionStatus", () => {
|
|
12
|
-
describe("Recipient", () => {
|
|
13
|
-
it("should detect the missing recipient and have an error", async () => {
|
|
14
|
-
const transaction = { ...common_fixtures_1.transaction, recipient: "" };
|
|
15
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
16
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
17
|
-
recipient: new errors_1.RecipientRequired(),
|
|
18
|
-
}));
|
|
19
|
-
});
|
|
20
|
-
it("should detect the incorrect recipient and have an error", async () => {
|
|
21
|
-
const transaction = { ...common_fixtures_1.transaction, recipient: "isInvalid" };
|
|
22
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
23
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
24
|
-
recipient: new errors_1.InvalidAddress("", {
|
|
25
|
-
currencyName: common_fixtures_1.account.currency.name,
|
|
26
|
-
}),
|
|
27
|
-
}));
|
|
28
|
-
});
|
|
29
|
-
it("should detect the recipient and the sender are the same and have an error", async () => {
|
|
30
|
-
const transaction = {
|
|
31
|
-
...common_fixtures_1.transaction,
|
|
32
|
-
recipient: "UQDzd8aeBOU-jqYw_ZSuZjceI5p-F4b7HMprAsUJAtRPbMol",
|
|
33
|
-
};
|
|
34
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
35
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
36
|
-
recipient: new errors_1.InvalidAddressBecauseDestinationIsAlsoSource("", {
|
|
37
|
-
currencyName: common_fixtures_1.account.currency.name,
|
|
38
|
-
}),
|
|
39
|
-
}));
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe("Sender", () => {
|
|
43
|
-
it("should detect the sender is not correct and have an error", async () => {
|
|
44
|
-
const tempAccount = { ...common_fixtures_1.account, freshAddress: "isInvalid" };
|
|
45
|
-
const res = await (0, getTransactionStatus_1.default)(tempAccount, common_fixtures_1.transaction);
|
|
46
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
47
|
-
sender: new errors_1.InvalidAddress(),
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe("Amount", () => {
|
|
52
|
-
it("should detect the amount is missing and have an error", async () => {
|
|
53
|
-
const transaction = { ...common_fixtures_1.transaction, amount: new bignumber_js_1.default(0) };
|
|
54
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
55
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
56
|
-
amount: new errors_1.AmountRequired(),
|
|
57
|
-
}));
|
|
58
|
-
});
|
|
59
|
-
it("should detect the amount is greater than the spendable amount and have an error", async () => {
|
|
60
|
-
const transaction = {
|
|
61
|
-
...common_fixtures_1.transaction,
|
|
62
|
-
amount: (0, bignumber_js_1.default)(1000000002),
|
|
63
|
-
fees: new bignumber_js_1.default("20"),
|
|
64
|
-
};
|
|
65
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
66
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
67
|
-
amount: new errors_1.NotEnoughBalance(),
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
it("should detect the amount is greater than the spendable amount of the token account and have an error", async () => {
|
|
71
|
-
const transaction = {
|
|
72
|
-
...common_fixtures_1.jettonTransaction,
|
|
73
|
-
amount: (0, bignumber_js_1.default)(1000000002),
|
|
74
|
-
fees: new bignumber_js_1.default("20"),
|
|
75
|
-
};
|
|
76
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
77
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
78
|
-
amount: new errors_1.NotEnoughBalance(),
|
|
79
|
-
}));
|
|
80
|
-
});
|
|
81
|
-
it("should detect the transaction is a jetton transfer and have a warning", async () => {
|
|
82
|
-
const transaction = {
|
|
83
|
-
...common_fixtures_1.jettonTransaction,
|
|
84
|
-
amount: (0, bignumber_js_1.default)(1000000002),
|
|
85
|
-
fees: new bignumber_js_1.default("20"),
|
|
86
|
-
};
|
|
87
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
88
|
-
expect(res.warnings).toEqual(expect.objectContaining({
|
|
89
|
-
amount: new errors_2.TonExcessFee(),
|
|
90
|
-
}));
|
|
91
|
-
});
|
|
92
|
-
describe("Comment", () => {
|
|
93
|
-
it("should detect the comment is not valid and have an error", async () => {
|
|
94
|
-
const transaction = {
|
|
95
|
-
...common_fixtures_1.transaction,
|
|
96
|
-
amount: new bignumber_js_1.default("1"),
|
|
97
|
-
comment: { isEncrypted: false, text: "comment\nInvalid" },
|
|
98
|
-
};
|
|
99
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, transaction);
|
|
100
|
-
expect(res.errors).toEqual(expect.objectContaining({
|
|
101
|
-
transaction: new errors_2.TonCommentInvalid(),
|
|
102
|
-
}));
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
describe("Successful transaction", () => {
|
|
106
|
-
it("should not have errors", async () => {
|
|
107
|
-
const successfulResult = {
|
|
108
|
-
amount: common_fixtures_1.transaction.amount,
|
|
109
|
-
errors: {},
|
|
110
|
-
warnings: {},
|
|
111
|
-
estimatedFees: common_fixtures_1.transaction.fees,
|
|
112
|
-
totalSpent: common_fixtures_1.transaction.amount.plus(common_fixtures_1.transaction.fees),
|
|
113
|
-
};
|
|
114
|
-
const res = await (0, getTransactionStatus_1.default)(common_fixtures_1.account, common_fixtures_1.transaction);
|
|
115
|
-
expect(res).toEqual(successfulResult);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=getTransactionStatus.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTransactionStatus.unit.test.js","sourceRoot":"","sources":["../../../src/__t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C;YACxC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hw-getAddress.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/hw-getAddress.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
|
|
7
|
-
const hw_getAddress_1 = __importDefault(require("../../hw-getAddress"));
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const address = "0xc3f95102d5c8f2c83e49ce3acfb905edfb7f37de";
|
|
10
|
-
const publicKey = "mockedPublicKey";
|
|
11
|
-
const spyGetAddress = jest.fn().mockImplementation(async () => Promise.resolve({
|
|
12
|
-
publicKey,
|
|
13
|
-
address: address.toLowerCase(),
|
|
14
|
-
}));
|
|
15
|
-
const spyValidateAddress = jest.fn().mockImplementation(async () => Promise.resolve({
|
|
16
|
-
publicKey,
|
|
17
|
-
address: address.toLowerCase(),
|
|
18
|
-
}));
|
|
19
|
-
const mockSignerFactory = (_, fn) => fn({
|
|
20
|
-
getAddress: spyGetAddress,
|
|
21
|
-
validateAddress: spyValidateAddress,
|
|
22
|
-
signTransaction: jest.fn(),
|
|
23
|
-
});
|
|
24
|
-
describe("hw-getAddress", () => {
|
|
25
|
-
it("should return an encoded address and a public key when verifiy is false", async () => {
|
|
26
|
-
const getAddress = (0, hw_getAddress_1.default)(mockSignerFactory);
|
|
27
|
-
const response = await getAddress("deviceId", {
|
|
28
|
-
path: "44'/607'/0'/0'/0'/0'",
|
|
29
|
-
verify: false,
|
|
30
|
-
currency: (0, cryptoassets_1.getCryptoCurrencyById)("ton"),
|
|
31
|
-
derivationMode: "ton",
|
|
32
|
-
});
|
|
33
|
-
expect(response.address).toBe(address);
|
|
34
|
-
expect(response.publicKey).toBe(publicKey);
|
|
35
|
-
expect(spyGetAddress).toHaveBeenCalledWith((0, utils_1.getLedgerTonPath)("44'/607'/0'/0'/0'/0'"), {
|
|
36
|
-
bounceable: false,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it("should return an encoded address and a public key when verifiy is true", async () => {
|
|
40
|
-
const getAddress = (0, hw_getAddress_1.default)(mockSignerFactory);
|
|
41
|
-
const response = await getAddress("deviceId", {
|
|
42
|
-
path: "44'/607'/0'/0'/0'/0'",
|
|
43
|
-
verify: true,
|
|
44
|
-
currency: (0, cryptoassets_1.getCryptoCurrencyById)("ton"),
|
|
45
|
-
derivationMode: "ton",
|
|
46
|
-
});
|
|
47
|
-
expect(response.address).toBe(address);
|
|
48
|
-
expect(response.publicKey).toBe(publicKey);
|
|
49
|
-
expect(spyValidateAddress).toHaveBeenCalledWith((0, utils_1.getLedgerTonPath)("44'/607'/0'/0'/0'/0'"), {
|
|
50
|
-
bounceable: false,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=hw-getAddress.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hw-getAddress.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/hw-getAddress.unit.test.ts"],"names":[],"mappings":";;;;;AAAA,yDAA+D;AAC/D,wEAA2C;AAE3C,uCAA+C;AAE/C,MAAM,OAAO,GAAG,4CAA4C,CAAC;AAC7D,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAC5D,OAAO,CAAC,OAAO,CAAC;IACd,SAAS;IACT,OAAO,EAAE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C/C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,UAAU,EAAE;YAC5C,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,IAAA,oCAAqB,EAAC,KAAK,CAAC;YACtC,cAAc,EAAE,KAAK;SACtB,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,CAAC,kBAAkB,CAAC,CAAC,oBAAoB,CAAC,IAAA,wBAAgB,EAAC,sBAAsB,CAAC,EAAE;YACxF,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logic.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/logic.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
|
|
4
|
-
const logic_1 = require("../../logic");
|
|
5
|
-
describe("getSyncHash", () => {
|
|
6
|
-
const currency = (0, cryptoassets_1.getCryptoCurrencyById)("ton");
|
|
7
|
-
it("should provide a valid hex hash", () => {
|
|
8
|
-
// mumurhash is always returning a 32bits uint, so a 4 bytes hexa string
|
|
9
|
-
expect((0, logic_1.getSyncHash)(currency, [])).toStrictEqual(expect.stringMatching(/^0x[A-Fa-f0-9]{8}$/));
|
|
10
|
-
});
|
|
11
|
-
it("should provide a new hash if a token is added to the blacklistedTokenIds", () => {
|
|
12
|
-
const token = (0, cryptoassets_1.findTokenById)("ton/jetton/eqcxe6mutqjkfngfarotkot1lzbdiix1kcixrv7nw2id_sds");
|
|
13
|
-
if (!token)
|
|
14
|
-
throw new Error("TON jetton token not found");
|
|
15
|
-
expect((0, logic_1.getSyncHash)(currency, [])).not.toEqual((0, logic_1.getSyncHash)(currency, [token.id]));
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=logic.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logic.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/logic.unit.test.ts"],"names":[],"mappings":";;AAAA,yDAA8E;AAC9E,uCAA0C;AAE1C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAG,IAAA,oCAAqB,EAAC,KAAK,CAAC,CAAC;IAE9C,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,wEAAwE;QACxE,MAAM,CAAC,IAAA,mBAAW,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,MAAM,KAAK,GAAG,IAAA,4BAAa,EAAC,6DAA6D,CAAC,CAAC;QAC3F,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAA,mBAAW,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAA,mBAAW,EAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepareTransaction.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/prepareTransaction.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
30
|
-
const api_1 = require("../../bridge/bridgeHelpers/api");
|
|
31
|
-
const config_1 = require("../../config");
|
|
32
|
-
const prepareTransaction_1 = __importDefault(require("../../prepareTransaction"));
|
|
33
|
-
const api_fixtures_1 = __importStar(require("../fixtures/api.fixtures"));
|
|
34
|
-
const common_fixtures_1 = require("../fixtures/common.fixtures");
|
|
35
|
-
jest.mock("../../bridge/bridgeHelpers/api");
|
|
36
|
-
describe("prepareTransaction", () => {
|
|
37
|
-
beforeAll(() => {
|
|
38
|
-
const fetchAccountInfoMock = jest.mocked(api_1.fetchAccountInfo);
|
|
39
|
-
fetchAccountInfoMock.mockReturnValue(Promise.resolve(common_fixtures_1.accountInfo));
|
|
40
|
-
const fetchEstimateFeeMock = jest.mocked(api_1.estimateFee);
|
|
41
|
-
fetchEstimateFeeMock.mockReturnValue(Promise.resolve(common_fixtures_1.fees));
|
|
42
|
-
(0, config_1.setCoinConfig)(() => ({
|
|
43
|
-
status: {
|
|
44
|
-
type: "active",
|
|
45
|
-
},
|
|
46
|
-
infra: {
|
|
47
|
-
API_TON_ENDPOINT: api_fixtures_1.API_TON_ENDPOINT,
|
|
48
|
-
KNOWN_JETTONS: [],
|
|
49
|
-
},
|
|
50
|
-
}));
|
|
51
|
-
api_fixtures_1.default.listen();
|
|
52
|
-
});
|
|
53
|
-
afterAll(() => {
|
|
54
|
-
api_fixtures_1.default.close();
|
|
55
|
-
});
|
|
56
|
-
describe("Ton Transaction", () => {
|
|
57
|
-
it("should return the transaction with the updated amount and fees", async () => {
|
|
58
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, common_fixtures_1.transaction);
|
|
59
|
-
expect(transaction).toEqual({
|
|
60
|
-
...common_fixtures_1.transaction,
|
|
61
|
-
fees: common_fixtures_1.totalFees,
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
it("should preserve the reference when no change is detected on the transaction", async () => {
|
|
65
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, { ...common_fixtures_1.transaction });
|
|
66
|
-
const transaction2 = await (0, prepareTransaction_1.default)(common_fixtures_1.account, transaction);
|
|
67
|
-
expect(transaction).toBe(transaction2);
|
|
68
|
-
});
|
|
69
|
-
it("should create a coin transaction using the spendableBalance in the account", async () => {
|
|
70
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, {
|
|
71
|
-
...common_fixtures_1.transaction,
|
|
72
|
-
useAllAmount: true,
|
|
73
|
-
});
|
|
74
|
-
expect(transaction).toEqual({
|
|
75
|
-
...common_fixtures_1.transaction,
|
|
76
|
-
useAllAmount: true,
|
|
77
|
-
fees: common_fixtures_1.totalFees,
|
|
78
|
-
amount: common_fixtures_1.account.spendableBalance.minus(common_fixtures_1.totalFees),
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
describe("Jetton Transaction", () => {
|
|
83
|
-
it("should return the transaction with the updated amount and fees", async () => {
|
|
84
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, common_fixtures_1.jettonTransaction);
|
|
85
|
-
expect(transaction).toEqual({
|
|
86
|
-
...common_fixtures_1.jettonTransaction,
|
|
87
|
-
fees: (0, bignumber_js_1.default)("100000000"),
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
it("should preserve the reference when no change is detected on the transaction", async () => {
|
|
91
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, { ...common_fixtures_1.jettonTransaction });
|
|
92
|
-
const transaction2 = await (0, prepareTransaction_1.default)(common_fixtures_1.account, transaction);
|
|
93
|
-
expect(transaction).toBe(transaction2);
|
|
94
|
-
});
|
|
95
|
-
it("should create a coin transaction using the spendableBalance in the account", async () => {
|
|
96
|
-
const transaction = await (0, prepareTransaction_1.default)(common_fixtures_1.account, {
|
|
97
|
-
...common_fixtures_1.jettonTransaction,
|
|
98
|
-
useAllAmount: true,
|
|
99
|
-
});
|
|
100
|
-
expect(transaction).toEqual({
|
|
101
|
-
...common_fixtures_1.jettonTransaction,
|
|
102
|
-
useAllAmount: true,
|
|
103
|
-
fees: (0, bignumber_js_1.default)("100000000"),
|
|
104
|
-
amount: common_fixtures_1.account.subAccounts?.[0].spendableBalance,
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
//# sourceMappingURL=prepareTransaction.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepareTransaction.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/prepareTransaction.unit.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,wDAA+E;AAC/E,yCAA6C;AAC7C,kFAA0D;AAC1D,yEAAwE;AACxE,iEAOqC;AAErC,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAE5C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,sBAAgB,CAAC,CAAC;QAC3D,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,6BAAW,CAAC,CAAC,CAAC;QACnE,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAW,CAAC,CAAC;QACtD,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAI,CAAC,CAAC,CAAC;QAE5D,IAAA,sBAAa,EAAC,GAAG,EAAE,CAAC,CAAC;YACnB,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,gBAAgB,EAAE,+BAAgB;gBAClC,aAAa,EAAE,EAAE;aAClB;SACF,CAAC,CAAC,CAAC;QACJ,sBAAU,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,EAAE;QACZ,sBAAU,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;YAC9E,MAAM,WAAW,GAAG,MAAM,IAAA,4BAAkB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