@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.
- package/dist/account.d.ts +184 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/configs.d.ts +2 -3
- package/dist/configs.d.ts.map +1 -0
- package/dist/connectors/fuel-connector.d.ts +198 -0
- package/dist/connectors/fuel-connector.d.ts.map +1 -0
- package/dist/connectors/fuel.d.ts +133 -0
- package/dist/connectors/fuel.d.ts.map +1 -0
- package/dist/connectors/index.d.ts +5 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/types/connector-metadata.d.ts +12 -0
- package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
- package/dist/connectors/types/connector-types.d.ts +34 -0
- package/dist/connectors/types/connector-types.d.ts.map +1 -0
- package/dist/connectors/types/data-type.d.ts +34 -0
- package/dist/connectors/types/data-type.d.ts.map +1 -0
- package/dist/connectors/types/events.d.ts +111 -0
- package/dist/connectors/types/events.d.ts.map +1 -0
- package/dist/connectors/types/index.d.ts +7 -0
- package/dist/connectors/types/index.d.ts.map +1 -0
- package/dist/connectors/types/local-storage.d.ts +11 -0
- package/dist/connectors/types/local-storage.d.ts.map +1 -0
- package/dist/connectors/types/target-object.d.ts +14 -0
- package/dist/connectors/types/target-object.d.ts.map +1 -0
- package/dist/connectors/utils/cache.d.ts +14 -0
- package/dist/connectors/utils/cache.d.ts.map +1 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
- package/dist/connectors/utils/index.d.ts +4 -0
- package/dist/connectors/utils/index.d.ts.map +1 -0
- package/dist/connectors/utils/promises.d.ts +8 -0
- package/dist/connectors/utils/promises.d.ts.map +1 -0
- package/dist/hdwallet/hdwallet.d.ts +58 -0
- package/dist/hdwallet/hdwallet.d.ts.map +1 -0
- package/dist/hdwallet/index.d.ts +2 -0
- package/dist/hdwallet/index.d.ts.map +1 -0
- package/dist/index.d.ts +13 -904
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +520 -391
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +314 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +316 -208
- package/dist/index.mjs.map +1 -1
- package/dist/mnemonic/index.d.ts +3 -0
- package/dist/mnemonic/index.d.ts.map +1 -0
- package/dist/mnemonic/mnemonic.d.ts +85 -0
- package/dist/mnemonic/mnemonic.d.ts.map +1 -0
- package/dist/mnemonic/utils.d.ts +8 -0
- package/dist/mnemonic/utils.d.ts.map +1 -0
- package/dist/predicate/index.d.ts +3 -0
- package/dist/predicate/index.d.ts.map +1 -0
- package/dist/predicate/predicate.d.ts +94 -0
- package/dist/predicate/predicate.d.ts.map +1 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
- package/dist/predicate/utils/index.d.ts +2 -0
- package/dist/predicate/utils/index.d.ts.map +1 -0
- package/dist/providers/__generated__/operations.d.ts +3477 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -0
- package/dist/providers/assets/index.d.ts +5 -0
- package/dist/providers/assets/index.d.ts.map +1 -0
- package/dist/providers/assets/types.d.ts +36 -0
- package/dist/providers/assets/types.d.ts.map +1 -0
- package/dist/providers/assets/utils/index.d.ts +4 -0
- package/dist/providers/assets/utils/index.d.ts.map +1 -0
- package/dist/providers/assets/utils/network.d.ts +33 -0
- package/dist/providers/assets/utils/network.d.ts.map +1 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
- package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
- package/dist/providers/assets/utils/url.d.ts +2 -0
- package/dist/providers/assets/utils/url.d.ts.map +1 -0
- package/dist/providers/chains.d.ts +11 -0
- package/dist/providers/chains.d.ts.map +1 -0
- package/dist/providers/coin-quantity.d.ts +21 -0
- package/dist/providers/coin-quantity.d.ts.map +1 -0
- package/dist/providers/coin.d.ts +15 -0
- package/dist/providers/coin.d.ts.map +1 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
- package/dist/providers/index.d.ts +13 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/memory-cache.d.ts +11 -0
- package/dist/providers/memory-cache.d.ts.map +1 -0
- package/dist/providers/message.d.ts +60 -0
- package/dist/providers/message.d.ts.map +1 -0
- package/dist/providers/provider.d.ts +523 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/resource.d.ts +37 -0
- package/dist/providers/resource.d.ts.map +1 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/errors.d.ts +25 -0
- package/dist/providers/transaction-request/errors.d.ts.map +1 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +10 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -0
- package/dist/providers/transaction-request/input.d.ts +59 -0
- package/dist/providers/transaction-request/input.d.ts.map +1 -0
- package/dist/providers/transaction-request/output.d.ts +39 -0
- package/dist/providers/transaction-request/output.d.ts.map +1 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/scripts.d.ts +6 -0
- package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
- package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
- package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
- package/dist/providers/transaction-request/transaction-request.d.ts +278 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/types.d.ts +10 -0
- package/dist/providers/transaction-request/types.d.ts.map +1 -0
- package/dist/providers/transaction-request/utils.d.ts +4 -0
- package/dist/providers/transaction-request/utils.d.ts.map +1 -0
- package/dist/providers/transaction-request/witness.d.ts +5 -0
- package/dist/providers/transaction-request/witness.d.ts.map +1 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
- package/dist/providers/transaction-response/index.d.ts +3 -0
- package/dist/providers/transaction-response/index.d.ts.map +1 -0
- package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
- package/dist/providers/transaction-summary/call.d.ts +18 -0
- package/dist/providers/transaction-summary/call.d.ts.map +1 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/index.d.ts +10 -0
- package/dist/providers/transaction-summary/index.d.ts.map +1 -0
- package/dist/providers/transaction-summary/input.d.ts +21 -0
- package/dist/providers/transaction-summary/input.d.ts.map +1 -0
- package/dist/providers/transaction-summary/operations.d.ts +40 -0
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
- package/dist/providers/transaction-summary/output.d.ts +15 -0
- package/dist/providers/transaction-summary/output.d.ts.map +1 -0
- package/dist/providers/transaction-summary/receipt.d.ts +7 -0
- package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
- package/dist/providers/transaction-summary/status.d.ts +9 -0
- package/dist/providers/transaction-summary/status.d.ts.map +1 -0
- package/dist/providers/transaction-summary/types.d.ts +146 -0
- package/dist/providers/transaction-summary/types.d.ts.map +1 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
- package/dist/providers/utils/block-explorer.d.ts +14 -0
- package/dist/providers/utils/block-explorer.d.ts.map +1 -0
- package/dist/providers/utils/gas.d.ts +38 -0
- package/dist/providers/utils/gas.d.ts.map +1 -0
- package/dist/providers/utils/index.d.ts +6 -0
- package/dist/providers/utils/index.d.ts.map +1 -0
- package/dist/providers/utils/json.d.ts +7 -0
- package/dist/providers/utils/json.d.ts.map +1 -0
- package/dist/providers/utils/merge-quantities.d.ts +3 -0
- package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
- package/dist/providers/utils/receipts.d.ts +10 -0
- package/dist/providers/utils/receipts.d.ts.map +1 -0
- package/dist/providers/utils/sleep.d.ts +3 -0
- package/dist/providers/utils/sleep.d.ts.map +1 -0
- package/dist/signer/index.d.ts +2 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/signer.d.ts +64 -0
- package/dist/signer/signer.d.ts.map +1 -0
- package/dist/test-utils/generateTestWallet.d.ts +4 -0
- package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +12 -24
- package/dist/test-utils/launchNode.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +4 -0
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
- package/dist/test-utils.global.js +386 -295
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +179 -108
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +181 -108
- package/dist/test-utils.mjs.map +1 -1
- package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
- package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
- package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +4 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/keystore-wallet.d.ts +38 -0
- package/dist/wallet/keystore-wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.d.ts +68 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallets.d.ts +76 -0
- package/dist/wallet/wallets.d.ts.map +1 -0
- package/dist/wallet-manager/index.d.ts +6 -0
- package/dist/wallet-manager/index.d.ts.map +1 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
- package/dist/wallet-manager/types.d.ts +42 -0
- package/dist/wallet-manager/types.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
- package/dist/wallet-manager/wallet-manager.d.ts +104 -0
- package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
- package/dist/wordlists/index.d.ts +5 -0
- package/dist/wordlists/index.d.ts.map +1 -0
- package/dist/wordlists/words/english.d.ts +2 -0
- package/dist/wordlists/words/english.d.ts.map +1 -0
- package/package.json +25 -21
- package/dist/account-E9nGNf5X.d.mts +0 -3837
- package/dist/account-E9nGNf5X.d.ts +0 -3837
- package/dist/configs.d.mts +0 -3
- package/dist/index.d.mts +0 -904
- package/dist/test-utils.d.mts +0 -66
@@ -0,0 +1,106 @@
|
|
1
|
+
import type { BN } from '@fuel-ts/math';
|
2
|
+
import type { ReceiptCall, ReceiptLog, ReceiptLogData, ReceiptPanic, ReceiptReturn, ReceiptReturnData, ReceiptRevert, ReceiptTransfer, ReceiptTransferOut, ReceiptScriptResult, ReceiptMessageOut, Transaction, ReceiptMint, ReceiptBurn } from '@fuel-ts/transactions';
|
3
|
+
import type Provider from '../provider';
|
4
|
+
import type { TransactionSummary, GqlTransaction, AbiMap } from '../transaction-summary/types';
|
5
|
+
/** @hidden */
|
6
|
+
export type TransactionResultCallReceipt = ReceiptCall;
|
7
|
+
/** @hidden */
|
8
|
+
export type TransactionResultReturnReceipt = ReceiptReturn;
|
9
|
+
/** @hidden */
|
10
|
+
export type TransactionResultReturnDataReceipt = ReceiptReturnData & {
|
11
|
+
data: string;
|
12
|
+
};
|
13
|
+
/** @hidden */
|
14
|
+
export type TransactionResultPanicReceipt = ReceiptPanic;
|
15
|
+
/** @hidden */
|
16
|
+
export type TransactionResultRevertReceipt = ReceiptRevert;
|
17
|
+
/** @hidden */
|
18
|
+
export type TransactionResultLogReceipt = ReceiptLog;
|
19
|
+
/** @hidden */
|
20
|
+
export type TransactionResultLogDataReceipt = ReceiptLogData & {
|
21
|
+
data: string;
|
22
|
+
};
|
23
|
+
/** @hidden */
|
24
|
+
export type TransactionResultTransferReceipt = ReceiptTransfer;
|
25
|
+
/** @hidden */
|
26
|
+
export type TransactionResultTransferOutReceipt = ReceiptTransferOut;
|
27
|
+
/** @hidden */
|
28
|
+
export type TransactionResultScriptResultReceipt = ReceiptScriptResult;
|
29
|
+
/** @hidden */
|
30
|
+
export type TransactionResultMessageOutReceipt = ReceiptMessageOut;
|
31
|
+
export type TransactionResultMintReceipt = ReceiptMint;
|
32
|
+
export type TransactionResultBurnReceipt = ReceiptBurn;
|
33
|
+
/** @hidden */
|
34
|
+
export type TransactionResultReceipt = ReceiptCall | ReceiptReturn | (ReceiptReturnData & {
|
35
|
+
data: string;
|
36
|
+
}) | ReceiptPanic | ReceiptRevert | ReceiptLog | (ReceiptLogData & {
|
37
|
+
data: string;
|
38
|
+
}) | ReceiptTransfer | ReceiptTransferOut | ReceiptScriptResult | ReceiptMessageOut | TransactionResultMintReceipt | TransactionResultBurnReceipt;
|
39
|
+
/** @hidden */
|
40
|
+
export type TransactionResult<TTransactionType = void> = TransactionSummary<TTransactionType> & {
|
41
|
+
gqlTransaction: GqlTransaction;
|
42
|
+
};
|
43
|
+
/**
|
44
|
+
* Represents a response for a transaction.
|
45
|
+
*/
|
46
|
+
export declare class TransactionResponse {
|
47
|
+
/** Transaction ID */
|
48
|
+
id: string;
|
49
|
+
/** Current provider */
|
50
|
+
provider: Provider;
|
51
|
+
/** Gas used on the transaction */
|
52
|
+
gasUsed: BN;
|
53
|
+
/** The graphql Transaction with receipts object. */
|
54
|
+
gqlTransaction?: GqlTransaction;
|
55
|
+
/**
|
56
|
+
* Constructor for `TransactionResponse`.
|
57
|
+
*
|
58
|
+
* @param id - The transaction ID.
|
59
|
+
* @param provider - The provider.
|
60
|
+
*/
|
61
|
+
constructor(id: string, provider: Provider);
|
62
|
+
/**
|
63
|
+
* Async constructor for `TransactionResponse`. This method can be used to create
|
64
|
+
* an instance of `TransactionResponse` and wait for the transaction to be fetched
|
65
|
+
* from the chain, ensuring that the `gqlTransaction` property is set.
|
66
|
+
*
|
67
|
+
* @param id - The transaction ID.
|
68
|
+
* @param provider - The provider.
|
69
|
+
*/
|
70
|
+
static create(id: string, provider: Provider): Promise<TransactionResponse>;
|
71
|
+
/**
|
72
|
+
* Fetch the transaction with receipts from the provider.
|
73
|
+
*
|
74
|
+
* @returns Transaction with receipts query result.
|
75
|
+
*/
|
76
|
+
fetch(): Promise<GqlTransaction>;
|
77
|
+
/**
|
78
|
+
* Decode the raw payload of the transaction.
|
79
|
+
*
|
80
|
+
* @param transactionWithReceipts - The transaction with receipts object.
|
81
|
+
* @returns The decoded transaction.
|
82
|
+
*/
|
83
|
+
decodeTransaction<TTransactionType = void>(transactionWithReceipts: GqlTransaction): Transaction<TTransactionType>;
|
84
|
+
/**
|
85
|
+
* Retrieves the TransactionSummary. If the `gqlTransaction` is not set, it will
|
86
|
+
* fetch it from the provider
|
87
|
+
*
|
88
|
+
* @param contractsAbiMap - The contracts ABI map.
|
89
|
+
* @returns
|
90
|
+
*/
|
91
|
+
getTransactionSummary<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionSummary<TTransactionType>>;
|
92
|
+
private waitForStatusChange;
|
93
|
+
/**
|
94
|
+
* Waits for transaction to complete and returns the result.
|
95
|
+
*
|
96
|
+
* @returns The completed transaction result
|
97
|
+
*/
|
98
|
+
waitForResult<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionResult<TTransactionType>>;
|
99
|
+
/**
|
100
|
+
* Waits for transaction to complete and returns the result.
|
101
|
+
*
|
102
|
+
* @param contractsAbiMap - The contracts ABI map.
|
103
|
+
*/
|
104
|
+
wait<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionResult<TTransactionType>>;
|
105
|
+
}
|
106
|
+
//# sourceMappingURL=transaction-response.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transaction-response.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-response/transaction-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAGxC,OAAO,KAAK,EACV,kBAAkB,EAElB,cAAc,EACd,MAAM,EACP,MAAM,8BAA8B,CAAC;AAEtC,cAAc;AACd,MAAM,MAAM,4BAA4B,GAAG,WAAW,CAAC;AACvD,cAAc;AACd,MAAM,MAAM,8BAA8B,GAAG,aAAa,CAAC;AAC3D,cAAc;AACd,MAAM,MAAM,kCAAkC,GAAG,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACtF,cAAc;AACd,MAAM,MAAM,6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Ac,CAAC;IAEhC;;;;;OAKG;gBACS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAK1C;;;;;;;OAOG;WACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAMjF;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC;IAwBtC;;;;;OAKG;IACH,iBAAiB,CAAC,gBAAgB,GAAG,IAAI,EAAE,uBAAuB,EAAE,cAAc;IAOlF;;;;;;OAMG;IACG,qBAAqB,CAAC,gBAAgB,GAAG,IAAI,EACjD,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;YAgClC,mBAAmB;IAyBjC;;;;OAIG;IACG,aAAa,CAAC,gBAAgB,GAAG,IAAI,EACzC,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAa/C;;;;OAIG;IACG,IAAI,CAAC,gBAAgB,GAAG,IAAI,EAChC,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAYhD"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { type BN } from '@fuel-ts/math';
|
2
|
+
import { type Transaction } from '@fuel-ts/transactions';
|
3
|
+
import type { GqlGasCosts } from '../__generated__/operations';
|
4
|
+
import type { TransactionResultReceipt } from '../transaction-response';
|
5
|
+
import type { AbiMap, GraphqlTransactionStatus, TransactionSummary } from './types';
|
6
|
+
export interface AssembleTransactionSummaryParams {
|
7
|
+
gasPerByte: BN;
|
8
|
+
gasPriceFactor: BN;
|
9
|
+
transaction: Transaction;
|
10
|
+
id?: string;
|
11
|
+
transactionBytes: Uint8Array;
|
12
|
+
gqlTransactionStatus?: GraphqlTransactionStatus;
|
13
|
+
receipts: TransactionResultReceipt[];
|
14
|
+
abiMap?: AbiMap;
|
15
|
+
maxInputs: BN;
|
16
|
+
gasCosts: GqlGasCosts;
|
17
|
+
}
|
18
|
+
/** @hidden */
|
19
|
+
export declare function assembleTransactionSummary<TTransactionType = void>(params: AssembleTransactionSummaryParams): TransactionSummary<TTransactionType>;
|
20
|
+
//# sourceMappingURL=assemble-transaction-summary.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assemble-transaction-summary.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/assemble-transaction-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAaxE,OAAO,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEpF,MAAM,WAAW,gCAAgC;IAC/C,UAAU,EAAE,EAAE,CAAC;IACf,cAAc,EAAE,EAAE,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,UAAU,CAAC;IAC7B,oBAAoB,CAAC,EAAE,wBAAwB,CAAC;IAChD,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,EAAE,CAAC;IACd,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED,cAAc;AACd,wBAAgB,0BAA0B,CAAC,gBAAgB,GAAG,IAAI,EAChE,MAAM,EAAE,gCAAgC,wCA8EzC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { BN } from '@fuel-ts/math';
|
2
|
+
import type { GqlConsensusParameters, GqlFeeParameters } from '../__generated__/operations';
|
3
|
+
type FeeParams = Pick<GqlFeeParameters, 'gasPerByte' | 'gasPriceFactor'> | {
|
4
|
+
gasPerByte: BN | number;
|
5
|
+
gasPriceFactor: BN | number;
|
6
|
+
};
|
7
|
+
export type CalculateTransactionFeeParams = {
|
8
|
+
gasUsed: BN;
|
9
|
+
rawPayload: string;
|
10
|
+
consensusParameters: Pick<GqlConsensusParameters, 'gasCosts'> & {
|
11
|
+
feeParams: FeeParams;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
export declare const calculateTransactionFee: (params: CalculateTransactionFeeParams) => {
|
15
|
+
fee: BN;
|
16
|
+
minFee: BN;
|
17
|
+
maxFee: BN;
|
18
|
+
feeFromGasUsed: BN;
|
19
|
+
};
|
20
|
+
export {};
|
21
|
+
//# sourceMappingURL=calculate-transaction-fee.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"calculate-transaction-fee.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/calculate-transaction-fee.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAMxC,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAS5F,KAAK,SAAS,GACV,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,gBAAgB,CAAC,GACvD;IACE,UAAU,EAAE,EAAE,GAAG,MAAM,CAAC;IACxB,cAAc,EAAE,EAAE,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEN,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE,CAAC;CAC1F,CAAC;AAEF,eAAO,MAAM,uBAAuB,WAAY,6BAA6B;;;;;CAwF5E,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { type JsonAbi } from '@fuel-ts/abi-coder';
|
2
|
+
import type { BN } from '@fuel-ts/math';
|
3
|
+
import type { ReceiptCall } from '@fuel-ts/transactions';
|
4
|
+
type GetFunctionCallProps = {
|
5
|
+
abi: JsonAbi;
|
6
|
+
receipt: ReceiptCall;
|
7
|
+
rawPayload?: string;
|
8
|
+
maxInputs: BN;
|
9
|
+
};
|
10
|
+
export declare const getFunctionCall: ({ abi, receipt, rawPayload, maxInputs }: GetFunctionCallProps) => {
|
11
|
+
amount?: BN | undefined;
|
12
|
+
assetId?: string | undefined;
|
13
|
+
functionSignature: string;
|
14
|
+
functionName: string;
|
15
|
+
argumentsProvided: {} | undefined;
|
16
|
+
};
|
17
|
+
export {};
|
18
|
+
//# sourceMappingURL=call.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,OAAO,EAAuB,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,EAAE,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe,4CAA6C,oBAAoB;;;;;;CAuD5F,CAAC"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import type { GqlGetTransactionsByOwnerQueryVariables, GqlPageInfo } from '../__generated__/operations';
|
2
|
+
import type Provider from '../provider';
|
3
|
+
import type { TransactionRequest } from '../transaction-request';
|
4
|
+
import type { TransactionResult } from '../transaction-response';
|
5
|
+
import type { AbiMap, TransactionSummary } from './types';
|
6
|
+
/** @hidden */
|
7
|
+
export interface GetTransactionSummaryParams {
|
8
|
+
id: string;
|
9
|
+
provider: Provider;
|
10
|
+
abiMap?: AbiMap;
|
11
|
+
}
|
12
|
+
export declare function getTransactionSummary<TTransactionType = void>(params: GetTransactionSummaryParams): Promise<TransactionResult>;
|
13
|
+
export interface GetTransactionSummaryFromRequestParams {
|
14
|
+
transactionRequest: TransactionRequest;
|
15
|
+
provider: Provider;
|
16
|
+
abiMap?: AbiMap;
|
17
|
+
}
|
18
|
+
/** @hidden */
|
19
|
+
export declare function getTransactionSummaryFromRequest<TTransactionType = void>(params: GetTransactionSummaryFromRequestParams): Promise<TransactionSummary<TTransactionType>>;
|
20
|
+
export interface GetTransactionsSummariesParams {
|
21
|
+
provider: Provider;
|
22
|
+
filters: GqlGetTransactionsByOwnerQueryVariables;
|
23
|
+
abiMap?: AbiMap;
|
24
|
+
}
|
25
|
+
export interface GetTransactionsSummariesReturns {
|
26
|
+
transactions: TransactionResult[];
|
27
|
+
pageInfo: GqlPageInfo;
|
28
|
+
}
|
29
|
+
/** @hidden */
|
30
|
+
export declare function getTransactionsSummaries(params: GetTransactionsSummariesParams): Promise<GetTransactionsSummariesReturns>;
|
31
|
+
//# sourceMappingURL=get-transaction-summary.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-transaction-summary.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/get-transaction-summary.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uCAAuC,EACvC,WAAW,EACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,qBAAqB,CAAC,gBAAgB,GAAG,IAAI,EACjE,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CA0C5B;AAED,MAAM,WAAW,sCAAsC;IACrD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,cAAc;AACd,wBAAsB,gCAAgC,CAAC,gBAAgB,GAAG,IAAI,EAC5E,MAAM,EAAE,sCAAsC,GAC7C,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,CAuB/C;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,uCAAuC,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,+BAA+B;IAC9C,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED,cAAc;AACd,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,+BAA+B,CAAC,CA6C1C"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from './types';
|
2
|
+
export * from './output';
|
3
|
+
export * from './input';
|
4
|
+
export * from './status';
|
5
|
+
export * from './operations';
|
6
|
+
export * from './get-transaction-summary';
|
7
|
+
export * from './assemble-transaction-summary';
|
8
|
+
export * from './receipt';
|
9
|
+
export * from './calculate-transaction-fee';
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { Input, InputCoin, InputContract, InputMessage } from '@fuel-ts/transactions';
|
2
|
+
import { InputType } from '@fuel-ts/transactions';
|
3
|
+
/** @hidden */
|
4
|
+
export declare function getInputsByTypes<T = Input>(inputs: Input[], types: Array<InputType>): T[];
|
5
|
+
/** @hidden */
|
6
|
+
export declare function getInputsByType<T = Input>(inputs: Input[], type: InputType): T[];
|
7
|
+
/** @hidden */
|
8
|
+
export declare function getInputsCoin(inputs: Input[]): InputCoin[];
|
9
|
+
/** @hidden */
|
10
|
+
export declare function getInputsMessage(inputs: Input[]): InputMessage[];
|
11
|
+
/** @hidden */
|
12
|
+
export declare function getInputsCoinAndMessage(inputs: Input[]): (InputCoin | InputMessage)[];
|
13
|
+
/** @hidden */
|
14
|
+
export declare function getInputsContract(inputs: Input[]): InputContract[];
|
15
|
+
/** @hidden */
|
16
|
+
export declare function getInputFromAssetId(inputs: Input[], assetId: string): InputCoin | InputMessage | undefined;
|
17
|
+
/** @hidden */
|
18
|
+
export declare function getInputContractFromIndex(inputs: Input[], inputIndex: number): InputContract | undefined;
|
19
|
+
/** @hidden */
|
20
|
+
export declare function getInputAccountAddress(input: Input): string;
|
21
|
+
//# sourceMappingURL=input.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,cAAc;AACd,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,OAEnF;AAED,cAAc;AACd,wBAAgB,eAAe,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,OAE1E;AAED,cAAc;AACd,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,eAE5C;AAED,cAAc;AACd,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,kBAE/C;AAED,cAAc;AACd,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,KAAK,EAAE,gCAEtD;AAED,cAAc;AACd,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,mBAEhD;AAED,cAAc;AACd,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,wCAUnE;AAED,cAAc;AACd,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,KAAK,EAAE,EACf,UAAU,EAAE,MAAM,GACjB,aAAa,GAAG,SAAS,CAkB3B;AAED,cAAc;AACd,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,UAUlD"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ReceiptType, TransactionType } from '@fuel-ts/transactions';
|
2
|
+
import type { Output } from '@fuel-ts/transactions';
|
3
|
+
import type { TransactionResultReceipt } from '../transaction-response';
|
4
|
+
import { TransactionTypeName } from './types';
|
5
|
+
import type { InputOutputParam, InputParam, OperationCoin, RawPayloadParam, ReceiptParam, Operation, GetOperationParams, GetTransferOperationsParams } from './types';
|
6
|
+
/** @hidden */
|
7
|
+
export declare function getReceiptsByType<T = TransactionResultReceipt>(receipts: TransactionResultReceipt[], type: ReceiptType): T[];
|
8
|
+
/** @hidden */
|
9
|
+
export declare function getTransactionTypeName(transactionType: TransactionType): TransactionTypeName;
|
10
|
+
/** @hidden */
|
11
|
+
export declare function isType(transactionType: TransactionType, type: TransactionTypeName): boolean;
|
12
|
+
/** @hidden */
|
13
|
+
export declare function isTypeMint(transactionType: TransactionType): boolean;
|
14
|
+
/** @hidden */
|
15
|
+
export declare function isTypeCreate(transactionType: TransactionType): boolean;
|
16
|
+
/** @hidden */
|
17
|
+
export declare function isTypeScript(transactionType: TransactionType): boolean;
|
18
|
+
/** @hidden */
|
19
|
+
export declare function hasSameAssetId(a: OperationCoin): (b: OperationCoin) => boolean;
|
20
|
+
/** @hidden */
|
21
|
+
export declare function getReceiptsCall(receipts: TransactionResultReceipt[]): import("@fuel-ts/transactions").ReceiptCall[];
|
22
|
+
/** @hidden */
|
23
|
+
export declare function getReceiptsMessageOut(receipts: TransactionResultReceipt[]): import("@fuel-ts/transactions").ReceiptMessageOut[];
|
24
|
+
/** @hidden */
|
25
|
+
export declare function addOperation(operations: Operation[], toAdd: Operation): Operation[];
|
26
|
+
/** @hidden */
|
27
|
+
export declare function getReceiptsTransferOut(receipts: TransactionResultReceipt[]): import("@fuel-ts/transactions").ReceiptTransferOut[];
|
28
|
+
/** @hidden */
|
29
|
+
export declare function getWithdrawFromFuelOperations({ inputs, receipts, }: InputParam & ReceiptParam): Operation[];
|
30
|
+
/** @hidden */
|
31
|
+
export declare function getContractCallOperations({ inputs, outputs, receipts, abiMap, rawPayload, maxInputs, }: InputOutputParam & ReceiptParam & Pick<GetOperationParams, 'abiMap' | 'maxInputs'> & RawPayloadParam): Operation[];
|
32
|
+
/** @hidden */
|
33
|
+
export declare function getTransferOperations({ inputs, outputs, receipts, }: GetTransferOperationsParams): Operation[];
|
34
|
+
/** @hidden */
|
35
|
+
export declare function getPayProducerOperations(outputs: Output[]): Operation[];
|
36
|
+
/** @hidden */
|
37
|
+
export declare function getContractCreatedOperations({ inputs, outputs }: InputOutputParam): Operation[];
|
38
|
+
/** @hidden */
|
39
|
+
export declare function getOperations({ transactionType, inputs, outputs, receipts, abiMap, rawPayload, maxInputs, }: GetOperationParams): Operation[];
|
40
|
+
//# sourceMappingURL=operations.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAiB,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAAK,EACV,wBAAwB,EAKzB,MAAM,yBAAyB,CAAC;AAgBjC,OAAO,EAAyC,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,cAAc;AACd,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,wBAAwB,EAC5D,QAAQ,EAAE,wBAAwB,EAAE,EACpC,IAAI,EAAE,WAAW,OAGlB;AAED,cAAc;AACd,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,mBAAmB,CAc5F;AAED,cAAc;AACd,wBAAgB,MAAM,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,WAIjF;AAED,cAAc;AACd,wBAAgB,UAAU,CAAC,eAAe,EAAE,eAAe,WAE1D;AAED,cAAc;AACd,wBAAgB,YAAY,CAAC,eAAe,EAAE,eAAe,WAE5D;AAED,cAAc;AACd,wBAAgB,YAAY,CAAC,eAAe,EAAE,eAAe,WAE5D;AAED,cAAc;AACd,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,OAClC,aAAa,aACzB;AAED,cAAc;AACd,wBAAgB,eAAe,CAAC,QAAQ,EAAE,wBAAwB,EAAE,iDAEnE;AAED,cAAc;AACd,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,wBAAwB,EAAE,uDAEzE;AAwCD,cAAc;AACd,wBAAgB,YAAY,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,eAgCrE;AAED,cAAc;AACd,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,wBAAwB,EAAE,wDAE1E;AAED,cAAc;AACd,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,QAAQ,GACT,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,EAAE,CAsCzC;AAED,cAAc;AACd,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,GACV,EAAE,gBAAgB,GACjB,YAAY,GACZ,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,WAAW,CAAC,GAChD,eAAe,GAAG,SAAS,EAAE,CA8D9B;AA4CD,cAAc;AACd,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,2BAA2B,GAAG,SAAS,EAAE,CA8D3C;AAED,cAAc;AACd,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAyBvE;AAED,cAAc;AACd,wBAAgB,4BAA4B,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,gBAAgB,GAAG,SAAS,EAAE,CAqB/F;AAED,cAAc;AACd,wBAAgB,aAAa,CAAC,EAC5B,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,GACV,EAAE,kBAAkB,GAAG,SAAS,EAAE,CAwBlC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { Output, OutputChange, OutputCoin, OutputContract, OutputContractCreated, OutputVariable } from '@fuel-ts/transactions';
|
2
|
+
import { OutputType } from '@fuel-ts/transactions';
|
3
|
+
/** @hidden */
|
4
|
+
export declare function getOutputsByType<T = Output>(outputs: Output[], type: OutputType): T[];
|
5
|
+
/** @hidden */
|
6
|
+
export declare function getOutputsContractCreated(outputs: Output[]): OutputContractCreated[];
|
7
|
+
/** @hidden */
|
8
|
+
export declare function getOutputsCoin(outputs: Output[]): OutputCoin[];
|
9
|
+
/** @hidden */
|
10
|
+
export declare function getOutputsChange(outputs: Output[]): OutputChange[];
|
11
|
+
/** @hidden */
|
12
|
+
export declare function getOutputsContract(outputs: Output[]): OutputContract[];
|
13
|
+
/** @hidden */
|
14
|
+
export declare function getOutputsVariable(outputs: Output[]): OutputVariable[];
|
15
|
+
//# sourceMappingURL=output.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,cAAc;AACd,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,OAE/E;AAED,cAAc;AACd,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,2BAE1D;AAED,cAAc;AACd,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,gBAE/C;AAED,cAAc;AACd,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,kBAEjD;AAED,cAAc;AACd,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAEnD;AAED,cAAc;AACd,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,oBAEnD"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { GqlReceiptFragmentFragment } from '../__generated__/operations';
|
2
|
+
import type { TransactionResultReceipt } from '../transaction-response';
|
3
|
+
import type { BurnedAsset, MintedAsset } from './types';
|
4
|
+
export declare const processGqlReceipt: (gqlReceipt: GqlReceiptFragmentFragment) => TransactionResultReceipt;
|
5
|
+
export declare const extractMintedAssetsFromReceipts: (receipts: Array<TransactionResultReceipt>) => MintedAsset[];
|
6
|
+
export declare const extractBurnedAssetsFromReceipts: (receipts: Array<TransactionResultReceipt>) => BurnedAsset[];
|
7
|
+
//# sourceMappingURL=receipt.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/receipt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,iBAAiB,eAChB,0BAA0B,KACrC,wBAmBF,CAAC;AAEF,eAAO,MAAM,+BAA+B,aAChC,MAAM,wBAAwB,CAAC,KACxC,WAAW,EAeb,CAAC;AAEF,eAAO,MAAM,+BAA+B,aAChC,MAAM,wBAAwB,CAAC,KACxC,WAAW,EAeb,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { GqlTransactionStatusesNames, GraphqlTransactionStatus, TransactionSummary } from './types';
|
2
|
+
import { TransactionStatus } from './types';
|
3
|
+
/** @hidden */
|
4
|
+
export declare const getTransactionStatusName: (gqlStatus: GqlTransactionStatusesNames) => TransactionStatus;
|
5
|
+
type IProcessGraphqlStatusResponse = Pick<TransactionSummary, 'time' | 'blockId' | 'isStatusPending' | 'isStatusSuccess' | 'isStatusFailure' | 'status'>;
|
6
|
+
/** @hidden */
|
7
|
+
export declare const processGraphqlStatus: (gqlTransactionStatus?: GraphqlTransactionStatus) => IProcessGraphqlStatusResponse;
|
8
|
+
export {};
|
9
|
+
//# sourceMappingURL=status.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/status.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,2BAA2B,EAC3B,wBAAwB,EAExB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,cAAc;AACd,eAAO,MAAM,wBAAwB,cAAe,2BAA2B,sBAgB9E,CAAC;AAEF,KAAK,6BAA6B,GAAG,IAAI,CACvC,kBAAkB,EAClB,MAAM,GAAG,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,QAAQ,CAC1F,CAAC;AAEF,cAAc;AACd,eAAO,MAAM,oBAAoB,0BAA2B,wBAAwB,kCA2CnF,CAAC"}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import type { JsonAbi } from '@fuel-ts/abi-coder';
|
2
|
+
import type { B256Address } from '@fuel-ts/interfaces';
|
3
|
+
import type { BN, BNInput } from '@fuel-ts/math';
|
4
|
+
import type { Input, Output, Transaction, TransactionType } from '@fuel-ts/transactions';
|
5
|
+
import type { GqlGetTransactionQuery } from '../__generated__/operations';
|
6
|
+
import type { TransactionResultReceipt } from '../transaction-response';
|
7
|
+
export type GqlTransaction = NonNullable<GqlGetTransactionQuery['transaction']>;
|
8
|
+
export type GraphqlTransactionStatus = GqlTransaction['status'];
|
9
|
+
export type SuccessStatus = Extract<GraphqlTransactionStatus, {
|
10
|
+
__typename: 'SuccessStatus';
|
11
|
+
}>;
|
12
|
+
export type FailureStatus = Extract<GraphqlTransactionStatus, {
|
13
|
+
__typename: 'FailureStatus';
|
14
|
+
}>;
|
15
|
+
export type SubmittedStatus = Extract<GraphqlTransactionStatus, {
|
16
|
+
__typename: 'SubmittedStatus';
|
17
|
+
}>;
|
18
|
+
export type SqueezedOutStatus = Extract<GraphqlTransactionStatus, {
|
19
|
+
__typename: 'SqueezedOutStatus';
|
20
|
+
}>;
|
21
|
+
export type Reason = FailureStatus['reason'];
|
22
|
+
export type ProgramState = SuccessStatus['programState'];
|
23
|
+
export type Time = SubmittedStatus['time'] | SuccessStatus['time'] | FailureStatus['time'];
|
24
|
+
export type BlockId = SuccessStatus['block']['id'] | FailureStatus['block']['id'];
|
25
|
+
/**
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
export declare enum TransactionTypeName {
|
29
|
+
Create = "Create",
|
30
|
+
Mint = "Mint",
|
31
|
+
Script = "Script"
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* @hidden
|
35
|
+
*/
|
36
|
+
export declare enum TransactionStatus {
|
37
|
+
submitted = "submitted",
|
38
|
+
success = "success",
|
39
|
+
squeezedout = "squeezedout",
|
40
|
+
failure = "failure"
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* @hidden
|
44
|
+
*/
|
45
|
+
export type GqlTransactionStatusesNames = 'FailureStatus' | 'SubmittedStatus' | 'SuccessStatus' | 'SqueezedOutStatus';
|
46
|
+
/**
|
47
|
+
* @hidden
|
48
|
+
*/
|
49
|
+
export declare enum OperationName {
|
50
|
+
payBlockProducer = "Pay network fee to block producer",
|
51
|
+
contractCreated = "Contract created",
|
52
|
+
transfer = "Transfer asset",
|
53
|
+
contractCall = "Contract call",
|
54
|
+
receive = "Receive asset",
|
55
|
+
mint = "Mint asset",
|
56
|
+
predicatecall = "Predicate call",
|
57
|
+
script = "Script",
|
58
|
+
sent = "Sent asset",
|
59
|
+
withdrawFromFuel = "Withdraw from Fuel"
|
60
|
+
}
|
61
|
+
export type OperationCoin = {
|
62
|
+
assetId: string;
|
63
|
+
amount: BNInput;
|
64
|
+
};
|
65
|
+
export type OperationFunctionCall = {
|
66
|
+
functionSignature: string;
|
67
|
+
functionName: string;
|
68
|
+
argumentsProvided?: Record<string, unknown>;
|
69
|
+
} & Partial<OperationCoin>;
|
70
|
+
export type Operation = {
|
71
|
+
name?: OperationName;
|
72
|
+
from?: OperationTransactionAddress;
|
73
|
+
to?: OperationTransactionAddress;
|
74
|
+
assetsSent?: Array<OperationCoin>;
|
75
|
+
calls?: Array<OperationFunctionCall>;
|
76
|
+
};
|
77
|
+
/**
|
78
|
+
* @hidden
|
79
|
+
*/
|
80
|
+
export declare enum AddressType {
|
81
|
+
contract = 0,
|
82
|
+
account = 1
|
83
|
+
}
|
84
|
+
/**
|
85
|
+
* @hidden
|
86
|
+
*/
|
87
|
+
export declare enum ChainName {
|
88
|
+
ethereum = "ethereum",
|
89
|
+
fuel = "fuel"
|
90
|
+
}
|
91
|
+
export type OperationTransactionAddress = {
|
92
|
+
address: string;
|
93
|
+
type: AddressType;
|
94
|
+
chain?: ChainName;
|
95
|
+
};
|
96
|
+
export type InputParam = {
|
97
|
+
inputs: Input[];
|
98
|
+
};
|
99
|
+
export type OutputParam = {
|
100
|
+
outputs: Output[];
|
101
|
+
};
|
102
|
+
export type ReceiptParam = {
|
103
|
+
receipts: TransactionResultReceipt[];
|
104
|
+
};
|
105
|
+
export type AbiMap = Record<string, JsonAbi>;
|
106
|
+
export type RawPayloadParam = {
|
107
|
+
rawPayload?: string;
|
108
|
+
};
|
109
|
+
export type InputOutputParam = InputParam & OutputParam;
|
110
|
+
export interface GetTransferOperationsParams extends InputOutputParam {
|
111
|
+
receipts: TransactionResultReceipt[];
|
112
|
+
}
|
113
|
+
export type GetOperationParams = {
|
114
|
+
transactionType: TransactionType;
|
115
|
+
abiMap?: AbiMap;
|
116
|
+
maxInputs: BN;
|
117
|
+
} & InputOutputParam & ReceiptParam & RawPayloadParam;
|
118
|
+
export interface MintedAsset {
|
119
|
+
subId: B256Address;
|
120
|
+
contractId: B256Address;
|
121
|
+
assetId: B256Address;
|
122
|
+
amount: BN;
|
123
|
+
}
|
124
|
+
export type BurnedAsset = MintedAsset;
|
125
|
+
export type TransactionSummary<TTransactionType = void> = {
|
126
|
+
id?: string;
|
127
|
+
time?: string;
|
128
|
+
operations: Operation[];
|
129
|
+
gasUsed: BN;
|
130
|
+
fee: BN;
|
131
|
+
type: TransactionTypeName;
|
132
|
+
blockId?: BlockId;
|
133
|
+
status?: TransactionStatus;
|
134
|
+
isTypeMint: boolean;
|
135
|
+
isTypeCreate: boolean;
|
136
|
+
isTypeScript: boolean;
|
137
|
+
isStatusPending: boolean;
|
138
|
+
isStatusSuccess: boolean;
|
139
|
+
isStatusFailure: boolean;
|
140
|
+
mintedAssets: MintedAsset[];
|
141
|
+
burnedAssets: BurnedAsset[];
|
142
|
+
date?: Date;
|
143
|
+
receipts: TransactionResultReceipt[];
|
144
|
+
transaction: Transaction<TTransactionType>;
|
145
|
+
};
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-summary/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,CAAC;AAEhF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,wBAAwB,EAAE;IAAE,UAAU,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC;AAC/F,MAAM,MAAM,aAAa,GAAG,O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5C,CAAC"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import type { ProviderOptions } from '../provider';
|
2
|
+
type Backoff = 'linear' | 'exponential' | 'fixed';
|
3
|
+
/**
|
4
|
+
* Retry options scheme
|
5
|
+
*/
|
6
|
+
export type RetryOptions = {
|
7
|
+
/**
|
8
|
+
* Amount of attempts to retry before failing the call.
|
9
|
+
*/
|
10
|
+
maxRetries: number;
|
11
|
+
/**
|
12
|
+
* Backoff strategy to use when retrying. Default is exponential.
|
13
|
+
*/
|
14
|
+
backoff?: Backoff;
|
15
|
+
/**
|
16
|
+
* Starting delay for backoff strategy. Default is 150ms.
|
17
|
+
*/
|
18
|
+
baseDelay?: number;
|
19
|
+
};
|
20
|
+
/**
|
21
|
+
* Calculate the delay for the next retry attempt
|
22
|
+
* @param options - Retry options configuration
|
23
|
+
* @param retryAttemptNum - 1-based, tells which retry attempt is this
|
24
|
+
* @returns Next wait delay
|
25
|
+
*/
|
26
|
+
export declare function getWaitDelay(options: RetryOptions, retryAttemptNum: number): number;
|
27
|
+
/**
|
28
|
+
* Returns a wrapped fetch function that will auto-execute itself in case of errors, until it succeeds
|
29
|
+
* @param fetchFn - Function to be auto-retried
|
30
|
+
* @param options - Retry options configuration
|
31
|
+
* @param retryAttemptNum - ZERO=first call, ONE=first retry, TWO=second retry, etc.
|
32
|
+
* @returns Whatever is the output of the `fetchFn` function
|
33
|
+
*/
|
34
|
+
export declare function autoRetryFetch(fetchFn: NonNullable<ProviderOptions['fetch']>, options?: RetryOptions, retryAttemptNum?: number): NonNullable<ProviderOptions['fetch']>;
|
35
|
+
export {};
|
36
|
+
//# sourceMappingURL=auto-retry-fetch.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"auto-retry-fetch.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/auto-retry-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,KAAK,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAY1E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAC9C,OAAO,CAAC,EAAE,YAAY,EACtB,eAAe,GAAE,MAAU,GAC1B,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CA+BvC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* @hidden
|
3
|
+
*
|
4
|
+
* Builds a block explorer url based on and the given path, block explorer URL and provider URL
|
5
|
+
*/
|
6
|
+
export declare const buildBlockExplorerUrl: (options?: {
|
7
|
+
blockExplorerUrl?: string;
|
8
|
+
path?: string;
|
9
|
+
providerUrl?: string;
|
10
|
+
address?: string;
|
11
|
+
txId?: string;
|
12
|
+
blockNumber?: number;
|
13
|
+
}) => string;
|
14
|
+
//# sourceMappingURL=block-explorer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"block-explorer.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/block-explorer.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,aACvB;IACP,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,WAsEF,CAAC"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import type { BN, BNInput } from '@fuel-ts/math';
|
2
|
+
import { type Input } from '@fuel-ts/transactions';
|
3
|
+
import type { GqlDependentCost, GqlGasCosts } from '../__generated__/operations';
|
4
|
+
import type { TransactionRequestInput } from '../transaction-request';
|
5
|
+
import type { TransactionResultReceipt } from '../transaction-response';
|
6
|
+
/** @hidden */
|
7
|
+
export declare const calculatePriceWithFactor: (gas: BN, gasPrice: BN, priceFactor: BN) => BN;
|
8
|
+
/** @hidden */
|
9
|
+
export declare const getGasUsedFromReceipts: (receipts: Array<TransactionResultReceipt>) => BN;
|
10
|
+
export declare function resolveGasDependentCosts(byteSize: BNInput, gasDependentCost: GqlDependentCost): BN;
|
11
|
+
export declare function gasUsedByInputs(inputs: Array<TransactionRequestInput | Input>, txBytesSize: number, gasCosts: GqlGasCosts): BN;
|
12
|
+
export interface IGetMinGasParams {
|
13
|
+
inputs: Array<TransactionRequestInput | Input>;
|
14
|
+
gasCosts: GqlGasCosts;
|
15
|
+
txBytesSize: number;
|
16
|
+
metadataGas: BN;
|
17
|
+
gasPerByte: BN;
|
18
|
+
}
|
19
|
+
export declare function getMinGas(params: IGetMinGasParams): BN;
|
20
|
+
export interface IGetMaxGasParams {
|
21
|
+
witnessesLength: number;
|
22
|
+
witnessLimit?: BN;
|
23
|
+
gasPerByte: BN;
|
24
|
+
minGas: BN;
|
25
|
+
gasLimit?: BN;
|
26
|
+
}
|
27
|
+
export declare function getMaxGas(params: IGetMaxGasParams): BN;
|
28
|
+
export declare function calculateMetadataGasForTxCreate({ gasCosts, stateRootSize, txBytesSize, contractBytesSize, }: {
|
29
|
+
gasCosts: GqlGasCosts;
|
30
|
+
contractBytesSize: BN;
|
31
|
+
stateRootSize: number;
|
32
|
+
txBytesSize: number;
|
33
|
+
}): BN;
|
34
|
+
export declare function calculateMetadataGasForTxScript({ gasCosts, txBytesSize, }: {
|
35
|
+
gasCosts: GqlGasCosts;
|
36
|
+
txBytesSize: number;
|
37
|
+
}): BN;
|
38
|
+
//# sourceMappingURL=gas.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/gas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,cAAc;AACd,eAAO,MAAM,wBAAwB,QAAS,EAAE,YAAY,EAAE,eAAe,EAAE,KAAG,EACZ,CAAC;AAEvE,cAAc;AACd,eAAO,MAAM,sBAAsB,aAAc,MAAM,wBAAwB,CAAC,KAAG,EAQlF,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,MAU7F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,EAC9C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,WAAW,MAmBtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IAC/C,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,EAAE,CAAC;IAChB,UAAU,EAAE,EAAE,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,gBAAgB,MAUjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAA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