@ledgerhq/coin-aptos 2.1.0-nightly.1 → 2.1.0-nightly.2
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 +11 -0
- package/jest.config.js +2 -5
- package/lib/__tests__/api/craftTransaction.unit.test.js +16 -31
- package/lib/__tests__/api/craftTransaction.unit.test.js.map +1 -1
- package/lib/__tests__/api/index.integ.test.js +14 -7
- package/lib/__tests__/api/index.integ.test.js.map +1 -1
- package/lib/__tests__/api/index.test.js.map +1 -1
- package/lib/__tests__/network/client.test.js +6 -3
- package/lib/__tests__/network/client.test.js.map +1 -1
- package/lib/api/index.d.ts +3 -3
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.js.map +1 -1
- package/lib/logic/craftTransaction.d.ts +2 -2
- package/lib/logic/craftTransaction.d.ts.map +1 -1
- package/lib/logic/craftTransaction.js +3 -3
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/network/client.d.ts +2 -2
- package/lib/network/client.d.ts.map +1 -1
- package/lib/network/client.js +3 -2
- package/lib/network/client.js.map +1 -1
- package/lib/types/assets.d.ts +0 -4
- package/lib/types/assets.d.ts.map +1 -1
- package/lib-es/__tests__/api/craftTransaction.unit.test.js +16 -31
- package/lib-es/__tests__/api/craftTransaction.unit.test.js.map +1 -1
- package/lib-es/__tests__/api/index.integ.test.js +14 -7
- package/lib-es/__tests__/api/index.integ.test.js.map +1 -1
- package/lib-es/__tests__/api/index.test.js.map +1 -1
- package/lib-es/__tests__/network/client.test.js +6 -3
- package/lib-es/__tests__/network/client.test.js.map +1 -1
- package/lib-es/api/index.d.ts +3 -3
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/logic/craftTransaction.d.ts +2 -2
- package/lib-es/logic/craftTransaction.d.ts.map +1 -1
- package/lib-es/logic/craftTransaction.js +3 -3
- package/lib-es/logic/craftTransaction.js.map +1 -1
- package/lib-es/network/client.d.ts +2 -2
- package/lib-es/network/client.d.ts.map +1 -1
- package/lib-es/network/client.js +3 -2
- package/lib-es/network/client.js.map +1 -1
- package/lib-es/types/assets.d.ts +0 -4
- package/lib-es/types/assets.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/__tests__/api/craftTransaction.unit.test.ts +22 -37
- package/src/__tests__/api/index.integ.test.ts +17 -11
- package/src/__tests__/api/index.test.ts +4 -6
- package/src/__tests__/network/client.test.ts +13 -10
- package/src/api/index.ts +4 -6
- package/src/logic/craftTransaction.ts +6 -8
- package/src/network/client.ts +5 -10
- package/src/types/assets.ts +0 -5
package/src/network/client.ts
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
Pagination,
|
|
45
45
|
TransactionIntent,
|
|
46
46
|
} from "@ledgerhq/coin-framework/api/types";
|
|
47
|
-
import { AptosAsset
|
|
47
|
+
import { AptosAsset } from "../types/assets";
|
|
48
48
|
import { log } from "@ledgerhq/logs";
|
|
49
49
|
import { transactionsToOperations } from "../logic/transactionsToOperations";
|
|
50
50
|
import { isTestnet } from "../logic/isTestnet";
|
|
@@ -223,10 +223,8 @@ export class AptosAPI {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
async estimateFees(
|
|
227
|
-
transactionIntent
|
|
228
|
-
): Promise<FeeEstimation<AptosFeeParameters>> {
|
|
229
|
-
const publicKeyEd = new Ed25519PublicKey(transactionIntent.sender.xpub);
|
|
226
|
+
async estimateFees(transactionIntent: TransactionIntent<AptosAsset>): Promise<FeeEstimation> {
|
|
227
|
+
const publicKeyEd = new Ed25519PublicKey(transactionIntent?.senderPublicKey ?? "");
|
|
230
228
|
|
|
231
229
|
const txPayload: InputEntryFunctionData = {
|
|
232
230
|
function: "0x1::aptos_account::transfer_coins",
|
|
@@ -256,11 +254,7 @@ export class AptosAPI {
|
|
|
256
254
|
gasUnitPrice: DEFAULT_GAS_PRICE.toString(),
|
|
257
255
|
};
|
|
258
256
|
|
|
259
|
-
const tx = await this.generateTransaction(
|
|
260
|
-
transactionIntent.sender.freshAddress,
|
|
261
|
-
txPayload,
|
|
262
|
-
txOptions,
|
|
263
|
-
);
|
|
257
|
+
const tx = await this.generateTransaction(transactionIntent.sender, txPayload, txOptions);
|
|
264
258
|
|
|
265
259
|
const simulation = await this.simulateTransaction(publicKeyEd, tx);
|
|
266
260
|
const completedTx = simulation[0];
|
|
@@ -273,6 +267,7 @@ export class AptosAPI {
|
|
|
273
267
|
return {
|
|
274
268
|
value: BigInt(expectedGas.toString()),
|
|
275
269
|
parameters: {
|
|
270
|
+
storageLimit: BigInt(0),
|
|
276
271
|
gasLimit: BigInt(gasLimit.toString()),
|
|
277
272
|
gasPrice: BigInt(gasPrice.toString()),
|
|
278
273
|
},
|
package/src/types/assets.ts
CHANGED
|
@@ -9,11 +9,6 @@ export type AptosTokenInformation = {
|
|
|
9
9
|
|
|
10
10
|
export type AptosExtra = Record<string, unknown>;
|
|
11
11
|
|
|
12
|
-
export type AptosSender = {
|
|
13
|
-
xpub: string;
|
|
14
|
-
freshAddress: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
12
|
export type AptosFeeParameters = {
|
|
18
13
|
gasLimit: bigint;
|
|
19
14
|
gasPrice: bigint;
|