@fuel-ts/account 0.101.1 → 0.101.3

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.
Files changed (41) hide show
  1. package/dist/account.d.ts +45 -14
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/connectors/fuel-connector.d.ts +8 -0
  4. package/dist/connectors/fuel-connector.d.ts.map +1 -1
  5. package/dist/connectors/types/connector-types.d.ts +4 -2
  6. package/dist/connectors/types/connector-types.d.ts.map +1 -1
  7. package/dist/connectors/types/events.d.ts +6 -1
  8. package/dist/connectors/types/events.d.ts.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.global.js +723 -164
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +936 -471
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +856 -394
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/providers/provider.d.ts.map +1 -1
  18. package/dist/providers/transaction-request/script-transaction-request.d.ts +2 -1
  19. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
  20. package/dist/providers/transaction-response/transaction-response.d.ts +23 -4
  21. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  22. package/dist/providers/transaction-summary/call.d.ts +4 -7
  23. package/dist/providers/transaction-summary/call.d.ts.map +1 -1
  24. package/dist/providers/transaction-summary/operations.d.ts +1 -1
  25. package/dist/providers/transaction-summary/operations.d.ts.map +1 -1
  26. package/dist/providers/utils/extract-tx-error.d.ts +10 -1
  27. package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
  28. package/dist/providers/utils/handle-gql-error-message.d.ts.map +1 -1
  29. package/dist/providers/utils/transaction-response-serialization.d.ts.map +1 -1
  30. package/dist/test-utils/launchNode.d.ts.map +1 -1
  31. package/dist/test-utils.global.js +650 -164
  32. package/dist/test-utils.global.js.map +1 -1
  33. package/dist/test-utils.js +823 -381
  34. package/dist/test-utils.js.map +1 -1
  35. package/dist/test-utils.mjs +751 -308
  36. package/dist/test-utils.mjs.map +1 -1
  37. package/dist/types.d.ts +1 -1
  38. package/dist/types.d.ts.map +1 -1
  39. package/dist/utils/consolidate-coins.d.ts +43 -0
  40. package/dist/utils/consolidate-coins.d.ts.map +1 -0
  41. package/package.json +15 -15
package/dist/types.d.ts CHANGED
@@ -6,6 +6,6 @@ export declare abstract class AbstractAccount {
6
6
  abstract sendTransaction(transactionRequest: any, options?: any): any;
7
7
  abstract simulateTransaction(transactionRequest: any, options?: any): any;
8
8
  abstract getTransactionCost(transactionRequest: any, options?: any): Promise<any>;
9
- abstract fund(transactionRequest: any, txCost: any): Promise<any>;
9
+ abstract fund(transactionRequest: any, txCost: any, options?: any): Promise<any>;
10
10
  }
11
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,8BAAsB,eAAe;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACnE,QAAQ,CAAC,eAAe,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACrE,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACzE,QAAQ,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACjF,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAClE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,8BAAsB,eAAe;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACnE,QAAQ,CAAC,eAAe,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACrE,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;IACzE,QAAQ,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACjF,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CACjF"}
@@ -0,0 +1,43 @@
1
+ import { type SubmitAllCallback, type Account } from '../account';
2
+ import { ScriptTransactionRequest } from '../providers';
3
+ import type { Coin } from '../providers';
4
+ export interface ShouldConsolidateCoinsParams {
5
+ skipAutoConsolidation?: boolean;
6
+ }
7
+ /**
8
+ * @hidden
9
+ *
10
+ * Detects if a consolidation is required for a given error.
11
+ *
12
+ * @param error - The error to detect if a consolidation is required for.
13
+ * @param account - The account to consolidate coins for.
14
+ * @param skipAutoConsolidation - Whether to skip the automatic consolidatation of coins process (optional).
15
+ *
16
+ * @returns true if a consolidation is required, false otherwise
17
+ */
18
+ export declare const consolidateCoinsIfRequired: (opts: {
19
+ error: unknown;
20
+ account: Account;
21
+ skipAutoConsolidation?: boolean;
22
+ }) => Promise<boolean>;
23
+ /**
24
+ * @hidden
25
+ *
26
+ * Gets all coins for a given asset id.
27
+ *
28
+ * @param account - The account to get coins for.
29
+ * @param assetId - The asset id to get coins for.
30
+ * @returns The coins.
31
+ */
32
+ export declare const getAllCoins: (account: Account, assetId?: string) => Promise<{
33
+ coins: Coin[];
34
+ }>;
35
+ export declare const consolidateCoins: ({ account, assetId, }: {
36
+ account: Account;
37
+ assetId: string;
38
+ }) => Promise<{
39
+ txs: ScriptTransactionRequest[];
40
+ totalFeeCost: import("@fuel-ts/math").BN;
41
+ submitAll: SubmitAllCallback;
42
+ }>;
43
+ //# sourceMappingURL=consolidate-coins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consolidate-coins.d.ts","sourceRoot":"","sources":["../../src/utils/consolidate-coins.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAmB,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAA0C,MAAM,cAAc,CAAC;AAEjF,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,SAAgB;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,KAAG,OAAO,CAAC,OAAO,CAmBlB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,YAAmB,OAAO,YAAY,MAAM;;EAanE,CAAC;AAmCF,eAAO,MAAM,gBAAgB,0BAG1B;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;;;;EAyHA,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fuel-ts/account",
3
- "version": "0.101.1",
3
+ "version": "0.101.3",
4
4
  "description": "",
5
5
  "author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
8
8
  "types": "dist/index.d.ts",
9
9
  "engines": {
10
- "node": "^18.20.3 || ^20.0.0 || ^22.0.0"
10
+ "node": "^20.0.0 || ^22.0.0 || ^24.0.0"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -48,16 +48,16 @@
48
48
  "graphql-request": "6.1.0",
49
49
  "graphql-tag": "2.12.6",
50
50
  "ramda": "0.30.1",
51
- "@fuel-ts/abi-coder": "0.101.1",
52
- "@fuel-ts/address": "0.101.1",
53
- "@fuel-ts/crypto": "0.101.1",
54
- "@fuel-ts/errors": "0.101.1",
55
- "@fuel-ts/hasher": "0.101.1",
56
- "@fuel-ts/math": "0.101.1",
57
- "@fuel-ts/merkle": "0.101.1",
58
- "@fuel-ts/transactions": "0.101.1",
59
- "@fuel-ts/utils": "0.101.1",
60
- "@fuel-ts/versions": "0.101.1"
51
+ "@fuel-ts/abi-coder": "0.101.3",
52
+ "@fuel-ts/address": "0.101.3",
53
+ "@fuel-ts/crypto": "0.101.3",
54
+ "@fuel-ts/errors": "0.101.3",
55
+ "@fuel-ts/hasher": "0.101.3",
56
+ "@fuel-ts/math": "0.101.3",
57
+ "@fuel-ts/merkle": "0.101.3",
58
+ "@fuel-ts/transactions": "0.101.3",
59
+ "@fuel-ts/utils": "0.101.3",
60
+ "@fuel-ts/versions": "0.101.3"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@graphql-codegen/cli": "5.0.5",
@@ -67,9 +67,9 @@
67
67
  "@types/ramda": "0.30.2",
68
68
  "get-graphql-schema": "2.1.2",
69
69
  "type-fest": "4.34.1",
70
- "@fuel-ts/hasher": "0.101.1",
71
- "@fuel-ts/math": "0.101.1",
72
- "@fuel-ts/utils": "0.101.1"
70
+ "@fuel-ts/hasher": "0.101.3",
71
+ "@fuel-ts/math": "0.101.3",
72
+ "@fuel-ts/utils": "0.101.3"
73
73
  },
74
74
  "scripts": {
75
75
  "build": "tsup",