@aztec/cli-wallet 0.82.0 → 0.82.1-alpha-testnet.1
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/create_account.js +2 -2
- package/dest/cmds/deploy.d.ts.map +1 -1
- package/dest/cmds/deploy.js +1 -1
- package/dest/cmds/deploy_account.d.ts.map +1 -1
- package/dest/cmds/deploy_account.js +3 -3
- package/dest/utils/options/fees.d.ts.map +1 -1
- package/dest/utils/options/fees.js +2 -1
- package/dest/utils/options/options.d.ts +2 -2
- package/dest/utils/options/options.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/cmds/create_account.ts +2 -2
- package/src/cmds/deploy.ts +3 -3
- package/src/cmds/deploy_account.ts +3 -2
- package/src/utils/options/fees.ts +2 -1
- package/dest/utils/sponsored_fee_payment.d.ts +0 -11
- package/dest/utils/sponsored_fee_payment.d.ts.map +0 -1
- package/dest/utils/sponsored_fee_payment.js +0 -27
- package/src/utils/sponsored_fee_payment.ts +0 -34
|
@@ -5,7 +5,7 @@ import { printGasEstimates } from '../utils/options/fees.js';
|
|
|
5
5
|
export async function createAccount(client, accountType, secretKey, publicKey, alias, registerOnly, publicDeploy, skipInitialization, wait, feeOpts, json, debugLogger, log) {
|
|
6
6
|
secretKey ??= Fr.random();
|
|
7
7
|
const account = await createOrRetrieveAccount(client, undefined /* address, we don't have it yet */ , undefined /* db, as we want to create from scratch */ , secretKey, accountType, Fr.ZERO, publicKey);
|
|
8
|
-
const salt = account.getInstance()
|
|
8
|
+
const { salt } = account.getInstance();
|
|
9
9
|
const { address, publicKeys, partialAddress } = await account.getCompleteAddress();
|
|
10
10
|
const out = {};
|
|
11
11
|
if (json) {
|
|
@@ -43,7 +43,7 @@ export async function createAccount(client, accountType, secretKey, publicKey, a
|
|
|
43
43
|
...await feeOpts.toDeployAccountOpts(wallet)
|
|
44
44
|
};
|
|
45
45
|
if (feeOpts.estimateOnly) {
|
|
46
|
-
const gas = await
|
|
46
|
+
const gas = await account.estimateDeploymentGas(deployOpts);
|
|
47
47
|
if (json) {
|
|
48
48
|
out.fee = {
|
|
49
49
|
gasLimits: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAwC,EAAE,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,MAAM,CAC1B,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,OAAO,EAAE,GAAG,EAAE,EACd,IAAI,EAAE,EAAE,GAAG,SAAS,EACpB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,oBAAoB,EAAE,OAAO,EAC7B,qBAAqB,EAAE,OAAO,EAC9B,kBAAkB,EAAE,OAAO,GAAG,SAAS,EACvC,eAAe,EAAE,OAAO,GAAG,SAAS,EACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,+DAiF/B"}
|
package/dest/cmds/deploy.js
CHANGED
|
@@ -20,7 +20,7 @@ export async function deploy(client, wallet, artifactPath, json, publicKeys, raw
|
|
|
20
20
|
}
|
|
21
21
|
const deploy = deployer.deploy(...args);
|
|
22
22
|
const deployOpts = {
|
|
23
|
-
...await feeOpts.
|
|
23
|
+
...await feeOpts.toDeployAccountOpts(wallet),
|
|
24
24
|
contractAddressSalt: salt,
|
|
25
25
|
universalDeploy,
|
|
26
26
|
skipClassRegistration,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;
|
|
1
|
+
{"version":3,"file":"deploy_account.d.ts","sourceRoot":"","sources":["../../src/cmds/deploy_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,KAAK,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAE5E,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,KAAK;;;;GAgFX"}
|
|
@@ -27,11 +27,11 @@ export async function deployAccount(account, wait, feeOpts, json, debugLogger, l
|
|
|
27
27
|
let tx;
|
|
28
28
|
let txReceipt;
|
|
29
29
|
const deployOpts = {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
skipInitialization: false,
|
|
31
|
+
...await feeOpts.toDeployAccountOpts(wallet)
|
|
32
32
|
};
|
|
33
33
|
if (feeOpts.estimateOnly) {
|
|
34
|
-
const gas = await
|
|
34
|
+
const gas = await account.estimateDeploymentGas(deployOpts);
|
|
35
35
|
if (json) {
|
|
36
36
|
out.fee = {
|
|
37
37
|
gasLimits: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAO,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAO,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAI3D,MAAM,MAAM,UAAU,GAAG;IACvB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AAU;WAIJ,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,QAAQ;CAsB3E;AAED,qBAAa,mBAAoB,SAAQ,OAAO;WAC9B,mBAAmB;WAInB,UAAU;WAIJ,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,QAAQ;CA2BpF;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,OAAO,EAC5B,GAAG,EAAE,KAAK,EACV,EAAE,CAAC,EAAE,QAAQ,GACZ,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAiFtD;AAsBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAerD"}
|
|
@@ -4,7 +4,6 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
4
4
|
import { Gas, GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
5
5
|
import { Option } from 'commander';
|
|
6
6
|
import { createOrRetrieveAccount } from '../accounts.js';
|
|
7
|
-
import { SponsoredFeePaymentMethod } from '../sponsored_fee_payment.js';
|
|
8
7
|
import { aliasedAddressParser } from './options.js';
|
|
9
8
|
export function printGasEstimates(feeOpts, gasEstimates, log) {
|
|
10
9
|
log(`Estimated gas usage: ${formatGasEstimate(gasEstimates)}`);
|
|
@@ -240,6 +239,8 @@ export function parsePaymentMethod(payment, allowCustomFeePayer, log, db) {
|
|
|
240
239
|
case 'fpc-sponsored':
|
|
241
240
|
{
|
|
242
241
|
const sponsor = getFpc();
|
|
242
|
+
log(`Using sponsored fee payment with sponsor ${sponsor}`);
|
|
243
|
+
const { SponsoredFeePaymentMethod } = await import('@aztec/aztec.js/fee/testing');
|
|
243
244
|
return new SponsoredFeePaymentMethod(sponsor);
|
|
244
245
|
}
|
|
245
246
|
case undefined:
|
|
@@ -4,10 +4,10 @@ import { Option } from 'commander';
|
|
|
4
4
|
import type { AliasType, WalletDB } from '../../storage/wallet_db.js';
|
|
5
5
|
export declare const ARTIFACT_DESCRIPTION = "Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract";
|
|
6
6
|
export declare function integerArgParser(value: string, argName: string, min?: number, max?: number): number;
|
|
7
|
-
export declare function aliasedTxHashParser(txHash: string, db?: WalletDB): import("@aztec/
|
|
7
|
+
export declare function aliasedTxHashParser(txHash: string, db?: WalletDB): import("@aztec/stdlib/tx").TxHash;
|
|
8
8
|
export declare function aliasedAuthWitParser(witness: string, db?: WalletDB): AuthWitness;
|
|
9
9
|
export declare function aliasedAddressParser(defaultPrefix: AliasType, address: string, db?: WalletDB): AztecAddress;
|
|
10
|
-
export declare function aliasedSecretKeyParser(sk: string, db?: WalletDB): import("@aztec/
|
|
10
|
+
export declare function aliasedSecretKeyParser(sk: string, db?: WalletDB): import("@aztec/foundation/schemas").Fr;
|
|
11
11
|
export declare function createAliasOption(description: string, hide: boolean): Option;
|
|
12
12
|
export declare function createAccountOption(description: string, hide: boolean, db?: WalletDB): Option;
|
|
13
13
|
export declare function createAuthwitnessOption(description: string, hide: boolean, db?: WalletDB): Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/utils/options/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAKtE,eAAO,MAAM,oBAAoB,wKACsI,CAAC;AAExK,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,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,EAAE,EAAE,CAAC,EAAE,QAAQ,UAIxF;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,OAAO,UAMlD;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,QAAQ,UAQrE;AAED,wBAAgB,2BAA2B,CAAC,EAAE,CAAC,EAAE,QAAQ,UAIxD;AAED,wBAAgB,kCAAkC,WAKjD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,mBAajE;AAED,wBAAsB,8BAA8B,CAClD,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,EACpC,eAAe,EAAE,YAAY,EAC7B,EAAE,CAAC,EAAE,QAAQ,mBAWd;AAED,wBAAgB,oBAAoB,CAAC,EAAE,CAAC,EAAE,QAAQ,UAIjD;AA6BD,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,WAAW,EAAE,CAG9F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1-alpha-testnet.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/cmds/index.js",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/accounts": "0.82.
|
|
69
|
-
"@aztec/aztec.js": "0.82.
|
|
70
|
-
"@aztec/cli": "0.82.
|
|
71
|
-
"@aztec/entrypoints": "0.82.
|
|
72
|
-
"@aztec/ethereum": "0.82.
|
|
73
|
-
"@aztec/foundation": "0.82.
|
|
74
|
-
"@aztec/kv-store": "0.82.
|
|
75
|
-
"@aztec/noir-contracts.js": "0.82.
|
|
76
|
-
"@aztec/noir-noirc_abi": "0.82.
|
|
77
|
-
"@aztec/pxe": "0.82.
|
|
78
|
-
"@aztec/stdlib": "0.82.
|
|
68
|
+
"@aztec/accounts": "0.82.1-alpha-testnet.1",
|
|
69
|
+
"@aztec/aztec.js": "0.82.1-alpha-testnet.1",
|
|
70
|
+
"@aztec/cli": "0.82.1-alpha-testnet.1",
|
|
71
|
+
"@aztec/entrypoints": "0.82.1-alpha-testnet.1",
|
|
72
|
+
"@aztec/ethereum": "0.82.1-alpha-testnet.1",
|
|
73
|
+
"@aztec/foundation": "0.82.1-alpha-testnet.1",
|
|
74
|
+
"@aztec/kv-store": "0.82.1-alpha-testnet.1",
|
|
75
|
+
"@aztec/noir-contracts.js": "0.82.1-alpha-testnet.1",
|
|
76
|
+
"@aztec/noir-noirc_abi": "0.82.1-alpha-testnet.1",
|
|
77
|
+
"@aztec/pxe": "0.82.1-alpha-testnet.1",
|
|
78
|
+
"@aztec/stdlib": "0.82.1-alpha-testnet.1",
|
|
79
79
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
80
80
|
"commander": "^12.1.0",
|
|
81
81
|
"inquirer": "^10.1.8",
|
|
@@ -32,7 +32,7 @@ export async function createAccount(
|
|
|
32
32
|
Fr.ZERO,
|
|
33
33
|
publicKey,
|
|
34
34
|
);
|
|
35
|
-
const salt = account.getInstance()
|
|
35
|
+
const { salt } = account.getInstance();
|
|
36
36
|
const { address, publicKeys, partialAddress } = await account.getCompleteAddress();
|
|
37
37
|
|
|
38
38
|
const out: Record<string, any> = {};
|
|
@@ -72,7 +72,7 @@ export async function createAccount(
|
|
|
72
72
|
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
73
73
|
};
|
|
74
74
|
if (feeOpts.estimateOnly) {
|
|
75
|
-
const gas = await
|
|
75
|
+
const gas = await account.estimateDeploymentGas(deployOpts);
|
|
76
76
|
if (json) {
|
|
77
77
|
out.fee = {
|
|
78
78
|
gasLimits: {
|
package/src/cmds/deploy.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccountWalletWithSecretKey, ContractDeployer, type
|
|
1
|
+
import { type AccountWalletWithSecretKey, ContractDeployer, type DeployOptions, Fr, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import { encodeArgs, getContractArtifact } from '@aztec/cli/utils';
|
|
3
3
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
4
|
import { getInitializer } from '@aztec/stdlib/abi';
|
|
@@ -44,8 +44,8 @@ export async function deploy(
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const deploy = deployer.deploy(...args);
|
|
47
|
-
const deployOpts:
|
|
48
|
-
...(await feeOpts.
|
|
47
|
+
const deployOpts: DeployOptions = {
|
|
48
|
+
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
49
49
|
contractAddressSalt: salt,
|
|
50
50
|
universalDeploy,
|
|
51
51
|
skipClassRegistration,
|
|
@@ -41,11 +41,12 @@ export async function deployAccount(
|
|
|
41
41
|
let txReceipt;
|
|
42
42
|
|
|
43
43
|
const deployOpts: DeployAccountOptions = {
|
|
44
|
-
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
45
44
|
skipInitialization: false,
|
|
45
|
+
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
46
46
|
};
|
|
47
|
+
|
|
47
48
|
if (feeOpts.estimateOnly) {
|
|
48
|
-
const gas = await
|
|
49
|
+
const gas = await account.estimateDeploymentGas(deployOpts);
|
|
49
50
|
if (json) {
|
|
50
51
|
out.fee = {
|
|
51
52
|
gasLimits: {
|
|
@@ -15,7 +15,6 @@ import { Option } from 'commander';
|
|
|
15
15
|
|
|
16
16
|
import type { WalletDB } from '../../storage/wallet_db.js';
|
|
17
17
|
import { createOrRetrieveAccount } from '../accounts.js';
|
|
18
|
-
import { SponsoredFeePaymentMethod } from '../sponsored_fee_payment.js';
|
|
19
18
|
import { aliasedAddressParser } from './options.js';
|
|
20
19
|
|
|
21
20
|
export type CliFeeArgs = {
|
|
@@ -325,6 +324,8 @@ export function parsePaymentMethod(
|
|
|
325
324
|
}
|
|
326
325
|
case 'fpc-sponsored': {
|
|
327
326
|
const sponsor = getFpc();
|
|
327
|
+
log(`Using sponsored fee payment with sponsor ${sponsor}`);
|
|
328
|
+
const { SponsoredFeePaymentMethod } = await import('@aztec/aztec.js/fee/testing');
|
|
328
329
|
return new SponsoredFeePaymentMethod(sponsor);
|
|
329
330
|
}
|
|
330
331
|
case undefined:
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
2
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
export declare class SponsoredFeePaymentMethod implements FeePaymentMethod {
|
|
5
|
-
private paymentContract;
|
|
6
|
-
constructor(paymentContract: AztecAddress);
|
|
7
|
-
getAsset(): Promise<AztecAddress>;
|
|
8
|
-
getFeePayer(): Promise<AztecAddress>;
|
|
9
|
-
getExecutionPayload(): Promise<ExecutionPayload>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=sponsored_fee_payment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fee_payment.d.ts","sourceRoot":"","sources":["../../src/utils/sponsored_fee_payment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,qBAAa,yBAA0B,YAAW,gBAAgB;IACpD,OAAO,CAAC,eAAe;gBAAf,eAAe,EAAE,YAAY;IAEjD,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAIjC,WAAW;IAIL,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAiBvD"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
2
|
-
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
3
|
-
export class SponsoredFeePaymentMethod {
|
|
4
|
-
paymentContract;
|
|
5
|
-
constructor(paymentContract){
|
|
6
|
-
this.paymentContract = paymentContract;
|
|
7
|
-
}
|
|
8
|
-
getAsset() {
|
|
9
|
-
throw new Error('Asset is not required for sponsored fpc.');
|
|
10
|
-
}
|
|
11
|
-
getFeePayer() {
|
|
12
|
-
return Promise.resolve(this.paymentContract);
|
|
13
|
-
}
|
|
14
|
-
async getExecutionPayload() {
|
|
15
|
-
return new ExecutionPayload([
|
|
16
|
-
{
|
|
17
|
-
name: 'sponsor_unconditionally',
|
|
18
|
-
to: this.paymentContract,
|
|
19
|
-
selector: await FunctionSelector.fromSignature('sponsor_unconditionally()'),
|
|
20
|
-
type: FunctionType.PRIVATE,
|
|
21
|
-
isStatic: false,
|
|
22
|
-
args: [],
|
|
23
|
-
returnTypes: []
|
|
24
|
-
}
|
|
25
|
-
], [], []);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
2
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
-
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
|
|
6
|
-
export class SponsoredFeePaymentMethod implements FeePaymentMethod {
|
|
7
|
-
constructor(private paymentContract: AztecAddress) {}
|
|
8
|
-
|
|
9
|
-
getAsset(): Promise<AztecAddress> {
|
|
10
|
-
throw new Error('Asset is not required for sponsored fpc.');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
getFeePayer() {
|
|
14
|
-
return Promise.resolve(this.paymentContract);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async getExecutionPayload(): Promise<ExecutionPayload> {
|
|
18
|
-
return new ExecutionPayload(
|
|
19
|
-
[
|
|
20
|
-
{
|
|
21
|
-
name: 'sponsor_unconditionally',
|
|
22
|
-
to: this.paymentContract,
|
|
23
|
-
selector: await FunctionSelector.fromSignature('sponsor_unconditionally()'),
|
|
24
|
-
type: FunctionType.PRIVATE,
|
|
25
|
-
isStatic: false,
|
|
26
|
-
args: [],
|
|
27
|
-
returnTypes: [],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
[],
|
|
31
|
-
[],
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|