@ledgerhq/coin-aptos 2.4.0 → 2.5.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/__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 +3 -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
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
Pagination,
|
|
44
44
|
TransactionIntent,
|
|
45
45
|
} from "@ledgerhq/coin-framework/api/types";
|
|
46
|
-
import { AptosAsset
|
|
46
|
+
import { AptosAsset } from "../types/assets";
|
|
47
47
|
import { log } from "@ledgerhq/logs";
|
|
48
48
|
import { transactionsToOperations } from "../logic/transactionsToOperations";
|
|
49
49
|
import { isTestnet } from "../logic/isTestnet";
|
|
@@ -175,10 +175,8 @@ export class AptosAPI {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
async estimateFees(
|
|
179
|
-
transactionIntent
|
|
180
|
-
): Promise<FeeEstimation<AptosFeeParameters>> {
|
|
181
|
-
const publicKeyEd = new Ed25519PublicKey(transactionIntent.sender.xpub);
|
|
178
|
+
async estimateFees(transactionIntent: TransactionIntent<AptosAsset>): Promise<FeeEstimation> {
|
|
179
|
+
const publicKeyEd = new Ed25519PublicKey(transactionIntent?.senderPublicKey ?? "");
|
|
182
180
|
|
|
183
181
|
const txPayload: InputEntryFunctionData = {
|
|
184
182
|
function: "0x1::aptos_account::transfer_coins",
|
|
@@ -208,11 +206,7 @@ export class AptosAPI {
|
|
|
208
206
|
gasUnitPrice: DEFAULT_GAS_PRICE.toString(),
|
|
209
207
|
};
|
|
210
208
|
|
|
211
|
-
const tx = await this.generateTransaction(
|
|
212
|
-
transactionIntent.sender.freshAddress,
|
|
213
|
-
txPayload,
|
|
214
|
-
txOptions,
|
|
215
|
-
);
|
|
209
|
+
const tx = await this.generateTransaction(transactionIntent.sender, txPayload, txOptions);
|
|
216
210
|
|
|
217
211
|
const simulation = await this.simulateTransaction(publicKeyEd, tx);
|
|
218
212
|
const completedTx = simulation[0];
|
|
@@ -225,6 +219,7 @@ export class AptosAPI {
|
|
|
225
219
|
return {
|
|
226
220
|
value: BigInt(expectedGas.toString()),
|
|
227
221
|
parameters: {
|
|
222
|
+
storageLimit: BigInt(0),
|
|
228
223
|
gasLimit: BigInt(gasLimit.toString()),
|
|
229
224
|
gasPrice: BigInt(gasPrice.toString()),
|
|
230
225
|
},
|
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;
|