@argonprotocol/testing 1.4.3-dev.fbc5662c → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.cts CHANGED
@@ -1,6 +1,29 @@
1
- import { KeyringPair, ArgonClient } from '@argonprotocol/mainchain';
1
+ import * as _argonprotocol_mainchain from '@argonprotocol/mainchain';
2
+ import { KeyringPair, ArgonClient, EthereumReceipt, EthereumBeaconHeaderDetailsResponse, EthereumBeaconBlockResponse, EvmContracts, IArgonQueryable } from '@argonprotocol/mainchain';
2
3
  import { Client } from 'pg';
3
- import { Hex, Abi } from 'viem';
4
+ import * as viem from 'viem';
5
+ import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs } from 'viem';
6
+ import { privateKeyToAccount } from 'viem/accounts';
7
+ import * as _polkadot_types_codec from '@polkadot/types-codec';
8
+
9
+ interface ITeardownable {
10
+ teardown(): Promise<void>;
11
+ }
12
+ declare const SKIP_E2E: boolean;
13
+ declare function getProxy(): Promise<string>;
14
+ declare function projectRoot(): string;
15
+ declare function runTestScript(relativePath: string): Promise<string>;
16
+ declare function getDockerPortMapping(containerName: string, port: number): Promise<string | undefined>;
17
+ declare function teardown(): Promise<void>;
18
+ declare function cleanHostForDocker(host: string, replacer?: string): string;
19
+ declare function addTeardown(teardownable: ITeardownable): void;
20
+ declare function runOnTeardown(teardown: () => Promise<void>): void;
21
+ declare function closeOnTeardown<T extends {
22
+ close(): Promise<void>;
23
+ }>(closeable: T): T;
24
+ declare function disconnectOnTeardown<T extends {
25
+ disconnect(): Promise<void>;
26
+ }>(closeable: T): T;
4
27
 
5
28
  declare class TestNotary implements ITeardownable {
6
29
  #private;
@@ -158,6 +181,7 @@ declare class TestEthereum implements ITeardownable {
158
181
  deployerPrivateKey: Hex;
159
182
  adminSafe?: Hex;
160
183
  guardianSafe?: Hex;
184
+ initialMicrogonsPerArgonot?: bigint;
161
185
  seedArgonRecipient?: Hex;
162
186
  seedArgonAmountBaseUnits?: bigint;
163
187
  }): Promise<EthereumMintingGatewayFixture>;
@@ -172,37 +196,234 @@ declare function startNetwork(testName: string, options?: {
172
196
  notaryUrl: string;
173
197
  }>;
174
198
 
175
- type EthereumContractArtifact = {
176
- abi: Abi;
177
- bytecode: Hex;
199
+ declare function signGatewayPermit(args: {
200
+ account: ReturnType<typeof privateKeyToAccount>;
201
+ chainId: number;
202
+ tokenAddress: Hex;
203
+ gatewayAddress: Hex;
204
+ owner: Hex;
205
+ value: bigint;
206
+ nonce: bigint;
207
+ deadline: bigint;
208
+ }): Promise<{
209
+ v: number;
210
+ r: `0x${string}`;
211
+ s: `0x${string}`;
212
+ }>;
213
+ declare function waitForFinalizedBeaconExecutionAtOrAbove(ethereum: TestEthereum, minimumExecutionBlockNumber: bigint, options?: {
214
+ minimumFinalizedSlot?: bigint;
215
+ }): Promise<{
216
+ header: EthereumBeaconHeaderDetailsResponse;
217
+ block: EthereumBeaconBlockResponse;
218
+ }>;
219
+ declare function mineLaterExecutionAnchorReceipt(walletClient: Pick<ReturnType<typeof createWalletClient>, 'sendTransaction'>, chain: ReturnType<typeof defineChain>, ethereum: TestEthereum, account: ReturnType<typeof privateKeyToAccount>, minimumBlockNumber: bigint): Promise<viem.TransactionReceipt>;
220
+ declare function waitForExecutionReceipt(ethereum: TestEthereum, transactionHash: Hex): Promise<EthereumReceipt>;
221
+ declare function syncEthereumVerifierUntilAnchorCovers(mainchainClient: ArgonClient, relayer: KeyringPair, beaconApiUrl: string, minimumExecutionBlockNumber: bigint): Promise<void>;
222
+ declare function toArgonKeccakSignature(signature: Hex): Hex;
223
+ declare function toEvmRecoverableSignature(signature: Hex): Hex;
224
+
225
+ type ApplyGatewayUpdatesArgs = ContractFunctionArgs<typeof EvmContracts.mintingGatewayAbi, 'nonpayable', 'applyGatewayUpdates'>;
226
+ type MintingGatewayCouncilSnapshot = ApplyGatewayUpdatesArgs[0];
227
+ type MintingGatewayGatewayUpdate = ApplyGatewayUpdatesArgs[1][number];
228
+ type EthereumGatewayUpdateBatch = {
229
+ destinationChain: 'Ethereum';
230
+ chainId: bigint;
231
+ gatewayAddress: Address;
232
+ currentCouncilHash: Hex;
233
+ currentCouncil: MintingGatewayCouncilSnapshot;
234
+ argonApprovalsNonce: bigint;
235
+ argonApprovalsHash: Hex;
236
+ paused: boolean;
237
+ pendingClearOutQueueNonces: bigint[];
238
+ firstQueueNonce?: bigint;
239
+ lastQueueNonce?: bigint;
240
+ updates: MintingGatewayGatewayUpdate[];
178
241
  };
179
- declare const argonTokenArtifact: EthereumContractArtifact;
180
- declare const mintingGatewayArtifact: EthereumContractArtifact;
242
+ declare function getReadyEthereumGatewayUpdates(client: IArgonQueryable, gatewayClient: {
243
+ readContract: (...args: any[]) => Promise<unknown>;
244
+ }, options?: {
245
+ destinationChain?: 'Ethereum';
246
+ maxQueueEntries?: number;
247
+ }): Promise<EthereumGatewayUpdateBatch>;
181
248
 
182
- interface ITeardownable {
183
- teardown(): Promise<void>;
249
+ type DeployerAccount = ReturnType<typeof privateKeyToAccount>;
250
+ type EthereumChain = ReturnType<typeof defineChain>;
251
+ type EthereumPublicClient = {
252
+ getBalance: (args: {
253
+ address: Hex;
254
+ }) => Promise<bigint>;
255
+ getBlock: (...args: any[]) => Promise<any>;
256
+ getBlockNumber: () => Promise<bigint>;
257
+ readContract: (...args: any[]) => Promise<unknown>;
258
+ waitForTransactionReceipt: (args: {
259
+ hash: Hex;
260
+ }) => Promise<{
261
+ status: string;
262
+ blockNumber: bigint;
263
+ }>;
264
+ };
265
+ type EthereumWalletClient = {
266
+ sendTransaction: (...args: any[]) => Promise<Hex>;
267
+ writeContract: (...args: any[]) => Promise<Hex>;
268
+ };
269
+ type GatewayDeployment = Awaited<ReturnType<TestEthereum['deployMintingGatewayFixture']>>;
270
+ type RuntimeSetupMode = {
271
+ kind: 'inbound-only';
272
+ } | {
273
+ kind: 'outbound';
274
+ activationPricing: {
275
+ activationGasCost: bigint | number;
276
+ signatureGasCost: bigint | number;
277
+ estimatedWeiPerGas: bigint | number;
278
+ estimatedMicrogonsPerEth: bigint | number;
279
+ };
280
+ minimumMintingAuthorityValue?: bigint;
281
+ };
282
+ declare class EthereumProofE2eHarness {
283
+ readonly ethereum: TestEthereum;
284
+ readonly endpoints: Awaited<ReturnType<TestEthereum['launch']>>;
285
+ readonly mainchain: TestMainchain;
286
+ readonly sudoSigner: KeyringPair;
287
+ readonly deployer: DeployerAccount;
288
+ readonly chain: EthereumChain;
289
+ readonly publicClient: EthereumPublicClient;
290
+ readonly walletClient: EthereumWalletClient;
291
+ readonly mainchainClient: ArgonClient;
292
+ readonly proofRelayer: KeyringPair;
293
+ private constructor();
294
+ static launch(args: {
295
+ testAccount: {
296
+ address: Hex;
297
+ balance: string;
298
+ privateKey: Hex;
299
+ };
300
+ proofRelayerUri: string;
301
+ }): Promise<EthereumProofE2eHarness>;
302
+ submit(tx: unknown, signer: KeyringPair): Promise<_argonprotocol_mainchain.TxResult>;
303
+ sudoSubmit(tx: unknown): Promise<_argonprotocol_mainchain.TxResult>;
304
+ syncVerifierThrough(minimumExecutionBlockNumber: bigint): Promise<void>;
305
+ proveGatewayActivity(gatewayAddress: Hex, throughExecutionBlockNumber: bigint): Promise<{
306
+ payload: _argonprotocol_mainchain.EthereumGatewayActivityProofPayload;
307
+ result: _argonprotocol_mainchain.TxResult;
308
+ }>;
309
+ configureEthereumRuntime(gateway: TestMintingGateway, mode: RuntimeSetupMode): Promise<{
310
+ result: _argonprotocol_mainchain.TxResult;
311
+ }>;
312
+ fundBurnAccount(amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
313
+ fundProofRelayer(amount?: bigint): Promise<_argonprotocol_mainchain.TxResult>;
314
+ forceSetBalance(address: string, amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
315
+ forceSetOwnership(address: string, amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
316
+ waitForExecutionFinalizedAfter(minimumExecutionBlockNumber: bigint): Promise<viem.TransactionReceipt>;
184
317
  }
185
- declare const SKIP_E2E: boolean;
186
- declare function getProxy(): Promise<string>;
318
+ declare class TestMintingGateway {
319
+ readonly harness: EthereumProofE2eHarness;
320
+ readonly deployment: GatewayDeployment;
321
+ private constructor();
322
+ static deploy(harness: EthereumProofE2eHarness, options: Parameters<TestEthereum['deployMintingGatewayFixture']>[0]): Promise<TestMintingGateway>;
323
+ get gatewayAddress(): `0x${string}`;
324
+ get argonTokenAddress(): `0x${string}`;
325
+ get argonotTokenAddress(): `0x${string}`;
326
+ startTransferToArgon(args: {
327
+ account: DeployerAccount;
328
+ amountRuntimeUnits: bigint;
329
+ recipientArgonAddress: Hex;
330
+ }): Promise<viem.TransactionReceipt>;
331
+ forceUpdateActiveCouncil(replacementCouncil: {
332
+ signers: Hex[];
333
+ weights: bigint[];
334
+ }, nextMicrogonsPerArgonot: bigint): Promise<{
335
+ status: string;
336
+ blockNumber: bigint;
337
+ }>;
338
+ relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<{
339
+ status: string;
340
+ blockNumber: bigint;
341
+ }>;
342
+ argonApprovalsNonce(): Promise<bigint>;
343
+ globalIssuanceCouncil(): Promise<[Hex[], bigint[], Hex]>;
344
+ authorityCollateral(signingKey: Hex): Promise<[bigint, bigint]>;
345
+ finalizeTransferOut(args: {
346
+ transferRequest: {
347
+ argonAccountId: Hex;
348
+ argonTransferNonce: bigint;
349
+ chainId: bigint;
350
+ microgonsPerArgonot: bigint;
351
+ recipient: Hex;
352
+ validUntilBlock: bigint;
353
+ token: Hex;
354
+ amount: bigint;
355
+ mintingAuthorityTip: bigint;
356
+ };
357
+ collateralizationSignature: Hex;
358
+ micronotCollateral: bigint;
359
+ }): Promise<{
360
+ status: string;
361
+ blockNumber: bigint;
362
+ }>;
363
+ isFinalizedTransferOut(transferRequest: Parameters<typeof EvmContracts.hashMintingGatewayTransferOutOfArgonRequest>[0]): Promise<boolean>;
364
+ argonBalance(address: Hex): Promise<bigint>;
365
+ fundExecutionAccount(address: Hex, value: bigint): Promise<{
366
+ status: string;
367
+ blockNumber: bigint;
368
+ }>;
369
+ }
370
+ declare class TestMintingAuthorityActor {
371
+ readonly harness: EthereumProofE2eHarness;
372
+ readonly operator: KeyringPair;
373
+ readonly councilSigner: DeployerAccount;
374
+ readonly authoritySigner: DeployerAccount;
375
+ private gateway?;
376
+ constructor(harness: EthereumProofE2eHarness, args: {
377
+ operatorUri: string;
378
+ councilPrivateKey: Hex;
379
+ authorityPrivateKey: Hex;
380
+ });
381
+ attachGateway(gateway: TestMintingGateway): void;
382
+ prepareOperator(args: {
383
+ freeBalance: bigint;
384
+ ownershipBalance: bigint;
385
+ committedArgonots: bigint;
386
+ bitcoinXpub: string;
387
+ }): Promise<void>;
388
+ registerCouncilSigner(): Promise<_argonprotocol_mainchain.TxResult>;
389
+ forceSingleMemberCouncil(): Promise<{
390
+ activeCouncilHash: `0x${string}`;
391
+ activeCouncil: _argonprotocol_mainchain.PalletCrosschainTransferGlobalIssuanceCouncil;
392
+ currentCouncil: {
393
+ signers: `0x${string}`[];
394
+ weights: bigint[];
395
+ };
396
+ }>;
397
+ registerMintingAuthority(micronotCollateral: bigint): Promise<_argonprotocol_mainchain.TxResult>;
398
+ approveActivationQueueEntry(queueNonce?: bigint): Promise<{
399
+ approvalQueueEntry: _polkadot_types_codec.Option<_argonprotocol_mainchain.PalletCrosschainTransferCouncilApprovalQueueEntry>;
400
+ councilApprovalSignature: `0x${string}`;
401
+ batch: EthereumGatewayUpdateBatch;
402
+ }>;
403
+ collateralizeFirstPendingTransferOut(): Promise<{
404
+ pendingRequest: _argonprotocol_mainchain.PalletCrosschainTransferTransferOutPendingCollateralizationRequest;
405
+ transferId: `0x${string}`;
406
+ transferRequest: {
407
+ argonAccountId: `0x${string}`;
408
+ argonTransferNonce: bigint;
409
+ chainId: bigint;
410
+ microgonsPerArgonot: bigint;
411
+ recipient: `0x${string}`;
412
+ validUntilBlock: bigint;
413
+ token: `0x${string}`;
414
+ amount: bigint;
415
+ mintingAuthorityTip: bigint;
416
+ };
417
+ micronotCollateral: bigint;
418
+ collateralizationSignature: `0x${string}`;
419
+ result: _argonprotocol_mainchain.TxResult;
420
+ }>;
421
+ private registrationMessage;
422
+ private requireGateway;
423
+ }
424
+
187
425
  declare function stringifyExt(obj: any): any;
188
- declare function projectRoot(): string;
189
- /**
190
- * Run a script from the project "scripts" folder
191
- * @param relativePath
192
- */
193
- declare function runTestScript(relativePath: string): Promise<string>;
194
- declare function getDockerPortMapping(containerName: string, port: number): Promise<string | undefined>;
195
- declare function teardown(): Promise<void>;
196
- declare function cleanHostForDocker(host: string, replacer?: string): string;
197
- declare function addTeardown(teardownable: ITeardownable): void;
198
- declare function runOnTeardown(teardown: () => Promise<void>): void;
199
- declare function closeOnTeardown<T extends {
200
- close(): Promise<void>;
201
- }>(closeable: T): T;
202
- declare function disconnectOnTeardown<T extends {
203
- disconnect(): Promise<void>;
204
- }>(closeable: T): T;
205
426
  declare function sudo(): KeyringPair;
206
427
  declare function activateNotary(sudo: KeyringPair, client: ArgonClient, notary: TestNotary): Promise<void>;
207
428
 
208
- export { type ITeardownable, SKIP_E2E, TestBitcoinCli, TestEthereum, TestMainchain, TestNotary, TestOracle, activateNotary, addTeardown, argonTokenArtifact, cleanHostForDocker, closeOnTeardown, disconnectOnTeardown, getDockerPortMapping, getProxy, mintingGatewayArtifact, projectRoot, runOnTeardown, runTestScript, startNetwork, stringifyExt, sudo, teardown };
429
+ export { type EthereumGatewayUpdateBatch, EthereumProofE2eHarness, type ITeardownable, SKIP_E2E, TestBitcoinCli, TestEthereum, TestMainchain, TestMintingAuthorityActor, TestMintingGateway, TestNotary, TestOracle, activateNotary, addTeardown, cleanHostForDocker, closeOnTeardown, disconnectOnTeardown, getDockerPortMapping, getProxy, getReadyEthereumGatewayUpdates, mineLaterExecutionAnchorReceipt, projectRoot, runOnTeardown, runTestScript, signGatewayPermit, startNetwork, stringifyExt, sudo, syncEthereumVerifierUntilAnchorCovers, teardown, toArgonKeccakSignature, toEvmRecoverableSignature, waitForExecutionReceipt, waitForFinalizedBeaconExecutionAtOrAbove };
package/lib/index.d.ts CHANGED
@@ -1,6 +1,29 @@
1
- import { KeyringPair, ArgonClient } from '@argonprotocol/mainchain';
1
+ import * as _argonprotocol_mainchain from '@argonprotocol/mainchain';
2
+ import { KeyringPair, ArgonClient, EthereumReceipt, EthereumBeaconHeaderDetailsResponse, EthereumBeaconBlockResponse, EvmContracts, IArgonQueryable } from '@argonprotocol/mainchain';
2
3
  import { Client } from 'pg';
3
- import { Hex, Abi } from 'viem';
4
+ import * as viem from 'viem';
5
+ import { Hex, createWalletClient, defineChain, Address, ContractFunctionArgs } from 'viem';
6
+ import { privateKeyToAccount } from 'viem/accounts';
7
+ import * as _polkadot_types_codec from '@polkadot/types-codec';
8
+
9
+ interface ITeardownable {
10
+ teardown(): Promise<void>;
11
+ }
12
+ declare const SKIP_E2E: boolean;
13
+ declare function getProxy(): Promise<string>;
14
+ declare function projectRoot(): string;
15
+ declare function runTestScript(relativePath: string): Promise<string>;
16
+ declare function getDockerPortMapping(containerName: string, port: number): Promise<string | undefined>;
17
+ declare function teardown(): Promise<void>;
18
+ declare function cleanHostForDocker(host: string, replacer?: string): string;
19
+ declare function addTeardown(teardownable: ITeardownable): void;
20
+ declare function runOnTeardown(teardown: () => Promise<void>): void;
21
+ declare function closeOnTeardown<T extends {
22
+ close(): Promise<void>;
23
+ }>(closeable: T): T;
24
+ declare function disconnectOnTeardown<T extends {
25
+ disconnect(): Promise<void>;
26
+ }>(closeable: T): T;
4
27
 
5
28
  declare class TestNotary implements ITeardownable {
6
29
  #private;
@@ -158,6 +181,7 @@ declare class TestEthereum implements ITeardownable {
158
181
  deployerPrivateKey: Hex;
159
182
  adminSafe?: Hex;
160
183
  guardianSafe?: Hex;
184
+ initialMicrogonsPerArgonot?: bigint;
161
185
  seedArgonRecipient?: Hex;
162
186
  seedArgonAmountBaseUnits?: bigint;
163
187
  }): Promise<EthereumMintingGatewayFixture>;
@@ -172,37 +196,234 @@ declare function startNetwork(testName: string, options?: {
172
196
  notaryUrl: string;
173
197
  }>;
174
198
 
175
- type EthereumContractArtifact = {
176
- abi: Abi;
177
- bytecode: Hex;
199
+ declare function signGatewayPermit(args: {
200
+ account: ReturnType<typeof privateKeyToAccount>;
201
+ chainId: number;
202
+ tokenAddress: Hex;
203
+ gatewayAddress: Hex;
204
+ owner: Hex;
205
+ value: bigint;
206
+ nonce: bigint;
207
+ deadline: bigint;
208
+ }): Promise<{
209
+ v: number;
210
+ r: `0x${string}`;
211
+ s: `0x${string}`;
212
+ }>;
213
+ declare function waitForFinalizedBeaconExecutionAtOrAbove(ethereum: TestEthereum, minimumExecutionBlockNumber: bigint, options?: {
214
+ minimumFinalizedSlot?: bigint;
215
+ }): Promise<{
216
+ header: EthereumBeaconHeaderDetailsResponse;
217
+ block: EthereumBeaconBlockResponse;
218
+ }>;
219
+ declare function mineLaterExecutionAnchorReceipt(walletClient: Pick<ReturnType<typeof createWalletClient>, 'sendTransaction'>, chain: ReturnType<typeof defineChain>, ethereum: TestEthereum, account: ReturnType<typeof privateKeyToAccount>, minimumBlockNumber: bigint): Promise<viem.TransactionReceipt>;
220
+ declare function waitForExecutionReceipt(ethereum: TestEthereum, transactionHash: Hex): Promise<EthereumReceipt>;
221
+ declare function syncEthereumVerifierUntilAnchorCovers(mainchainClient: ArgonClient, relayer: KeyringPair, beaconApiUrl: string, minimumExecutionBlockNumber: bigint): Promise<void>;
222
+ declare function toArgonKeccakSignature(signature: Hex): Hex;
223
+ declare function toEvmRecoverableSignature(signature: Hex): Hex;
224
+
225
+ type ApplyGatewayUpdatesArgs = ContractFunctionArgs<typeof EvmContracts.mintingGatewayAbi, 'nonpayable', 'applyGatewayUpdates'>;
226
+ type MintingGatewayCouncilSnapshot = ApplyGatewayUpdatesArgs[0];
227
+ type MintingGatewayGatewayUpdate = ApplyGatewayUpdatesArgs[1][number];
228
+ type EthereumGatewayUpdateBatch = {
229
+ destinationChain: 'Ethereum';
230
+ chainId: bigint;
231
+ gatewayAddress: Address;
232
+ currentCouncilHash: Hex;
233
+ currentCouncil: MintingGatewayCouncilSnapshot;
234
+ argonApprovalsNonce: bigint;
235
+ argonApprovalsHash: Hex;
236
+ paused: boolean;
237
+ pendingClearOutQueueNonces: bigint[];
238
+ firstQueueNonce?: bigint;
239
+ lastQueueNonce?: bigint;
240
+ updates: MintingGatewayGatewayUpdate[];
178
241
  };
179
- declare const argonTokenArtifact: EthereumContractArtifact;
180
- declare const mintingGatewayArtifact: EthereumContractArtifact;
242
+ declare function getReadyEthereumGatewayUpdates(client: IArgonQueryable, gatewayClient: {
243
+ readContract: (...args: any[]) => Promise<unknown>;
244
+ }, options?: {
245
+ destinationChain?: 'Ethereum';
246
+ maxQueueEntries?: number;
247
+ }): Promise<EthereumGatewayUpdateBatch>;
181
248
 
182
- interface ITeardownable {
183
- teardown(): Promise<void>;
249
+ type DeployerAccount = ReturnType<typeof privateKeyToAccount>;
250
+ type EthereumChain = ReturnType<typeof defineChain>;
251
+ type EthereumPublicClient = {
252
+ getBalance: (args: {
253
+ address: Hex;
254
+ }) => Promise<bigint>;
255
+ getBlock: (...args: any[]) => Promise<any>;
256
+ getBlockNumber: () => Promise<bigint>;
257
+ readContract: (...args: any[]) => Promise<unknown>;
258
+ waitForTransactionReceipt: (args: {
259
+ hash: Hex;
260
+ }) => Promise<{
261
+ status: string;
262
+ blockNumber: bigint;
263
+ }>;
264
+ };
265
+ type EthereumWalletClient = {
266
+ sendTransaction: (...args: any[]) => Promise<Hex>;
267
+ writeContract: (...args: any[]) => Promise<Hex>;
268
+ };
269
+ type GatewayDeployment = Awaited<ReturnType<TestEthereum['deployMintingGatewayFixture']>>;
270
+ type RuntimeSetupMode = {
271
+ kind: 'inbound-only';
272
+ } | {
273
+ kind: 'outbound';
274
+ activationPricing: {
275
+ activationGasCost: bigint | number;
276
+ signatureGasCost: bigint | number;
277
+ estimatedWeiPerGas: bigint | number;
278
+ estimatedMicrogonsPerEth: bigint | number;
279
+ };
280
+ minimumMintingAuthorityValue?: bigint;
281
+ };
282
+ declare class EthereumProofE2eHarness {
283
+ readonly ethereum: TestEthereum;
284
+ readonly endpoints: Awaited<ReturnType<TestEthereum['launch']>>;
285
+ readonly mainchain: TestMainchain;
286
+ readonly sudoSigner: KeyringPair;
287
+ readonly deployer: DeployerAccount;
288
+ readonly chain: EthereumChain;
289
+ readonly publicClient: EthereumPublicClient;
290
+ readonly walletClient: EthereumWalletClient;
291
+ readonly mainchainClient: ArgonClient;
292
+ readonly proofRelayer: KeyringPair;
293
+ private constructor();
294
+ static launch(args: {
295
+ testAccount: {
296
+ address: Hex;
297
+ balance: string;
298
+ privateKey: Hex;
299
+ };
300
+ proofRelayerUri: string;
301
+ }): Promise<EthereumProofE2eHarness>;
302
+ submit(tx: unknown, signer: KeyringPair): Promise<_argonprotocol_mainchain.TxResult>;
303
+ sudoSubmit(tx: unknown): Promise<_argonprotocol_mainchain.TxResult>;
304
+ syncVerifierThrough(minimumExecutionBlockNumber: bigint): Promise<void>;
305
+ proveGatewayActivity(gatewayAddress: Hex, throughExecutionBlockNumber: bigint): Promise<{
306
+ payload: _argonprotocol_mainchain.EthereumGatewayActivityProofPayload;
307
+ result: _argonprotocol_mainchain.TxResult;
308
+ }>;
309
+ configureEthereumRuntime(gateway: TestMintingGateway, mode: RuntimeSetupMode): Promise<{
310
+ result: _argonprotocol_mainchain.TxResult;
311
+ }>;
312
+ fundBurnAccount(amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
313
+ fundProofRelayer(amount?: bigint): Promise<_argonprotocol_mainchain.TxResult>;
314
+ forceSetBalance(address: string, amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
315
+ forceSetOwnership(address: string, amount: bigint): Promise<_argonprotocol_mainchain.TxResult>;
316
+ waitForExecutionFinalizedAfter(minimumExecutionBlockNumber: bigint): Promise<viem.TransactionReceipt>;
184
317
  }
185
- declare const SKIP_E2E: boolean;
186
- declare function getProxy(): Promise<string>;
318
+ declare class TestMintingGateway {
319
+ readonly harness: EthereumProofE2eHarness;
320
+ readonly deployment: GatewayDeployment;
321
+ private constructor();
322
+ static deploy(harness: EthereumProofE2eHarness, options: Parameters<TestEthereum['deployMintingGatewayFixture']>[0]): Promise<TestMintingGateway>;
323
+ get gatewayAddress(): `0x${string}`;
324
+ get argonTokenAddress(): `0x${string}`;
325
+ get argonotTokenAddress(): `0x${string}`;
326
+ startTransferToArgon(args: {
327
+ account: DeployerAccount;
328
+ amountRuntimeUnits: bigint;
329
+ recipientArgonAddress: Hex;
330
+ }): Promise<viem.TransactionReceipt>;
331
+ forceUpdateActiveCouncil(replacementCouncil: {
332
+ signers: Hex[];
333
+ weights: bigint[];
334
+ }, nextMicrogonsPerArgonot: bigint): Promise<{
335
+ status: string;
336
+ blockNumber: bigint;
337
+ }>;
338
+ relayReadyApprovals(batch: Awaited<ReturnType<typeof getReadyEthereumGatewayUpdates>>, operatorAddress: string): Promise<{
339
+ status: string;
340
+ blockNumber: bigint;
341
+ }>;
342
+ argonApprovalsNonce(): Promise<bigint>;
343
+ globalIssuanceCouncil(): Promise<[Hex[], bigint[], Hex]>;
344
+ authorityCollateral(signingKey: Hex): Promise<[bigint, bigint]>;
345
+ finalizeTransferOut(args: {
346
+ transferRequest: {
347
+ argonAccountId: Hex;
348
+ argonTransferNonce: bigint;
349
+ chainId: bigint;
350
+ microgonsPerArgonot: bigint;
351
+ recipient: Hex;
352
+ validUntilBlock: bigint;
353
+ token: Hex;
354
+ amount: bigint;
355
+ mintingAuthorityTip: bigint;
356
+ };
357
+ collateralizationSignature: Hex;
358
+ micronotCollateral: bigint;
359
+ }): Promise<{
360
+ status: string;
361
+ blockNumber: bigint;
362
+ }>;
363
+ isFinalizedTransferOut(transferRequest: Parameters<typeof EvmContracts.hashMintingGatewayTransferOutOfArgonRequest>[0]): Promise<boolean>;
364
+ argonBalance(address: Hex): Promise<bigint>;
365
+ fundExecutionAccount(address: Hex, value: bigint): Promise<{
366
+ status: string;
367
+ blockNumber: bigint;
368
+ }>;
369
+ }
370
+ declare class TestMintingAuthorityActor {
371
+ readonly harness: EthereumProofE2eHarness;
372
+ readonly operator: KeyringPair;
373
+ readonly councilSigner: DeployerAccount;
374
+ readonly authoritySigner: DeployerAccount;
375
+ private gateway?;
376
+ constructor(harness: EthereumProofE2eHarness, args: {
377
+ operatorUri: string;
378
+ councilPrivateKey: Hex;
379
+ authorityPrivateKey: Hex;
380
+ });
381
+ attachGateway(gateway: TestMintingGateway): void;
382
+ prepareOperator(args: {
383
+ freeBalance: bigint;
384
+ ownershipBalance: bigint;
385
+ committedArgonots: bigint;
386
+ bitcoinXpub: string;
387
+ }): Promise<void>;
388
+ registerCouncilSigner(): Promise<_argonprotocol_mainchain.TxResult>;
389
+ forceSingleMemberCouncil(): Promise<{
390
+ activeCouncilHash: `0x${string}`;
391
+ activeCouncil: _argonprotocol_mainchain.PalletCrosschainTransferGlobalIssuanceCouncil;
392
+ currentCouncil: {
393
+ signers: `0x${string}`[];
394
+ weights: bigint[];
395
+ };
396
+ }>;
397
+ registerMintingAuthority(micronotCollateral: bigint): Promise<_argonprotocol_mainchain.TxResult>;
398
+ approveActivationQueueEntry(queueNonce?: bigint): Promise<{
399
+ approvalQueueEntry: _polkadot_types_codec.Option<_argonprotocol_mainchain.PalletCrosschainTransferCouncilApprovalQueueEntry>;
400
+ councilApprovalSignature: `0x${string}`;
401
+ batch: EthereumGatewayUpdateBatch;
402
+ }>;
403
+ collateralizeFirstPendingTransferOut(): Promise<{
404
+ pendingRequest: _argonprotocol_mainchain.PalletCrosschainTransferTransferOutPendingCollateralizationRequest;
405
+ transferId: `0x${string}`;
406
+ transferRequest: {
407
+ argonAccountId: `0x${string}`;
408
+ argonTransferNonce: bigint;
409
+ chainId: bigint;
410
+ microgonsPerArgonot: bigint;
411
+ recipient: `0x${string}`;
412
+ validUntilBlock: bigint;
413
+ token: `0x${string}`;
414
+ amount: bigint;
415
+ mintingAuthorityTip: bigint;
416
+ };
417
+ micronotCollateral: bigint;
418
+ collateralizationSignature: `0x${string}`;
419
+ result: _argonprotocol_mainchain.TxResult;
420
+ }>;
421
+ private registrationMessage;
422
+ private requireGateway;
423
+ }
424
+
187
425
  declare function stringifyExt(obj: any): any;
188
- declare function projectRoot(): string;
189
- /**
190
- * Run a script from the project "scripts" folder
191
- * @param relativePath
192
- */
193
- declare function runTestScript(relativePath: string): Promise<string>;
194
- declare function getDockerPortMapping(containerName: string, port: number): Promise<string | undefined>;
195
- declare function teardown(): Promise<void>;
196
- declare function cleanHostForDocker(host: string, replacer?: string): string;
197
- declare function addTeardown(teardownable: ITeardownable): void;
198
- declare function runOnTeardown(teardown: () => Promise<void>): void;
199
- declare function closeOnTeardown<T extends {
200
- close(): Promise<void>;
201
- }>(closeable: T): T;
202
- declare function disconnectOnTeardown<T extends {
203
- disconnect(): Promise<void>;
204
- }>(closeable: T): T;
205
426
  declare function sudo(): KeyringPair;
206
427
  declare function activateNotary(sudo: KeyringPair, client: ArgonClient, notary: TestNotary): Promise<void>;
207
428
 
208
- export { type ITeardownable, SKIP_E2E, TestBitcoinCli, TestEthereum, TestMainchain, TestNotary, TestOracle, activateNotary, addTeardown, argonTokenArtifact, cleanHostForDocker, closeOnTeardown, disconnectOnTeardown, getDockerPortMapping, getProxy, mintingGatewayArtifact, projectRoot, runOnTeardown, runTestScript, startNetwork, stringifyExt, sudo, teardown };
429
+ export { type EthereumGatewayUpdateBatch, EthereumProofE2eHarness, type ITeardownable, SKIP_E2E, TestBitcoinCli, TestEthereum, TestMainchain, TestMintingAuthorityActor, TestMintingGateway, TestNotary, TestOracle, activateNotary, addTeardown, cleanHostForDocker, closeOnTeardown, disconnectOnTeardown, getDockerPortMapping, getProxy, getReadyEthereumGatewayUpdates, mineLaterExecutionAnchorReceipt, projectRoot, runOnTeardown, runTestScript, signGatewayPermit, startNetwork, stringifyExt, sudo, syncEthereumVerifierUntilAnchorCovers, teardown, toArgonKeccakSignature, toEvmRecoverableSignature, waitForExecutionReceipt, waitForFinalizedBeaconExecutionAtOrAbove };