@aztec/cli 6.0.0-nightly.20260826 → 6.0.0-nightly.20260828
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/dest/cmds/l1/index.d.ts +1 -1
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +1 -5
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +0 -4
- package/package.json +23 -23
- package/src/cmds/l1/index.ts +0 -40
- package/src/cmds/misc/index.ts +0 -8
- package/dest/cmds/l1/bridge_erc20.d.ts +0 -4
- package/dest/cmds/l1/bridge_erc20.d.ts.map +0 -1
- package/dest/cmds/l1/bridge_erc20.js +0 -32
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +0 -3
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts.map +0 -1
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.js +0 -4
- package/src/cmds/l1/bridge_erc20.ts +0 -56
- package/src/cmds/misc/get_canonical_sponsored_fpc_address.ts +0 -7
package/dest/cmds/l1/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { type Command } from 'commander';
|
|
3
3
|
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2wxL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUzRCxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQVUsTUFBTSxXQUFXLENBQUM7QUF1QmpELHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLFdBd2QvRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAuBjD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAwd/E"}
|
package/dest/cmds/l1/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { Option } from 'commander';
|
|
4
|
-
import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, nodeOption,
|
|
4
|
+
import { ETHEREUM_HOSTS, MNEMONIC, PRIVATE_KEY, l1ChainIdOption, nodeOption, parseBigint, parseEthereumAddress } from '../../utils/commands.js';
|
|
5
5
|
const l1RpcUrlsOption = new Option('--l1-rpc-urls <string>', 'List of Ethereum host URLs. Chain identifiers localhost and testnet can be used (comma separated)').env('ETHEREUM_HOSTS').default([
|
|
6
6
|
ETHEREUM_HOSTS
|
|
7
7
|
]).makeOptionMandatory(true).argParser((arg)=>arg.split(',').map((url)=>url.trim()));
|
|
@@ -179,10 +179,6 @@ export function injectCommands(program, log, debugLogger) {
|
|
|
179
179
|
debugLogger
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
program.command('bridge-erc20').description('Bridges ERC20 tokens to L2.').argument('<amount>', 'The amount of Fee Juice to mint and bridge.', parseBigint).argument('<recipient>', 'Aztec address of the recipient.', parseAztecAddress).addOption(l1RpcUrlsOption).option('-m, --mnemonic <string>', 'The mnemonic to use for deriving the Ethereum address that will mint and bridge', 'test test test test test test test test test test test junk').option('--mint', 'Mint the tokens on L1', false).option('--private', 'If the bridge should use the private flow', false).addOption(l1ChainIdOption).requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress).requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress).option('-f, --faucet <string>', 'The address of the faucet contract (only used if minting)', parseEthereumAddress).option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY).option('--json', 'Output the claim in JSON format').action(async (amount, recipient, options)=>{
|
|
183
|
-
const { bridgeERC20 } = await import('./bridge_erc20.js');
|
|
184
|
-
await bridgeERC20(amount, recipient, options.l1RpcUrls, options.l1ChainId, options.l1PrivateKey, options.mnemonic, options.token, options.faucet, options.portal, options.private, options.mint, options.json, log, debugLogger);
|
|
185
|
-
});
|
|
186
182
|
program.command('create-l1-account').option('--json', 'Output the account in JSON format').action(async (options)=>{
|
|
187
183
|
const { createL1Account } = await import('./create_l1_account.js');
|
|
188
184
|
createL1Account(options.json, log);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn } from '@aztec/foundation/log';
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
3
|
export declare function injectCommands(program: Command, log: LogFn): Command;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL21pc2MvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBSXpDLHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxXQTZEMUQifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,WA6D1D"}
|
package/dest/cmds/misc/index.js
CHANGED
|
@@ -23,10 +23,6 @@ export function injectCommands(program, log) {
|
|
|
23
23
|
const { printENR } = await import('@aztec/p2p/enr');
|
|
24
24
|
await printENR(enr, log);
|
|
25
25
|
});
|
|
26
|
-
program.command('get-canonical-sponsored-fpc-address').description('Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI').action(async ()=>{
|
|
27
|
-
const { getCanonicalSponsoredFPCAddress } = await import('./get_canonical_sponsored_fpc_address.js');
|
|
28
|
-
await getCanonicalSponsoredFPCAddress(log);
|
|
29
|
-
});
|
|
30
26
|
program.command('update').description('Updates Nodejs and Noir dependencies').argument('[projectPath]', 'Path to the project directory', process.cwd()).option('--contract [paths...]', 'Paths to contracts to update dependencies', []).option('--aztec-version <semver>', 'The version to update Aztec packages to. Defaults to latest', 'latest').action(async (projectPath, options)=>{
|
|
31
27
|
const { updateProject } = await import('./update.js');
|
|
32
28
|
const { contract, aztecVersion } = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli",
|
|
3
|
-
"version": "6.0.0-nightly.
|
|
3
|
+
"version": "6.0.0-nightly.20260828",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./devnet": "./dest/cmds/devnet/index.js",
|
|
@@ -76,19 +76,19 @@
|
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@aztec/accounts": "6.0.0-nightly.
|
|
80
|
-
"@aztec/archiver": "6.0.0-nightly.
|
|
81
|
-
"@aztec/aztec.js": "6.0.0-nightly.
|
|
82
|
-
"@aztec/constants": "6.0.0-nightly.
|
|
83
|
-
"@aztec/ethereum": "6.0.0-nightly.
|
|
84
|
-
"@aztec/foundation": "6.0.0-nightly.
|
|
85
|
-
"@aztec/l1-artifacts": "6.0.0-nightly.
|
|
86
|
-
"@aztec/node-keystore": "6.0.0-nightly.
|
|
87
|
-
"@aztec/p2p": "6.0.0-nightly.
|
|
88
|
-
"@aztec/protocol-contracts": "6.0.0-nightly.
|
|
89
|
-
"@aztec/stdlib": "6.0.0-nightly.
|
|
90
|
-
"@aztec/wallets": "6.0.0-nightly.
|
|
91
|
-
"@aztec/world-state": "6.0.0-nightly.
|
|
79
|
+
"@aztec/accounts": "6.0.0-nightly.20260828",
|
|
80
|
+
"@aztec/archiver": "6.0.0-nightly.20260828",
|
|
81
|
+
"@aztec/aztec.js": "6.0.0-nightly.20260828",
|
|
82
|
+
"@aztec/constants": "6.0.0-nightly.20260828",
|
|
83
|
+
"@aztec/ethereum": "6.0.0-nightly.20260828",
|
|
84
|
+
"@aztec/foundation": "6.0.0-nightly.20260828",
|
|
85
|
+
"@aztec/l1-artifacts": "6.0.0-nightly.20260826",
|
|
86
|
+
"@aztec/node-keystore": "6.0.0-nightly.20260828",
|
|
87
|
+
"@aztec/p2p": "6.0.0-nightly.20260828",
|
|
88
|
+
"@aztec/protocol-contracts": "6.0.0-nightly.20260828",
|
|
89
|
+
"@aztec/stdlib": "6.0.0-nightly.20260828",
|
|
90
|
+
"@aztec/wallets": "6.0.0-nightly.20260828",
|
|
91
|
+
"@aztec/world-state": "6.0.0-nightly.20260828",
|
|
92
92
|
"@ethersproject/wallet": "^5.8.0",
|
|
93
93
|
"@iarna/toml": "^2.2.5",
|
|
94
94
|
"@libp2p/peer-id-factory": "^3.0.4",
|
|
@@ -118,15 +118,15 @@
|
|
|
118
118
|
"typescript": "^5.3.3"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
|
-
"@aztec/accounts": "6.0.0-nightly.
|
|
122
|
-
"@aztec/bb-prover": "6.0.0-nightly.
|
|
123
|
-
"@aztec/ethereum": "6.0.0-nightly.
|
|
124
|
-
"@aztec/l1-artifacts": "6.0.0-nightly.
|
|
125
|
-
"@aztec/noir-contracts.js": "6.0.0-nightly.
|
|
126
|
-
"@aztec/noir-protocol-circuits-types": "6.0.0-nightly.
|
|
127
|
-
"@aztec/noir-test-contracts.js": "6.0.0-nightly.
|
|
128
|
-
"@aztec/protocol-contracts": "6.0.0-nightly.
|
|
129
|
-
"@aztec/stdlib": "6.0.0-nightly.
|
|
121
|
+
"@aztec/accounts": "6.0.0-nightly.20260828",
|
|
122
|
+
"@aztec/bb-prover": "6.0.0-nightly.20260828",
|
|
123
|
+
"@aztec/ethereum": "6.0.0-nightly.20260828",
|
|
124
|
+
"@aztec/l1-artifacts": "6.0.0-nightly.20260826",
|
|
125
|
+
"@aztec/noir-contracts.js": "6.0.0-nightly.20260828",
|
|
126
|
+
"@aztec/noir-protocol-circuits-types": "6.0.0-nightly.20260828",
|
|
127
|
+
"@aztec/noir-test-contracts.js": "6.0.0-nightly.20260828",
|
|
128
|
+
"@aztec/protocol-contracts": "6.0.0-nightly.20260828",
|
|
129
|
+
"@aztec/stdlib": "6.0.0-nightly.20260828"
|
|
130
130
|
},
|
|
131
131
|
"files": [
|
|
132
132
|
"dest",
|
package/src/cmds/l1/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
PRIVATE_KEY,
|
|
11
11
|
l1ChainIdOption,
|
|
12
12
|
nodeOption,
|
|
13
|
-
parseAztecAddress,
|
|
14
13
|
parseBigint,
|
|
15
14
|
parseEthereumAddress,
|
|
16
15
|
} from '../../utils/commands.js';
|
|
@@ -453,45 +452,6 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
|
|
|
453
452
|
});
|
|
454
453
|
});
|
|
455
454
|
|
|
456
|
-
program
|
|
457
|
-
.command('bridge-erc20')
|
|
458
|
-
.description('Bridges ERC20 tokens to L2.')
|
|
459
|
-
.argument('<amount>', 'The amount of Fee Juice to mint and bridge.', parseBigint)
|
|
460
|
-
.argument('<recipient>', 'Aztec address of the recipient.', parseAztecAddress)
|
|
461
|
-
.addOption(l1RpcUrlsOption)
|
|
462
|
-
.option(
|
|
463
|
-
'-m, --mnemonic <string>',
|
|
464
|
-
'The mnemonic to use for deriving the Ethereum address that will mint and bridge',
|
|
465
|
-
'test test test test test test test test test test test junk',
|
|
466
|
-
)
|
|
467
|
-
.option('--mint', 'Mint the tokens on L1', false)
|
|
468
|
-
.option('--private', 'If the bridge should use the private flow', false)
|
|
469
|
-
.addOption(l1ChainIdOption)
|
|
470
|
-
.requiredOption('-t, --token <string>', 'The address of the token to bridge', parseEthereumAddress)
|
|
471
|
-
.requiredOption('-p, --portal <string>', 'The address of the portal contract', parseEthereumAddress)
|
|
472
|
-
.option('-f, --faucet <string>', 'The address of the faucet contract (only used if minting)', parseEthereumAddress)
|
|
473
|
-
.option('--l1-private-key <string>', 'The private key to use for deployment', PRIVATE_KEY)
|
|
474
|
-
.option('--json', 'Output the claim in JSON format')
|
|
475
|
-
.action(async (amount, recipient, options) => {
|
|
476
|
-
const { bridgeERC20 } = await import('./bridge_erc20.js');
|
|
477
|
-
await bridgeERC20(
|
|
478
|
-
amount,
|
|
479
|
-
recipient,
|
|
480
|
-
options.l1RpcUrls,
|
|
481
|
-
options.l1ChainId,
|
|
482
|
-
options.l1PrivateKey,
|
|
483
|
-
options.mnemonic,
|
|
484
|
-
options.token,
|
|
485
|
-
options.faucet,
|
|
486
|
-
options.portal,
|
|
487
|
-
options.private,
|
|
488
|
-
options.mint,
|
|
489
|
-
options.json,
|
|
490
|
-
log,
|
|
491
|
-
debugLogger,
|
|
492
|
-
);
|
|
493
|
-
});
|
|
494
|
-
|
|
495
455
|
program
|
|
496
456
|
.command('create-l1-account')
|
|
497
457
|
.option('--json', 'Output the account in JSON format')
|
package/src/cmds/misc/index.ts
CHANGED
|
@@ -52,14 +52,6 @@ export function injectCommands(program: Command, log: LogFn) {
|
|
|
52
52
|
await printENR(enr, log);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
program
|
|
56
|
-
.command('get-canonical-sponsored-fpc-address')
|
|
57
|
-
.description('Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI')
|
|
58
|
-
.action(async () => {
|
|
59
|
-
const { getCanonicalSponsoredFPCAddress } = await import('./get_canonical_sponsored_fpc_address.js');
|
|
60
|
-
await getCanonicalSponsoredFPCAddress(log);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
55
|
program
|
|
64
56
|
.command('update')
|
|
65
57
|
.description('Updates Nodejs and Noir dependencies')
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
3
|
-
export declare function bridgeERC20(amount: bigint, recipient: AztecAddress, l1RpcUrls: string[], chainId: number, privateKey: string | undefined, mnemonic: string, tokenAddress: EthAddress, handlerAddress: EthAddress | undefined, portalAddress: EthAddress, privateTransfer: boolean, mint: boolean, json: boolean, log: LogFn, debugLogger: Logger): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJpZGdlX2VyYzIwLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY21kcy9sMS9icmlkZ2VfZXJjMjAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBSzFFLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUkzRCx3QkFBc0IsV0FBVyxDQUMvQixNQUFNLEVBQUUsTUFBTSxFQUNkLFNBQVMsRUFBRSxZQUFZLEVBQ3ZCLFNBQVMsRUFBRSxNQUFNLEVBQUUsRUFDbkIsT0FBTyxFQUFFLE1BQU0sRUFDZixVQUFVLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFDOUIsUUFBUSxFQUFFLE1BQU0sRUFDaEIsWUFBWSxFQUFFLFVBQVUsRUFDeEIsY0FBYyxFQUFFLFVBQVUsR0FBRyxTQUFTLEVBQ3RDLGFBQWEsRUFBRSxVQUFVLEVBQ3pCLGVBQWUsRUFBRSxPQUFPLEVBQ3hCLElBQUksRUFBRSxPQUFPLEVBQ2IsSUFBSSxFQUFFLE9BQU8sRUFDYixHQUFHLEVBQUUsS0FBSyxFQUNWLFdBQVcsRUFBRSxNQUFNLGlCQWdDcEIifQ==
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge_erc20.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/bridge_erc20.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,UAAU,EACxB,cAAc,EAAE,UAAU,GAAG,SAAS,EACtC,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,OAAO,EACxB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,iBAgCpB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { L1ToL2TokenPortalManager } from '@aztec/aztec.js/ethereum';
|
|
2
|
-
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
3
|
-
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
4
|
-
import { prettyPrintJSON } from '../../utils/commands.js';
|
|
5
|
-
export async function bridgeERC20(amount, recipient, l1RpcUrls, chainId, privateKey, mnemonic, tokenAddress, handlerAddress, portalAddress, privateTransfer, mint, json, log, debugLogger) {
|
|
6
|
-
// Prepare L1 client
|
|
7
|
-
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
8
|
-
const l1Client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
9
|
-
// Setup portal manager
|
|
10
|
-
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, l1Client, debugLogger);
|
|
11
|
-
let claimSecret;
|
|
12
|
-
let messageHash;
|
|
13
|
-
if (privateTransfer) {
|
|
14
|
-
({ claimSecret, messageHash } = await manager.bridgeTokensPrivate(recipient, amount, mint));
|
|
15
|
-
} else {
|
|
16
|
-
({ claimSecret, messageHash } = await manager.bridgeTokensPublic(recipient, amount, mint));
|
|
17
|
-
}
|
|
18
|
-
if (json) {
|
|
19
|
-
log(prettyPrintJSON({
|
|
20
|
-
claimAmount: amount,
|
|
21
|
-
claimSecret: claimSecret
|
|
22
|
-
}));
|
|
23
|
-
} else {
|
|
24
|
-
if (mint) {
|
|
25
|
-
log(`Minted ${amount} tokens on L1 and pushed to L2 portal`);
|
|
26
|
-
} else {
|
|
27
|
-
log(`Bridged ${amount} tokens to L2 portal`);
|
|
28
|
-
}
|
|
29
|
-
log(`claimAmount=${amount},claimSecret=${claimSecret}\n,messageHash=${messageHash}`);
|
|
30
|
-
log(`Note: You need to wait for two L2 blocks before pulling them from the L2 side`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
export declare function getCanonicalSponsoredFPCAddress(log: LogFn): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2Nhbm9uaWNhbF9zcG9uc29yZWRfZnBjX2FkZHJlc3MuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL21pc2MvZ2V0X2Nhbm9uaWNhbF9zcG9uc29yZWRfZnBjX2FkZHJlc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFJbkQsd0JBQXNCLCtCQUErQixDQUFDLEdBQUcsRUFBRSxLQUFLLGlCQUUvRCJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_canonical_sponsored_fpc_address.d.ts","sourceRoot":"","sources":["../../../src/cmds/misc/get_canonical_sponsored_fpc_address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,+BAA+B,CAAC,GAAG,EAAE,KAAK,iBAE/D"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { L1ToL2TokenPortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
|
-
import type { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
5
|
-
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
6
|
-
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
7
|
-
|
|
8
|
-
import { prettyPrintJSON } from '../../utils/commands.js';
|
|
9
|
-
|
|
10
|
-
export async function bridgeERC20(
|
|
11
|
-
amount: bigint,
|
|
12
|
-
recipient: AztecAddress,
|
|
13
|
-
l1RpcUrls: string[],
|
|
14
|
-
chainId: number,
|
|
15
|
-
privateKey: string | undefined,
|
|
16
|
-
mnemonic: string,
|
|
17
|
-
tokenAddress: EthAddress,
|
|
18
|
-
handlerAddress: EthAddress | undefined,
|
|
19
|
-
portalAddress: EthAddress,
|
|
20
|
-
privateTransfer: boolean,
|
|
21
|
-
mint: boolean,
|
|
22
|
-
json: boolean,
|
|
23
|
-
log: LogFn,
|
|
24
|
-
debugLogger: Logger,
|
|
25
|
-
) {
|
|
26
|
-
// Prepare L1 client
|
|
27
|
-
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
28
|
-
const l1Client = createExtendedL1Client(chain.rpcUrls, privateKey ?? mnemonic, chain.chainInfo);
|
|
29
|
-
|
|
30
|
-
// Setup portal manager
|
|
31
|
-
const manager = new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, l1Client, debugLogger);
|
|
32
|
-
let claimSecret: Fr;
|
|
33
|
-
let messageHash: `0x${string}`;
|
|
34
|
-
if (privateTransfer) {
|
|
35
|
-
({ claimSecret, messageHash } = await manager.bridgeTokensPrivate(recipient, amount, mint));
|
|
36
|
-
} else {
|
|
37
|
-
({ claimSecret, messageHash } = await manager.bridgeTokensPublic(recipient, amount, mint));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (json) {
|
|
41
|
-
log(
|
|
42
|
-
prettyPrintJSON({
|
|
43
|
-
claimAmount: amount,
|
|
44
|
-
claimSecret: claimSecret,
|
|
45
|
-
}),
|
|
46
|
-
);
|
|
47
|
-
} else {
|
|
48
|
-
if (mint) {
|
|
49
|
-
log(`Minted ${amount} tokens on L1 and pushed to L2 portal`);
|
|
50
|
-
} else {
|
|
51
|
-
log(`Bridged ${amount} tokens to L2 portal`);
|
|
52
|
-
}
|
|
53
|
-
log(`claimAmount=${amount},claimSecret=${claimSecret}\n,messageHash=${messageHash}`);
|
|
54
|
-
log(`Note: You need to wait for two L2 blocks before pulling them from the L2 side`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
-
|
|
3
|
-
import { getSponsoredFPCAddress } from '../../utils/setup_contracts.js';
|
|
4
|
-
|
|
5
|
-
export async function getCanonicalSponsoredFPCAddress(log: LogFn) {
|
|
6
|
-
log(`Canonical SponsoredFPC Address: ${(await getSponsoredFPCAddress()).toString()}`);
|
|
7
|
-
}
|