@ledgerhq/coin-tezos 6.3.0 → 6.4.0-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/CHANGELOG.md +20 -0
- package/lib/api/index.integ.test.js +12 -5
- package/lib/api/index.integ.test.js.map +1 -1
- package/lib/api/index.js +8 -39
- package/lib/api/index.js.map +1 -1
- package/lib/api/index.test.js +5 -5
- package/lib/api/index.test.js.map +1 -1
- package/lib/bridge/prepareTransaction.test.js +2 -2
- package/lib/bridge/prepareTransaction.test.js.map +1 -1
- package/lib/bridge/signOperation.test.js +1 -1
- package/lib/bridge/signOperation.test.js.map +1 -1
- package/lib/logic/craftTransaction.js +1 -1
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/logic/craftTransaction.test.js +1 -1
- package/lib/logic/craftTransaction.test.js.map +1 -1
- package/lib/logic/estimateFees.integ.test.js +5 -5
- package/lib/logic/estimateFees.js +4 -4
- package/lib/logic/estimateFees.js.map +1 -1
- package/lib/logic/listOperations.d.ts.map +1 -1
- package/lib/logic/listOperations.js +2 -5
- package/lib/logic/listOperations.js.map +1 -1
- package/lib/logic/listOperations.test.js +2 -2
- package/lib/logic/listOperations.test.js.map +1 -1
- package/lib-es/api/index.integ.test.js +12 -5
- package/lib-es/api/index.integ.test.js.map +1 -1
- package/lib-es/api/index.js +8 -39
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/api/index.test.js +5 -5
- package/lib-es/api/index.test.js.map +1 -1
- package/lib-es/bridge/prepareTransaction.test.js +3 -3
- package/lib-es/bridge/prepareTransaction.test.js.map +1 -1
- package/lib-es/bridge/signOperation.test.js +2 -2
- package/lib-es/bridge/signOperation.test.js.map +1 -1
- package/lib-es/logic/craftTransaction.js +2 -2
- package/lib-es/logic/craftTransaction.js.map +1 -1
- package/lib-es/logic/craftTransaction.test.js +2 -2
- package/lib-es/logic/craftTransaction.test.js.map +1 -1
- package/lib-es/logic/estimateFees.integ.test.js +5 -5
- package/lib-es/logic/estimateFees.js +6 -6
- package/lib-es/logic/estimateFees.js.map +1 -1
- package/lib-es/logic/listOperations.d.ts.map +1 -1
- package/lib-es/logic/listOperations.js +2 -5
- package/lib-es/logic/listOperations.js.map +1 -1
- package/lib-es/logic/listOperations.test.js +2 -2
- package/lib-es/logic/listOperations.test.js.map +1 -1
- package/package.json +11 -11
- package/src/api/index.integ.test.ts +16 -5
- package/src/api/index.test.ts +5 -5
- package/src/api/index.ts +14 -58
- package/src/bridge/prepareTransaction.test.ts +7 -3
- package/src/bridge/signOperation.test.ts +2 -2
- package/src/logic/craftTransaction.test.ts +2 -2
- package/src/logic/craftTransaction.ts +2 -2
- package/src/logic/estimateFees.integ.test.ts +5 -5
- package/src/logic/estimateFees.ts +7 -7
- package/src/logic/listOperations.test.ts +2 -2
- package/src/logic/listOperations.ts +4 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.test.js","sourceRoot":"","sources":["../../src/logic/listOperations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,0BAA0B,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC7C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7B,IAAI,EAAE;QACJ,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAC/B,OAAO,0BAA0B,EAAE,CAAC;QACtC,CAAC;KACF;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,OAAO,GAA4D;IACvE,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,CAAC;CACb,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,SAAS,CAAC,GAAG,EAAE;QACb,0BAA0B,CAAC,SAAS,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,I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
|
|
68
68
|
"license": "Apache-2.0",
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@taquito/ledger-signer": "^
|
|
71
|
-
"@taquito/rpc": "^
|
|
72
|
-
"@taquito/taquito": "^
|
|
73
|
-
"@taquito/utils": "^
|
|
70
|
+
"@taquito/ledger-signer": "^23.0.0-RC.0",
|
|
71
|
+
"@taquito/rpc": "^23.0.0-RC.0",
|
|
72
|
+
"@taquito/taquito": "^23.0.0-RC.0",
|
|
73
|
+
"@taquito/utils": "^23.0.0-RC.0",
|
|
74
74
|
"bignumber.js": "^9.1.2",
|
|
75
75
|
"blake2b": "^2.1.4",
|
|
76
76
|
"bs58check": "^3.0.1",
|
|
77
77
|
"invariant": "^2.2.4",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"rxjs": "^7.8.1",
|
|
80
|
-
"@ledgerhq/coin-framework": "^6.
|
|
81
|
-
"@ledgerhq/cryptoassets": "^13.
|
|
80
|
+
"@ledgerhq/coin-framework": "^6.4.0-nightly.1",
|
|
81
|
+
"@ledgerhq/cryptoassets": "^13.28.0-nightly.0",
|
|
82
82
|
"@ledgerhq/devices": "8.5.1",
|
|
83
83
|
"@ledgerhq/errors": "^6.25.0",
|
|
84
|
-
"@ledgerhq/live-network": "^2.0.
|
|
84
|
+
"@ledgerhq/live-network": "^2.0.17-nightly.0",
|
|
85
85
|
"@ledgerhq/logs": "^6.13.0",
|
|
86
86
|
"@ledgerhq/types-cryptoassets": "^7.26.0",
|
|
87
87
|
"@ledgerhq/types-live": "^6.83.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@faker-js/faker": "^8.4.1",
|
|
91
|
-
"@taquito/local-forging": "
|
|
91
|
+
"@taquito/local-forging": "^23.0.0-RC.0",
|
|
92
92
|
"@types/blake2b": "^2.1.3",
|
|
93
93
|
"@types/bs58check": "^2.1.2",
|
|
94
94
|
"@types/invariant": "^2.2.37",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"test": "jest",
|
|
119
119
|
"test-watch": "jest --watch",
|
|
120
120
|
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
|
|
121
|
-
"test-integ": "jest --config=jest.integ.config.js",
|
|
122
|
-
"test-integ:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --config=jest.integ.config.js",
|
|
121
|
+
"test-integ": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config=jest.integ.config.js",
|
|
122
|
+
"test-integ:debug": "node --inspect-brk --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand --config=jest.integ.config.js",
|
|
123
123
|
"unimported": "unimported"
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -57,7 +57,7 @@ describe("Tezos Api", () => {
|
|
|
57
57
|
describe("listOperations", () => {
|
|
58
58
|
it("returns a list regarding address parameter", async () => {
|
|
59
59
|
// When
|
|
60
|
-
const [tx, _] = await module.listOperations(address, { minHeight: 0 });
|
|
60
|
+
const [tx, _] = await module.listOperations(address, { minHeight: 0, order: "asc" });
|
|
61
61
|
|
|
62
62
|
// Then
|
|
63
63
|
expect(tx.length).toBeGreaterThanOrEqual(1);
|
|
@@ -71,13 +71,24 @@ describe("Tezos Api", () => {
|
|
|
71
71
|
|
|
72
72
|
it("returns all operations", async () => {
|
|
73
73
|
// When
|
|
74
|
-
const [tx, _] = await module.listOperations(address, { minHeight: 0 });
|
|
74
|
+
const [tx, _] = await module.listOperations(address, { minHeight: 0, order: "asc" });
|
|
75
75
|
|
|
76
76
|
// Then
|
|
77
77
|
// Find a way to create a unique id. In Tezos, the same hash may represent different operations in case of delegation.
|
|
78
78
|
const checkSet = new Set(tx.map(elt => `${elt.tx.hash}${elt.type}${elt.senders[0]}`));
|
|
79
79
|
expect(checkSet.size).toEqual(tx.length);
|
|
80
80
|
});
|
|
81
|
+
|
|
82
|
+
it("returns operations from latest, but in asc order", async () => {
|
|
83
|
+
// When
|
|
84
|
+
const [txDesc] = await module.listOperations(address, { minHeight: 0, order: "desc" });
|
|
85
|
+
|
|
86
|
+
// Then
|
|
87
|
+
// Check if the result is sorted in ascending order
|
|
88
|
+
expect(txDesc[0].tx.block.height).toBeGreaterThanOrEqual(
|
|
89
|
+
txDesc[txDesc.length - 1].tx.block.height,
|
|
90
|
+
);
|
|
91
|
+
});
|
|
81
92
|
});
|
|
82
93
|
|
|
83
94
|
describe("lastBlock", () => {
|
|
@@ -114,7 +125,7 @@ describe("Tezos Api", () => {
|
|
|
114
125
|
const recipient = "tz1aWXP237BLwNHJcCD4b3DutCevhqq2T1Z9";
|
|
115
126
|
const amount = BigInt(10);
|
|
116
127
|
// When
|
|
117
|
-
const encodedTransaction = await module.craftTransaction({
|
|
128
|
+
const { transaction: encodedTransaction } = await module.craftTransaction({
|
|
118
129
|
asset: { type: "native" },
|
|
119
130
|
type,
|
|
120
131
|
sender: address,
|
|
@@ -138,7 +149,7 @@ describe("Tezos Api", () => {
|
|
|
138
149
|
});
|
|
139
150
|
|
|
140
151
|
it("should use estimated fees when user does not provide them for crafting a transaction", async () => {
|
|
141
|
-
const encodedTransaction = await module.craftTransaction({
|
|
152
|
+
const { transaction: encodedTransaction } = await module.craftTransaction({
|
|
142
153
|
asset: { type: "native" },
|
|
143
154
|
type: "send",
|
|
144
155
|
sender: address,
|
|
@@ -154,7 +165,7 @@ describe("Tezos Api", () => {
|
|
|
154
165
|
it.each([1n, 50n, 99n])(
|
|
155
166
|
"should use custom user fees when user provides it for crafting a transaction",
|
|
156
167
|
async (customFees: bigint) => {
|
|
157
|
-
const encodedTransaction = await module.craftTransaction(
|
|
168
|
+
const { transaction: encodedTransaction } = await module.craftTransaction(
|
|
158
169
|
{
|
|
159
170
|
asset: { type: "native" },
|
|
160
171
|
type: "send",
|
package/src/api/index.test.ts
CHANGED
|
@@ -57,7 +57,7 @@ describe("get operations", () => {
|
|
|
57
57
|
|
|
58
58
|
it("could return no operation", async () => {
|
|
59
59
|
logicGetTransactions.mockResolvedValue([[], ""]);
|
|
60
|
-
const [operations, token] = await api.listOperations("addr", { minHeight: 100 });
|
|
60
|
+
const [operations, token] = await api.listOperations("addr", { minHeight: 100, order: "asc" });
|
|
61
61
|
expect(operations).toEqual([]);
|
|
62
62
|
expect(token).toEqual("");
|
|
63
63
|
});
|
|
@@ -81,11 +81,11 @@ describe("get operations", () => {
|
|
|
81
81
|
recipients: ["tz1Recipient"],
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
it("
|
|
84
|
+
it("only does 1 iteration", async () => {
|
|
85
85
|
logicGetTransactions.mockResolvedValue([[op], "888"]);
|
|
86
|
-
const [operations, token] = await api.listOperations("addr", { minHeight: 100 });
|
|
87
|
-
expect(logicGetTransactions).toHaveBeenCalledTimes(
|
|
88
|
-
expect(operations.length).toBe(
|
|
86
|
+
const [operations, token] = await api.listOperations("addr", { minHeight: 100, order: "asc" });
|
|
87
|
+
expect(logicGetTransactions).toHaveBeenCalledTimes(1);
|
|
88
|
+
expect(operations.length).toBe(1);
|
|
89
89
|
expect(token).toEqual("888");
|
|
90
90
|
});
|
|
91
91
|
});
|
package/src/api/index.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type Pagination,
|
|
10
10
|
Reward,
|
|
11
11
|
Stake,
|
|
12
|
+
CraftedTransaction,
|
|
12
13
|
} from "@ledgerhq/coin-framework/api/index";
|
|
13
|
-
import { log } from "@ledgerhq/logs";
|
|
14
14
|
import coinConfig, { type TezosConfig } from "../config";
|
|
15
15
|
import {
|
|
16
16
|
broadcast,
|
|
@@ -70,7 +70,7 @@ async function balance(address: string): Promise<Balance[]> {
|
|
|
70
70
|
async function craft(
|
|
71
71
|
transactionIntent: TransactionIntent,
|
|
72
72
|
customFees?: FeeEstimation,
|
|
73
|
-
): Promise<
|
|
73
|
+
): Promise<CraftedTransaction> {
|
|
74
74
|
if (!isTezosTransactionType(transactionIntent.type)) {
|
|
75
75
|
throw new IncorrectTypeError(transactionIntent.type);
|
|
76
76
|
}
|
|
@@ -91,7 +91,10 @@ async function craft(
|
|
|
91
91
|
fee,
|
|
92
92
|
},
|
|
93
93
|
);
|
|
94
|
-
|
|
94
|
+
|
|
95
|
+
const tx = await rawEncode(contents);
|
|
96
|
+
|
|
97
|
+
return { transaction: tx };
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
async function estimate(transactionIntent: TransactionIntent): Promise<TezosFeeEstimation> {
|
|
@@ -131,62 +134,15 @@ async function estimate(transactionIntent: TransactionIntent): Promise<TezosFeeE
|
|
|
131
134
|
};
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
type PaginationState = {
|
|
135
|
-
readonly pageSize: number;
|
|
136
|
-
readonly maxIterations: number; // a security to avoid infinite loop
|
|
137
|
-
currentIteration: number;
|
|
138
|
-
readonly minHeight: number;
|
|
139
|
-
continueIterations: boolean;
|
|
140
|
-
nextCursor?: string;
|
|
141
|
-
accumulator: Operation[];
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
async function fetchNextPage(address: string, state: PaginationState): Promise<PaginationState> {
|
|
145
|
-
const [operations, newNextCursor] = await listOperations(address, {
|
|
146
|
-
limit: state.pageSize,
|
|
147
|
-
token: state.nextCursor,
|
|
148
|
-
sort: "Ascending",
|
|
149
|
-
minHeight: state.minHeight,
|
|
150
|
-
});
|
|
151
|
-
const newCurrentIteration = state.currentIteration + 1;
|
|
152
|
-
let continueIteration = newNextCursor !== "";
|
|
153
|
-
if (newCurrentIteration >= state.maxIterations) {
|
|
154
|
-
log("coin:tezos", "(api/operations): max iterations reached", state.maxIterations);
|
|
155
|
-
continueIteration = false;
|
|
156
|
-
}
|
|
157
|
-
const accumulated = operations.concat(state.accumulator);
|
|
158
|
-
return {
|
|
159
|
-
...state,
|
|
160
|
-
continueIterations: continueIteration,
|
|
161
|
-
currentIteration: newCurrentIteration,
|
|
162
|
-
nextCursor: newNextCursor,
|
|
163
|
-
accumulator: accumulated,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async function operationsFromHeight(
|
|
168
|
-
address: string,
|
|
169
|
-
start: number,
|
|
170
|
-
): Promise<[Operation[], string]> {
|
|
171
|
-
const firstState: PaginationState = {
|
|
172
|
-
pageSize: 200,
|
|
173
|
-
maxIterations: 10,
|
|
174
|
-
currentIteration: 0,
|
|
175
|
-
minHeight: start,
|
|
176
|
-
continueIterations: true,
|
|
177
|
-
accumulator: [],
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
let state = await fetchNextPage(address, firstState);
|
|
181
|
-
while (state.continueIterations) {
|
|
182
|
-
state = await fetchNextPage(address, state);
|
|
183
|
-
}
|
|
184
|
-
return [state.accumulator, state.nextCursor || ""];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
137
|
async function operations(
|
|
188
138
|
address: string,
|
|
189
|
-
pagination: Pagination = { minHeight: 0 },
|
|
139
|
+
pagination: Pagination = { minHeight: 0, order: "asc" },
|
|
190
140
|
): Promise<[Operation[], string]> {
|
|
191
|
-
|
|
141
|
+
const [operations, newNextCursor] = await listOperations(address, {
|
|
142
|
+
limit: 200,
|
|
143
|
+
token: pagination.lastPagingToken,
|
|
144
|
+
sort: pagination.order === "asc" ? "Ascending" : "Descending",
|
|
145
|
+
minHeight: pagination.minHeight,
|
|
146
|
+
});
|
|
147
|
+
return [operations, newNextCursor || ""];
|
|
192
148
|
}
|
|
@@ -4,7 +4,7 @@ import prepareTransaction from "./prepareTransaction";
|
|
|
4
4
|
import { faker } from "@faker-js/faker";
|
|
5
5
|
import coinConfig, { TezosCoinConfig } from "../config";
|
|
6
6
|
import { mockConfig } from "../test/config";
|
|
7
|
-
import { COST_PER_BYTE,
|
|
7
|
+
import { COST_PER_BYTE, getRevealFee } from "@taquito/taquito";
|
|
8
8
|
|
|
9
9
|
const mockTezosEstimate = jest.fn();
|
|
10
10
|
jest.mock("../logic/tezosToolkit", () => ({
|
|
@@ -172,14 +172,18 @@ describe("prepareTransaction", () => {
|
|
|
172
172
|
|
|
173
173
|
// Then
|
|
174
174
|
const gasLimit = 500; // hardcoded in the function
|
|
175
|
-
const computedFees = new BigNumber(
|
|
175
|
+
const computedFees = new BigNumber(
|
|
176
|
+
tezosEstimate.suggestedFeeMutez + getRevealFee(account.freshAddress),
|
|
177
|
+
);
|
|
176
178
|
|
|
177
179
|
const maxAmount = account.balance.minus(computedFees);
|
|
178
180
|
|
|
179
181
|
expect(newTx).toEqual({
|
|
180
182
|
...tx,
|
|
181
183
|
fees: new BigNumber(tezosEstimate.suggestedFeeMutez),
|
|
182
|
-
estimatedFees: new BigNumber(
|
|
184
|
+
estimatedFees: new BigNumber(
|
|
185
|
+
tezosEstimate.suggestedFeeMutez + getRevealFee(account.freshAddress),
|
|
186
|
+
),
|
|
183
187
|
gasLimit: new BigNumber(tezosEstimate.gasLimit),
|
|
184
188
|
storageLimit: new BigNumber(tezosEstimate.storageLimit),
|
|
185
189
|
amount: maxAmount.minus(gasLimit - (tezosEstimate.opSize + gasLimit * 0.1)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getRevealFee, OpKind } from "@taquito/taquito";
|
|
3
3
|
import { SignOperationEvent } from "@ledgerhq/types-live";
|
|
4
4
|
import buildSignOperation, { getOperationContents } from "./signOperation";
|
|
5
5
|
import config, { type TezosCoinConfig } from "../config";
|
|
@@ -260,7 +260,7 @@ describe("getOperationContents - revealed account", () => {
|
|
|
260
260
|
expect(contents).toStrictEqual([
|
|
261
261
|
{
|
|
262
262
|
kind: OpKind.REVEAL,
|
|
263
|
-
fee:
|
|
263
|
+
fee: getRevealFee(account.freshAddress).toString(),
|
|
264
264
|
gas_limit: "100",
|
|
265
265
|
storage_limit: "200",
|
|
266
266
|
source: "pkh",
|
|
@@ -2,7 +2,7 @@ import { craftTransaction, rawEncode } from "./craftTransaction";
|
|
|
2
2
|
import { getTezosToolkit } from "./tezosToolkit";
|
|
3
3
|
import coinConfig from "../config";
|
|
4
4
|
import { OpKind } from "@taquito/rpc";
|
|
5
|
-
import {
|
|
5
|
+
import { getRevealFee } from "@taquito/taquito";
|
|
6
6
|
|
|
7
7
|
type TransactionType = "send" | "delegate" | "undelegate";
|
|
8
8
|
|
|
@@ -128,7 +128,7 @@ describe("craftTransaction", () => {
|
|
|
128
128
|
expect(result.contents).toEqual([
|
|
129
129
|
{
|
|
130
130
|
kind: OpKind.REVEAL,
|
|
131
|
-
fee:
|
|
131
|
+
fee: getRevealFee(account.address).toString(),
|
|
132
132
|
gas_limit: "100",
|
|
133
133
|
storage_limit: "0",
|
|
134
134
|
source: publicKey.publicKeyHash,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OperationContents, OpKind } from "@taquito/rpc";
|
|
2
|
-
import {
|
|
2
|
+
import { getRevealFee } from "@taquito/taquito";
|
|
3
3
|
import coinConfig from "../config";
|
|
4
4
|
import { UnsupportedTransactionMode } from "../types/errors";
|
|
5
5
|
import { getTezosToolkit } from "./tezosToolkit";
|
|
@@ -48,7 +48,7 @@ export async function craftTransaction(
|
|
|
48
48
|
const revealGasLimit = Math.max(revealFees?.gasLimit || 0, minRevealGasLimit);
|
|
49
49
|
contents.push({
|
|
50
50
|
kind: OpKind.REVEAL,
|
|
51
|
-
fee:
|
|
51
|
+
fee: getRevealFee(address).toString(),
|
|
52
52
|
//TODO: use instead of previous line when this PR will be validated, as the value change (don't forget to update the test too)
|
|
53
53
|
// fee: getRevealFee(address).toString(),
|
|
54
54
|
gas_limit: revealGasLimit.toString(),
|
|
@@ -34,8 +34,8 @@ describe("estimateFees", () => {
|
|
|
34
34
|
const result = await estimateFees({ account, transaction });
|
|
35
35
|
// Then
|
|
36
36
|
expect(result).toEqual({
|
|
37
|
-
estimatedFees: BigInt("
|
|
38
|
-
fees: BigInt("
|
|
37
|
+
estimatedFees: BigInt("825"),
|
|
38
|
+
fees: BigInt("491"),
|
|
39
39
|
gasLimit: BigInt("2169"),
|
|
40
40
|
storageLimit: BigInt("277"),
|
|
41
41
|
amount: BigInt("1000000"),
|
|
@@ -56,11 +56,11 @@ describe("estimateFees", () => {
|
|
|
56
56
|
|
|
57
57
|
// Then
|
|
58
58
|
expect(result).toEqual({
|
|
59
|
-
estimatedFees: BigInt("
|
|
60
|
-
fees: BigInt("
|
|
59
|
+
estimatedFees: BigInt("823"),
|
|
60
|
+
fees: BigInt("489"),
|
|
61
61
|
gasLimit: BigInt("2169"),
|
|
62
62
|
storageLimit: BigInt("277"),
|
|
63
|
-
amount: BigInt("
|
|
63
|
+
amount: BigInt("1934629"),
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DerivationType } from "@taquito/ledger-signer";
|
|
2
2
|
import { compressPublicKey } from "@taquito/ledger-signer/dist/lib/utils";
|
|
3
|
-
import { COST_PER_BYTE,
|
|
4
|
-
import {
|
|
3
|
+
import { COST_PER_BYTE, getRevealFee, ORIGINATION_SIZE, Estimate } from "@taquito/taquito";
|
|
4
|
+
import { b58Encode, PrefixV2 } from "@taquito/utils";
|
|
5
5
|
import { log } from "@ledgerhq/logs";
|
|
6
6
|
import { getTezosToolkit } from "./tezosToolkit";
|
|
7
7
|
import { TezosOperationMode } from "../types/model";
|
|
@@ -41,9 +41,9 @@ export async function estimateFees({
|
|
|
41
41
|
account: CoreAccountInfo;
|
|
42
42
|
transaction: CoreTransactionInfo;
|
|
43
43
|
}): Promise<EstimatedFees> {
|
|
44
|
-
const encodedPubKey =
|
|
44
|
+
const encodedPubKey = b58Encode(
|
|
45
45
|
compressPublicKey(Buffer.from(account.xpub || "", "hex"), DerivationType.ED25519),
|
|
46
|
-
|
|
46
|
+
PrefixV2.Ed25519PublicKey,
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
const tezosToolkit = getTezosToolkit();
|
|
@@ -81,7 +81,7 @@ export async function estimateFees({
|
|
|
81
81
|
mutez: true,
|
|
82
82
|
to: transaction.recipient,
|
|
83
83
|
amount: Number(amount),
|
|
84
|
-
storageLimit:
|
|
84
|
+
storageLimit: ORIGINATION_SIZE, // https://github.com/TezTech/eztz/blob/master/PROTO_003_FEES.md for originating an account
|
|
85
85
|
});
|
|
86
86
|
break;
|
|
87
87
|
case "delegate":
|
|
@@ -110,7 +110,7 @@ export async function estimateFees({
|
|
|
110
110
|
}
|
|
111
111
|
const maxAmount =
|
|
112
112
|
parseInt(account.balance.toString()) -
|
|
113
|
-
(totalFees + (account.revealed ? 0 :
|
|
113
|
+
(totalFees + (account.revealed ? 0 : getRevealFee(account.address)));
|
|
114
114
|
// NOTE: from https://github.com/ecadlabs/taquito/blob/a70c64c4b105381bb9f1d04c9c70e8ef26e9241c/integration-tests/contract-empty-implicit-account-into-new-implicit-account.spec.ts#L33
|
|
115
115
|
// Temporary fix, see https://gitlab.com/tezos/tezos/-/issues/1754
|
|
116
116
|
// we need to increase the gasLimit and fee returned by the estimation
|
|
@@ -134,7 +134,7 @@ export async function estimateFees({
|
|
|
134
134
|
estimation.storageLimit = BigInt(estimate.storageLimit);
|
|
135
135
|
estimation.estimatedFees = estimation.fees;
|
|
136
136
|
if (!account.revealed) {
|
|
137
|
-
estimation.estimatedFees = estimation.estimatedFees + BigInt(
|
|
137
|
+
estimation.estimatedFees = estimation.estimatedFees + BigInt(getRevealFee(account.address));
|
|
138
138
|
}
|
|
139
139
|
} catch (e) {
|
|
140
140
|
if (typeof e !== "object" || !e) throw e;
|
|
@@ -201,8 +201,8 @@ describe("listOperations", () => {
|
|
|
201
201
|
});
|
|
202
202
|
|
|
203
203
|
it("should order the results in descending order even if the sort option is set to ascending", async () => {
|
|
204
|
-
const op1 = { ...undelegate, level: "1" };
|
|
205
|
-
const op2 = { ...undelegate, level: "2" };
|
|
204
|
+
const op1 = { ...undelegate, level: "1", timestamp: "2022-09-12T01:00:00Z" };
|
|
205
|
+
const op2 = { ...undelegate, level: "2", timestamp: "2022-09-12T01:01:00Z" };
|
|
206
206
|
mockNetworkGetTransactions.mockResolvedValue([op1, op2]);
|
|
207
207
|
const [results, _] = await listOperations("any address", options);
|
|
208
208
|
expect(results.map(op => op.tx.block.height)).toEqual(["2", "1"]);
|
|
@@ -45,11 +45,10 @@ export async function listOperations(
|
|
|
45
45
|
const filteredOperations = operations
|
|
46
46
|
.filter(op => isAPITransactionType(op) || isAPIDelegationType(op) || isAPIRevealType(op))
|
|
47
47
|
.reduce((acc, op) => acc.concat(convertOperation(address, op)), [] as Operation[]);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return [filteredOperations, nextToken];
|
|
48
|
+
const sortedOperations = filteredOperations.sort(
|
|
49
|
+
(a, b) => b.tx.date.getTime() - a.tx.date.getTime(),
|
|
50
|
+
);
|
|
51
|
+
return [sortedOperations, nextToken];
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
// note that "initiator" of APITransactionType is never used in the conversion
|