@fuel-ts/account 0.0.0-rc-1815-20240322115843 → 0.0.0-rc-1356-20240322130951
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 +0 -7
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +0 -10
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/index.global.js +12 -70
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +107 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -71
- package/dist/index.mjs.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +1 -20
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -1
- package/dist/providers/utils/index.d.ts +0 -1
- package/dist/providers/utils/index.d.ts.map +1 -1
- package/dist/test-utils/asset-id.d.ts +9 -0
- package/dist/test-utils/asset-id.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +8 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts +33 -0
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -0
- package/dist/test-utils/test-message.d.ts +28 -0
- package/dist/test-utils/test-message.d.ts.map +1 -0
- package/dist/test-utils/wallet-config.d.ts +49 -0
- package/dist/test-utils/wallet-config.d.ts.map +1 -0
- package/dist/test-utils.global.js +328 -70
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +332 -164
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +235 -71
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +17 -16
- package/dist/providers/utils/sleep.d.ts +0 -3
- package/dist/providers/utils/sleep.d.ts.map +0 -1
@@ -3,7 +3,6 @@ import type { AddressLike, AbstractAddress, BytesLike } from '@fuel-ts/interface
|
|
3
3
|
import type { BN, BigNumberish } from '@fuel-ts/math';
|
4
4
|
import type { TransactionScript, Policy, TransactionCreate } from '@fuel-ts/transactions';
|
5
5
|
import { TransactionType } from '@fuel-ts/transactions';
|
6
|
-
import type { Account } from '../../account';
|
7
6
|
import type { Predicate } from '../../predicate';
|
8
7
|
import type { GqlGasCosts } from '../__generated__/operations';
|
9
8
|
import type { Coin } from '../coin';
|
@@ -96,23 +95,12 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
96
95
|
* Pushes an output to the list without any side effects and returns the index
|
97
96
|
*/
|
98
97
|
protected pushOutput(output: TransactionRequestOutput): number;
|
99
|
-
/**
|
100
|
-
* @hidden
|
101
|
-
*
|
102
|
-
* Pushes a witness to the list and returns the index
|
103
|
-
*
|
104
|
-
* @param signature - The signature to add to the witness.
|
105
|
-
* @returns The index of the created witness.
|
106
|
-
*/
|
107
|
-
addWitness(signature: BytesLike): number;
|
108
98
|
/**
|
109
99
|
* @hidden
|
110
100
|
*
|
111
101
|
* Creates an empty witness without any side effects and returns the index
|
112
|
-
*
|
113
|
-
* @returns The index of the created witness.
|
114
102
|
*/
|
115
|
-
protected
|
103
|
+
protected createWitness(): number;
|
116
104
|
/**
|
117
105
|
* Updates the witness for a given owner and signature.
|
118
106
|
*
|
@@ -128,13 +116,6 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
128
116
|
* @throws If the witness does not exist.
|
129
117
|
*/
|
130
118
|
updateWitness(index: number, witness: TransactionRequestWitness): void;
|
131
|
-
/**
|
132
|
-
* Helper function to add an external signature to the transaction.
|
133
|
-
*
|
134
|
-
* @param account - The account/s to sign to the transaction.
|
135
|
-
* @returns The transaction with the signature witness added.
|
136
|
-
*/
|
137
|
-
addAccountWitnesses(account: Account | Account[]): Promise<this>;
|
138
119
|
/**
|
139
120
|
* Gets the coin inputs for a transaction.
|
140
121
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAKL,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAKL,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAA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IN,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,EAAE;CA6BxD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auto-retry-fetch.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/auto-retry-fetch.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"auto-retry-fetch.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/auto-retry-fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"asset-id.d.ts","sourceRoot":"","sources":["../../src/test-utils/asset-id.ts"],"names":[],"mappings":"AAIA,qBAAa,OAAO;IAWS,KAAK,EAAE,MAAM;IAVxC,OAAc,WAAW,UAA4B;IAErD,OAAc,CAAC,UAEb;IAEF,OAAc,CAAC,UAEb;IAEF,OAAO;WAEO,MAAM;CAGrB"}
|
@@ -1,4 +1,8 @@
|
|
1
1
|
export * from './generateTestWallet';
|
2
2
|
export * from './seedTestWallet';
|
3
3
|
export * from './launchNode';
|
4
|
+
export * from './setup-test-provider-and-wallets';
|
5
|
+
export * from './wallet-config';
|
6
|
+
export * from './test-message';
|
7
|
+
export * from './asset-id';
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
+
import type { ChainConfig } from '@fuel-ts/utils';
|
2
3
|
import type { ChildProcessWithoutNullStreams } from 'child_process';
|
3
4
|
import { Provider } from '../providers';
|
4
5
|
import type { WalletUnlocked } from '../wallet';
|
@@ -10,11 +11,17 @@ export type LaunchNodeOptions = {
|
|
10
11
|
loggingEnabled?: boolean;
|
11
12
|
debugEnabled?: boolean;
|
12
13
|
basePath?: string;
|
14
|
+
/**
|
15
|
+
* The chain configuration to use.
|
16
|
+
* Passing in a chain configuration path via the `--chain` flag in `args` will override this.
|
17
|
+
* */
|
18
|
+
chainConfig?: ChainConfig;
|
13
19
|
};
|
14
20
|
export type LaunchNodeResult = Promise<{
|
15
21
|
cleanup: () => void;
|
16
22
|
ip: string;
|
17
23
|
port: string;
|
24
|
+
url: string;
|
18
25
|
chainConfigPath: string;
|
19
26
|
}>;
|
20
27
|
export type KillNodeParams = {
|
@@ -36,7 +43,7 @@ export declare const killNode: (params: KillNodeParams) => void;
|
|
36
43
|
* @param debugEnabled - whether the node should log debug messages. (optional, defaults to false)
|
37
44
|
* @param basePath - the base path to use for the temporary folder. (optional, defaults to os.tmpdir())
|
38
45
|
* */
|
39
|
-
export declare const launchNode: ({ ip, port, args, useSystemFuelCore, loggingEnabled, debugEnabled, basePath, }: LaunchNodeOptions) => LaunchNodeResult;
|
46
|
+
export declare const launchNode: ({ ip, port, args, useSystemFuelCore, loggingEnabled, debugEnabled, basePath, chainConfig, }: LaunchNodeOptions) => LaunchNodeResult;
|
40
47
|
export type LaunchNodeAndGetWalletsResult = Promise<{
|
41
48
|
wallets: WalletUnlocked[];
|
42
49
|
stop: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"launchNode.d.ts","sourceRoot":"","sources":["../../src/test-utils/launchNode.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"launchNode.d.ts","sourceRoot":"","sources":["../../src/test-utils/launchNode.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AASpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAuBhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EA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} from '../providers';
|
4
|
+
import { Provider } from '../providers';
|
5
|
+
import type { WalletUnlocked } from '../wallet';
|
6
|
+
import type { LaunchNodeOptions } from './launchNode';
|
7
|
+
import type { WalletConfigOptions } from './wallet-config';
|
8
|
+
export interface LaunchCustomProviderAndGetWalletsOptions {
|
9
|
+
/** Configures the wallets that should exist in the genesis block of the `fuel-core` node. */
|
10
|
+
walletConfig?: Partial<WalletConfigOptions>;
|
11
|
+
/** Options for configuring the provider. */
|
12
|
+
providerOptions?: Partial<ProviderOptions>;
|
13
|
+
/** Options for configuring the test node. */
|
14
|
+
nodeOptions?: Partial<Omit<LaunchNodeOptions, 'chainConfig'> & {
|
15
|
+
chainConfig: PartialDeep<ChainConfig>;
|
16
|
+
}>;
|
17
|
+
}
|
18
|
+
export interface SetupTestProviderAndWalletsReturn extends Disposable {
|
19
|
+
wallets: WalletUnlocked[];
|
20
|
+
provider: Provider;
|
21
|
+
cleanup: () => void;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Launches a test node and creates wallets for testing.
|
25
|
+
* If initialized with the `using` keyword, the node will be killed when it goes out of scope.
|
26
|
+
* If initialized with `const`, manual disposal of the node must be done via the `cleanup` function.
|
27
|
+
*
|
28
|
+
* @param options - Options for configuring the wallets, provider, and test node.
|
29
|
+
* @returns The wallets, provider and cleanup function that kills the node.
|
30
|
+
*
|
31
|
+
*/
|
32
|
+
export declare function setupTestProviderAndWallets({ walletConfig: walletConfigOptions, providerOptions, nodeOptions, }?: Partial<LaunchCustomProviderAndGetWalletsOptions>): Promise<SetupTestProviderAndWalletsReturn>;
|
33
|
+
//# sourceMappingURL=setup-test-provider-and-wallets.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"setup-test-provider-and-wallets.d.ts","sourceRoot":"","sources":["../../src/test-utils/setup-test-provider-and-wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,MAAM,WAAW,wCAAwC;IACvD,6FAA6F;IAC7F,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5C,4CAA4C;IAC5C,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,WAAW,CAAC,EAAE,OAAO,CACnB,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG;QACvC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACvC,CACF,CAAC;CACH;AAUD,MAAM,WAAW,iCAAkC,SAAQ,UAAU;IACnE,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,YAAY,EAAE,mBAAwB,EACtC,eAAe,EACf,WAAgB,GACjB,GAAE,OAAO,CAAC,wCAAwC,CAAM,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAmCrG"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { AbstractAddress } from '@fuel-ts/interfaces';
|
2
|
+
import { type ChainConfig } from '@fuel-ts/utils';
|
3
|
+
interface TestMessageSpecs {
|
4
|
+
sender: AbstractAddress;
|
5
|
+
recipient: AbstractAddress;
|
6
|
+
nonce: string;
|
7
|
+
amount: number;
|
8
|
+
data: string;
|
9
|
+
da_height: string;
|
10
|
+
}
|
11
|
+
export declare class TestMessage {
|
12
|
+
private sender;
|
13
|
+
private recipient;
|
14
|
+
private nonce;
|
15
|
+
private amount;
|
16
|
+
private data;
|
17
|
+
private da_height;
|
18
|
+
/**
|
19
|
+
* A helper class to create messages for testing purposes.
|
20
|
+
*
|
21
|
+
* Used in tandem with `WalletConfig`.
|
22
|
+
* It can also be used standalone and passed into the initial state of a chain via the `.toChainMessage` method.
|
23
|
+
*/
|
24
|
+
constructor({ sender, recipient, nonce, amount, data, da_height, }?: Partial<TestMessageSpecs>);
|
25
|
+
toChainMessage(recipient?: AbstractAddress): ChainConfig['initial_state']['messages'][0];
|
26
|
+
}
|
27
|
+
export {};
|
28
|
+
//# sourceMappingURL=test-message.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"test-message.d.ts","sourceRoot":"","sources":["../../src/test-utils/test-message.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE3D,UAAU,gBAAgB;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;OAKG;gBACS,EACV,MAA6B,EAC7B,SAAgC,EAChC,KAAgC,EAChC,MAAkB,EAClB,IAAW,EACX,SAAkB,GACnB,GAAE,OAAO,CAAC,gBAAgB,CAAM;IASjC,cAAc,CAAC,SAAS,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CAUzF"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import type { ChainConfig } from '@fuel-ts/utils';
|
2
|
+
import type { PartialDeep } from 'type-fest';
|
3
|
+
import { WalletUnlocked } from '../wallet';
|
4
|
+
import { AssetId } from './asset-id';
|
5
|
+
import type { TestMessage } from './test-message';
|
6
|
+
export interface WalletConfigOptions {
|
7
|
+
/**
|
8
|
+
* Number of wallets to generate.
|
9
|
+
*/
|
10
|
+
count: number;
|
11
|
+
/**
|
12
|
+
* If `number`, the number of unique asset ids each wallet will own.
|
13
|
+
*
|
14
|
+
* If `AssetId[]`, the asset ids the each wallet will own besides `AssetId.BaseAssetId`.
|
15
|
+
*/
|
16
|
+
assets: number | AssetId[];
|
17
|
+
/**
|
18
|
+
* Number of coins (UTXOs) per asset id.
|
19
|
+
*/
|
20
|
+
coinsPerAsset: number;
|
21
|
+
/**
|
22
|
+
* For each coin, the amount it'll contain.
|
23
|
+
*/
|
24
|
+
amountPerCoin: number;
|
25
|
+
/**
|
26
|
+
* Messages that are supposed to be on the wallet.
|
27
|
+
* The `recipient` field of the message is overriden to be the wallet's address.
|
28
|
+
*/
|
29
|
+
messages: TestMessage[];
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Used for configuring the wallets that should exist in the genesis block of a test node.
|
33
|
+
*/
|
34
|
+
export declare class WalletConfig {
|
35
|
+
private initialState;
|
36
|
+
private options;
|
37
|
+
wallets: WalletUnlocked[];
|
38
|
+
private generateWallets;
|
39
|
+
constructor(config: WalletConfigOptions);
|
40
|
+
apply(chainConfig: PartialDeep<ChainConfig> | undefined): PartialDeep<ChainConfig> & {
|
41
|
+
initial_state: {
|
42
|
+
coins: ChainConfig['initial_state']['coins'];
|
43
|
+
};
|
44
|
+
};
|
45
|
+
private static createMessages;
|
46
|
+
private static createCoins;
|
47
|
+
private static guard;
|
48
|
+
}
|
49
|
+
//# sourceMappingURL=wallet-config.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-config.d.ts","sourceRoot":"","sources":["../../src/test-utils/wallet-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,OAAO,CAAsB;IAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;IACjC,OAAO,CAAC,eAAe,CAMrB;gBAEU,MAAM,EAAE,mBAAmB;IAavC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,SAAS,GAAG,WAAW,CAAC,WAAW,CAAC,GAAG;QACnF,aAAa,EAAE;YAAE,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAA;SAAE,CAAC;KACjE;IAWD,OAAO,CAAC,MAAM,CAAC,cAAc;IAM7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAkC1B,OAAO,CAAC,MAAM,CAAC,KAAK;CAqCrB"}
|