@fuel-ts/account 0.0.0-rc-1889-20240322122653 → 0.0.0-rc-1815-20240322131329

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.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

Files changed (212) hide show
  1. package/dist/account.d.ts +184 -0
  2. package/dist/account.d.ts.map +1 -0
  3. package/dist/configs.d.ts +2 -3
  4. package/dist/configs.d.ts.map +1 -0
  5. package/dist/connectors/fuel-connector.d.ts +198 -0
  6. package/dist/connectors/fuel-connector.d.ts.map +1 -0
  7. package/dist/connectors/fuel.d.ts +133 -0
  8. package/dist/connectors/fuel.d.ts.map +1 -0
  9. package/dist/connectors/index.d.ts +5 -0
  10. package/dist/connectors/index.d.ts.map +1 -0
  11. package/dist/connectors/types/connector-metadata.d.ts +12 -0
  12. package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
  13. package/dist/connectors/types/connector-types.d.ts +34 -0
  14. package/dist/connectors/types/connector-types.d.ts.map +1 -0
  15. package/dist/connectors/types/data-type.d.ts +34 -0
  16. package/dist/connectors/types/data-type.d.ts.map +1 -0
  17. package/dist/connectors/types/events.d.ts +111 -0
  18. package/dist/connectors/types/events.d.ts.map +1 -0
  19. package/dist/connectors/types/index.d.ts +7 -0
  20. package/dist/connectors/types/index.d.ts.map +1 -0
  21. package/dist/connectors/types/local-storage.d.ts +11 -0
  22. package/dist/connectors/types/local-storage.d.ts.map +1 -0
  23. package/dist/connectors/types/target-object.d.ts +14 -0
  24. package/dist/connectors/types/target-object.d.ts.map +1 -0
  25. package/dist/connectors/utils/cache.d.ts +14 -0
  26. package/dist/connectors/utils/cache.d.ts.map +1 -0
  27. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
  28. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
  29. package/dist/connectors/utils/index.d.ts +4 -0
  30. package/dist/connectors/utils/index.d.ts.map +1 -0
  31. package/dist/connectors/utils/promises.d.ts +8 -0
  32. package/dist/connectors/utils/promises.d.ts.map +1 -0
  33. package/dist/hdwallet/hdwallet.d.ts +58 -0
  34. package/dist/hdwallet/hdwallet.d.ts.map +1 -0
  35. package/dist/hdwallet/index.d.ts +2 -0
  36. package/dist/hdwallet/index.d.ts.map +1 -0
  37. package/dist/index.d.ts +13 -904
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.global.js +520 -391
  40. package/dist/index.global.js.map +1 -1
  41. package/dist/index.js +314 -208
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +316 -208
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/mnemonic/index.d.ts +3 -0
  46. package/dist/mnemonic/index.d.ts.map +1 -0
  47. package/dist/mnemonic/mnemonic.d.ts +85 -0
  48. package/dist/mnemonic/mnemonic.d.ts.map +1 -0
  49. package/dist/mnemonic/utils.d.ts +8 -0
  50. package/dist/mnemonic/utils.d.ts.map +1 -0
  51. package/dist/predicate/index.d.ts +3 -0
  52. package/dist/predicate/index.d.ts.map +1 -0
  53. package/dist/predicate/predicate.d.ts +94 -0
  54. package/dist/predicate/predicate.d.ts.map +1 -0
  55. package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
  56. package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
  57. package/dist/predicate/utils/index.d.ts +2 -0
  58. package/dist/predicate/utils/index.d.ts.map +1 -0
  59. package/dist/providers/__generated__/operations.d.ts +3477 -0
  60. package/dist/providers/__generated__/operations.d.ts.map +1 -0
  61. package/dist/providers/assets/index.d.ts +5 -0
  62. package/dist/providers/assets/index.d.ts.map +1 -0
  63. package/dist/providers/assets/types.d.ts +36 -0
  64. package/dist/providers/assets/types.d.ts.map +1 -0
  65. package/dist/providers/assets/utils/index.d.ts +4 -0
  66. package/dist/providers/assets/utils/index.d.ts.map +1 -0
  67. package/dist/providers/assets/utils/network.d.ts +33 -0
  68. package/dist/providers/assets/utils/network.d.ts.map +1 -0
  69. package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
  70. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
  71. package/dist/providers/assets/utils/url.d.ts +2 -0
  72. package/dist/providers/assets/utils/url.d.ts.map +1 -0
  73. package/dist/providers/chains.d.ts +11 -0
  74. package/dist/providers/chains.d.ts.map +1 -0
  75. package/dist/providers/coin-quantity.d.ts +21 -0
  76. package/dist/providers/coin-quantity.d.ts.map +1 -0
  77. package/dist/providers/coin.d.ts +15 -0
  78. package/dist/providers/coin.d.ts.map +1 -0
  79. package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
  80. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
  81. package/dist/providers/index.d.ts +13 -0
  82. package/dist/providers/index.d.ts.map +1 -0
  83. package/dist/providers/memory-cache.d.ts +11 -0
  84. package/dist/providers/memory-cache.d.ts.map +1 -0
  85. package/dist/providers/message.d.ts +60 -0
  86. package/dist/providers/message.d.ts.map +1 -0
  87. package/dist/providers/provider.d.ts +523 -0
  88. package/dist/providers/provider.d.ts.map +1 -0
  89. package/dist/providers/resource.d.ts +37 -0
  90. package/dist/providers/resource.d.ts.map +1 -0
  91. package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
  92. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
  93. package/dist/providers/transaction-request/errors.d.ts +25 -0
  94. package/dist/providers/transaction-request/errors.d.ts.map +1 -0
  95. package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
  96. package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
  97. package/dist/providers/transaction-request/index.d.ts +10 -0
  98. package/dist/providers/transaction-request/index.d.ts.map +1 -0
  99. package/dist/providers/transaction-request/input.d.ts +59 -0
  100. package/dist/providers/transaction-request/input.d.ts.map +1 -0
  101. package/dist/providers/transaction-request/output.d.ts +39 -0
  102. package/dist/providers/transaction-request/output.d.ts.map +1 -0
  103. package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
  104. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
  105. package/dist/providers/transaction-request/scripts.d.ts +6 -0
  106. package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
  107. package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
  108. package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
  109. package/dist/providers/transaction-request/transaction-request.d.ts +278 -0
  110. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
  111. package/dist/providers/transaction-request/types.d.ts +10 -0
  112. package/dist/providers/transaction-request/types.d.ts.map +1 -0
  113. package/dist/providers/transaction-request/utils.d.ts +4 -0
  114. package/dist/providers/transaction-request/utils.d.ts.map +1 -0
  115. package/dist/providers/transaction-request/witness.d.ts +5 -0
  116. package/dist/providers/transaction-request/witness.d.ts.map +1 -0
  117. package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
  118. package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
  119. package/dist/providers/transaction-response/index.d.ts +3 -0
  120. package/dist/providers/transaction-response/index.d.ts.map +1 -0
  121. package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
  122. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
  123. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
  124. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
  125. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
  126. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
  127. package/dist/providers/transaction-summary/call.d.ts +18 -0
  128. package/dist/providers/transaction-summary/call.d.ts.map +1 -0
  129. package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
  130. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
  131. package/dist/providers/transaction-summary/index.d.ts +10 -0
  132. package/dist/providers/transaction-summary/index.d.ts.map +1 -0
  133. package/dist/providers/transaction-summary/input.d.ts +21 -0
  134. package/dist/providers/transaction-summary/input.d.ts.map +1 -0
  135. package/dist/providers/transaction-summary/operations.d.ts +40 -0
  136. package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
  137. package/dist/providers/transaction-summary/output.d.ts +15 -0
  138. package/dist/providers/transaction-summary/output.d.ts.map +1 -0
  139. package/dist/providers/transaction-summary/receipt.d.ts +7 -0
  140. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
  141. package/dist/providers/transaction-summary/status.d.ts +9 -0
  142. package/dist/providers/transaction-summary/status.d.ts.map +1 -0
  143. package/dist/providers/transaction-summary/types.d.ts +146 -0
  144. package/dist/providers/transaction-summary/types.d.ts.map +1 -0
  145. package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
  146. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
  147. package/dist/providers/utils/block-explorer.d.ts +14 -0
  148. package/dist/providers/utils/block-explorer.d.ts.map +1 -0
  149. package/dist/providers/utils/gas.d.ts +38 -0
  150. package/dist/providers/utils/gas.d.ts.map +1 -0
  151. package/dist/providers/utils/index.d.ts +6 -0
  152. package/dist/providers/utils/index.d.ts.map +1 -0
  153. package/dist/providers/utils/json.d.ts +7 -0
  154. package/dist/providers/utils/json.d.ts.map +1 -0
  155. package/dist/providers/utils/merge-quantities.d.ts +3 -0
  156. package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
  157. package/dist/providers/utils/receipts.d.ts +10 -0
  158. package/dist/providers/utils/receipts.d.ts.map +1 -0
  159. package/dist/providers/utils/sleep.d.ts +3 -0
  160. package/dist/providers/utils/sleep.d.ts.map +1 -0
  161. package/dist/signer/index.d.ts +2 -0
  162. package/dist/signer/index.d.ts.map +1 -0
  163. package/dist/signer/signer.d.ts +64 -0
  164. package/dist/signer/signer.d.ts.map +1 -0
  165. package/dist/test-utils/generateTestWallet.d.ts +4 -0
  166. package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
  167. package/dist/test-utils/index.d.ts +4 -0
  168. package/dist/test-utils/index.d.ts.map +1 -0
  169. package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +12 -24
  170. package/dist/test-utils/launchNode.d.ts.map +1 -0
  171. package/dist/test-utils/seedTestWallet.d.ts +4 -0
  172. package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
  173. package/dist/test-utils.global.js +386 -295
  174. package/dist/test-utils.global.js.map +1 -1
  175. package/dist/test-utils.js +179 -108
  176. package/dist/test-utils.js.map +1 -1
  177. package/dist/test-utils.mjs +181 -108
  178. package/dist/test-utils.mjs.map +1 -1
  179. package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
  180. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
  181. package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
  182. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
  183. package/dist/wallet/index.d.ts +4 -0
  184. package/dist/wallet/index.d.ts.map +1 -0
  185. package/dist/wallet/keystore-wallet.d.ts +38 -0
  186. package/dist/wallet/keystore-wallet.d.ts.map +1 -0
  187. package/dist/wallet/wallet.d.ts +68 -0
  188. package/dist/wallet/wallet.d.ts.map +1 -0
  189. package/dist/wallet/wallets.d.ts +76 -0
  190. package/dist/wallet/wallets.d.ts.map +1 -0
  191. package/dist/wallet-manager/index.d.ts +6 -0
  192. package/dist/wallet-manager/index.d.ts.map +1 -0
  193. package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
  194. package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
  195. package/dist/wallet-manager/types.d.ts +42 -0
  196. package/dist/wallet-manager/types.d.ts.map +1 -0
  197. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
  198. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
  199. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
  200. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
  201. package/dist/wallet-manager/wallet-manager.d.ts +104 -0
  202. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
  203. package/dist/wordlists/index.d.ts +5 -0
  204. package/dist/wordlists/index.d.ts.map +1 -0
  205. package/dist/wordlists/words/english.d.ts +2 -0
  206. package/dist/wordlists/words/english.d.ts.map +1 -0
  207. package/package.json +25 -21
  208. package/dist/account-E9nGNf5X.d.mts +0 -3837
  209. package/dist/account-E9nGNf5X.d.ts +0 -3837
  210. package/dist/configs.d.mts +0 -3
  211. package/dist/index.d.mts +0 -904
  212. package/dist/test-utils.d.mts +0 -66
@@ -0,0 +1,3 @@
1
+ export { default as Mnemonic, MNEMONIC_SIZES } from './mnemonic';
2
+ export type { MnemonicPhrase } from './utils';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mnemonic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,85 @@
1
+ import type { BytesLike } from '@fuel-ts/interfaces';
2
+ import type { MnemonicPhrase } from './utils';
3
+ export declare const MNEMONIC_SIZES: number[];
4
+ declare class Mnemonic {
5
+ wordlist: Array<string>;
6
+ /**
7
+ *
8
+ * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.
9
+ * @returns Mnemonic instance
10
+ */
11
+ constructor(wordlist?: Array<string>);
12
+ /**
13
+ *
14
+ * @param phrase - Mnemonic phrase composed by words from the provided wordlist
15
+ * @returns Entropy hash
16
+ */
17
+ mnemonicToEntropy(phrase: MnemonicPhrase): string;
18
+ /**
19
+ *
20
+ * @param entropy - Entropy source to the mnemonic phrase.
21
+ * @returns Mnemonic phrase
22
+ */
23
+ entropyToMnemonic(entropy: BytesLike): string;
24
+ /**
25
+ *
26
+ * @param phrase - Mnemonic phrase composed by words from the provided wordlist
27
+ * @param wordlist - Provide a wordlist with the list of words used to generate the mnemonic phrase. The default value is the English list.
28
+ * @returns Mnemonic phrase
29
+ */
30
+ static mnemonicToEntropy(phrase: MnemonicPhrase, wordlist?: Array<string>): string;
31
+ /**
32
+ * @param entropy - Entropy source to the mnemonic phrase.
33
+ * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).
34
+ * @returns 64-byte array contains privateKey and chainCode as described on BIP39
35
+ */
36
+ static entropyToMnemonic(entropy: BytesLike, wordlist?: Array<string>): string;
37
+ /**
38
+ * @param phrase - Mnemonic phrase composed by words from the provided wordlist
39
+ * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`
40
+ * @returns 64-byte array contains privateKey and chainCode as described on BIP39
41
+ */
42
+ static mnemonicToSeed(phrase: MnemonicPhrase, passphrase?: BytesLike): string;
43
+ /**
44
+ * @param phrase - Mnemonic phrase composed by words from the provided wordlist
45
+ * @param passphrase - Add additional security to protect the generated seed with a memorized passphrase. `Note: if the owner forgot the passphrase, all wallets and accounts derive from the phrase will be lost.`
46
+ * @returns 64-byte array contains privateKey and chainCode as described on BIP39
47
+ */
48
+ static mnemonicToMasterKeys(phrase: MnemonicPhrase, passphrase?: BytesLike): Uint8Array;
49
+ /**
50
+ * Validates if given mnemonic is valid
51
+ * @param phrase - Mnemonic phrase composed by words from the provided wordlist
52
+ * @returns true if phrase is a valid mnemonic
53
+ */
54
+ static isMnemonicValid(phrase: string): boolean;
55
+ static binarySearch(target: string): boolean;
56
+ /**
57
+ * @param seed - BIP39 seed
58
+ * @param testnet - Inform if should use testnet or mainnet prefix, the default value is true (`mainnet`).
59
+ * @returns 64-byte array contains privateKey and chainCode as described on BIP39
60
+ */
61
+ static masterKeysFromSeed(seed: string): Uint8Array;
62
+ /**
63
+ * Get the extendKey as defined on BIP-32 from the provided seed
64
+ *
65
+ * @param seed - BIP39 seed
66
+ * @param testnet - Inform if should use testnet or mainnet prefix, default value is true (`mainnet`).
67
+ * @returns BIP-32 extended private key
68
+ */
69
+ static seedToExtendedKey(seed: string, testnet?: boolean): string;
70
+ /**
71
+ * Create a new mnemonic using a randomly generated number as entropy.
72
+ * As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits.
73
+ * Therefore, the possible values for `strength` are 128, 160, 192, 224, and 256.
74
+ * If not provided, the default entropy length will be set to 256 bits.
75
+ * The return is a list of words that encodes the generated entropy.
76
+ *
77
+ *
78
+ * @param size - Number of bytes used as an entropy
79
+ * @param extraEntropy - Optional extra entropy to increase randomness
80
+ * @returns A randomly generated mnemonic
81
+ */
82
+ static generate(size?: number, extraEntropy?: BytesLike): string;
83
+ }
84
+ export default Mnemonic;
85
+ //# sourceMappingURL=mnemonic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src/mnemonic/mnemonic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiB9C,eAAO,MAAM,cAAc,UAAuB,CAAC;AA8BnD,cAAM,QAAQ;IACZ,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAExB;;;;OAIG;gBACS,QAAQ,GAAE,KAAK,CAAC,MAAM,CAAW;IAM7C;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAIxC;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,SAAS;IAIpC;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,GAAE,KAAK,CAAC,MAAM,CAAW,GAAG,MAAM;IAQ3F;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,GAAE,KAAK,CAAC,MAAM,CAAW,GAAG,MAAM;IAWvF;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,GAAE,SAAc;IASxE;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,GAAE,SAAc;IAK9E;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM;IAqBrC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAqB5C;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAanD;;;;;;OAMG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,MAAM;IAuBxE;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAE,MAAW,EAAE,YAAY,GAAE,SAAc;CAMhE;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BytesLike } from '@fuel-ts/interfaces';
2
+ export type MnemonicPhrase = string | Array<string>;
3
+ export declare function toUtf8Bytes(stri: string): Uint8Array;
4
+ export declare function getWords(mnemonic: MnemonicPhrase): Array<string>;
5
+ export declare function getPhrase(mnemonic: MnemonicPhrase): string;
6
+ export declare function entropyToMnemonicIndices(entropy: Uint8Array): Array<number>;
7
+ export declare function mnemonicWordsToEntropy(words: Array<string>, wordlist: Array<string>): BytesLike;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/mnemonic/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAEpD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAqCpD;AAYD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,CAKhE;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAK1D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CA+B3E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAkC/F"}
@@ -0,0 +1,3 @@
1
+ export * from './predicate';
2
+ export * from './utils/getPredicateRoot';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/predicate/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,94 @@
1
+ import type { JsonAbi, InputValue } from '@fuel-ts/abi-coder';
2
+ import { Interface } from '@fuel-ts/abi-coder';
3
+ import type { AbstractAddress, BytesLike } from '@fuel-ts/interfaces';
4
+ import type { BigNumberish } from '@fuel-ts/math';
5
+ import { Account } from '../account';
6
+ import type { TxParamsType } from '../account';
7
+ import type { CallResult, Provider, ProviderSendTxParams, TransactionRequest, TransactionRequestLike, TransactionResponse } from '../providers';
8
+ export type PredicateParams<T = InputValue[]> = {
9
+ bytecode: BytesLike;
10
+ provider: Provider;
11
+ abi?: JsonAbi;
12
+ inputData?: T;
13
+ configurableConstants?: {
14
+ [name: string]: unknown;
15
+ };
16
+ };
17
+ /**
18
+ * `Predicate` provides methods to populate transaction data with predicate information and sending transactions with them.
19
+ */
20
+ export declare class Predicate<TInputData extends InputValue[]> extends Account {
21
+ bytes: Uint8Array;
22
+ predicateDataBytes: Uint8Array;
23
+ predicateData: TInputData;
24
+ interface?: Interface;
25
+ /**
26
+ * Creates an instance of the Predicate class.
27
+ *
28
+ * @param bytecode - The bytecode of the predicate.
29
+ * @param abi - The JSON ABI of the predicate.
30
+ * @param provider - The provider used to interact with the blockchain.
31
+ * @param inputData - The predicate input data (optional).
32
+ * @param configurableConstants - Optional configurable constants for the predicate.
33
+ */
34
+ constructor({ bytecode, abi, provider, inputData, configurableConstants, }: PredicateParams<TInputData>);
35
+ /**
36
+ * Populates the transaction data with predicate data.
37
+ *
38
+ * @param transactionRequestLike - The transaction request-like object.
39
+ * @returns The transaction request with predicate data.
40
+ */
41
+ populateTransactionPredicateData(transactionRequestLike: TransactionRequestLike): TransactionRequest;
42
+ /**
43
+ * A helper that creates a transfer transaction request and returns it.
44
+ *
45
+ * @param destination - The address of the destination.
46
+ * @param amount - The amount of coins to transfer.
47
+ * @param assetId - The asset ID of the coins to transfer.
48
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
49
+ * @returns A promise that resolves to the prepared transaction request.
50
+ */
51
+ createTransfer(
52
+ /** Address of the destination */
53
+ destination: AbstractAddress,
54
+ /** Amount of coins */
55
+ amount: BigNumberish,
56
+ /** Asset ID of coins */
57
+ assetId?: BytesLike,
58
+ /** Tx Params */
59
+ txParams?: TxParamsType): Promise<TransactionRequest>;
60
+ /**
61
+ * Sends a transaction with the populated predicate data.
62
+ *
63
+ * @param transactionRequestLike - The transaction request-like object.
64
+ * @returns A promise that resolves to the transaction response.
65
+ */
66
+ sendTransaction(transactionRequestLike: TransactionRequestLike, options?: Pick<ProviderSendTxParams, 'awaitExecution'>): Promise<TransactionResponse>;
67
+ /**
68
+ * Simulates a transaction with the populated predicate data.
69
+ *
70
+ * @param transactionRequestLike - The transaction request-like object.
71
+ * @returns A promise that resolves to the call result.
72
+ */
73
+ simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise<CallResult>;
74
+ private getPredicateData;
75
+ /**
76
+ * Processes the predicate data and returns the altered bytecode and interface.
77
+ *
78
+ * @param bytes - The bytes of the predicate.
79
+ * @param jsonAbi - The JSON ABI of the predicate.
80
+ * @param configurableConstants - Optional configurable constants for the predicate.
81
+ * @returns An object containing the new predicate bytes and interface.
82
+ */
83
+ private static processPredicateData;
84
+ /**
85
+ * Sets the configurable constants for the predicate.
86
+ *
87
+ * @param bytes - The bytes of the predicate.
88
+ * @param configurableConstants - Configurable constants to be set.
89
+ * @param abiInterface - The ABI interface of the predicate.
90
+ * @returns The mutated bytes with the configurable constants set.
91
+ */
92
+ private static setConfigurableConstants;
93
+ }
94
+ //# sourceMappingURL=predicate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../src/predicate/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,UAAU,EAAE,IAAI;IAC9C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,CAAC,CAAC;IACd,qBAAqB,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAS,CAAC,UAAU,SAAS,UAAU,EAAE,CAAE,SAAQ,OAAO;IACrE,KAAK,EAAE,UAAU,CAAC;IAClB,kBAAkB,EAAE,UAAU,CAAuB;IACrD,aAAa,EAAE,UAAU,CAA+B;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;;;;OAQG;gBACS,EACV,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,SAAS,EACT,qBAAqB,GACtB,EAAE,eAAe,CAAC,UAAU,CAAC;IAgB9B;;;;;OAKG;IACH,gCAAgC,CAAC,sBAAsB,EAAE,sBAAsB;IAiB/E;;;;;;;;OAQG;IACG,cAAc;IAClB,iCAAiC;IACjC,WAAW,EAAE,eAAe;IAC5B,sBAAsB;IACtB,MAAM,EAAE,YAAY;IACpB,wBAAwB;IACxB,OAAO,GAAE,SAAuB;IAChC,gBAAgB;IAChB,QAAQ,GAAE,YAAiB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAK9B;;;;;OAKG;IACH,eAAe,CACb,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,GACrD,OAAO,CAAC,mBAAmB,CAAC;IAK/B;;;;;OAKG;IACH,mBAAmB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAKxF,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgCnC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAsCxC"}
@@ -0,0 +1,12 @@
1
+ import type { BytesLike } from '@fuel-ts/interfaces';
2
+ /**
3
+ * @hidden
4
+ *
5
+ * Calculates the predicate root for a given bytecode and chain ID.
6
+ *
7
+ * @param bytecode - The bytecode represented as a BytesLike object.
8
+ * @param chainId - The ID of the chain associated with the bytecode.
9
+ * @returns The predicate root as a string.
10
+ */
11
+ export declare const getPredicateRoot: (bytecode: BytesLike) => string;
12
+ //# sourceMappingURL=getPredicateRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPredicateRoot.d.ts","sourceRoot":"","sources":["../../../src/predicate/utils/getPredicateRoot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,aAAc,SAAS,KAAG,MAQtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './getPredicateRoot';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/predicate/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}