@aztec/cli-wallet 0.84.0-nightly.20250409 → 0.84.0-nightly.20250412
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/index.d.ts.map +1 -1
- package/dest/cmds/index.js +3 -4
- package/dest/utils/options/options.d.ts +2 -2
- package/dest/utils/options/options.d.ts.map +1 -1
- package/dest/utils/options/options.js +13 -13
- package/package.json +12 -12
- package/src/cmds/index.ts +9 -4
- package/src/utils/options/options.ts +15 -12
package/dest/cmds/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAuBxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,EACnB,EAAE,CAAC,EAAE,QAAQ,EACb,UAAU,CAAC,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cmds/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAuBxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,MAAM,EACnB,EAAE,CAAC,EAAE,QAAQ,EACb,UAAU,CAAC,EAAE,UAAU,WAgpBxB"}
|
package/dest/cmds/index.js
CHANGED
|
@@ -80,17 +80,17 @@ export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
|
|
|
80
80
|
await db.storeContract(address, artifactPath, log, alias);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
const sendCommand = program.command('send').description('Calls a function on an Aztec contract.').argument('<functionName>', 'Name of function to execute').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createArtifactOption(db)).addOption(createContractAddressOption(db)).addOption(createAliasOption('Alias for the transaction hash. Used for easy reference in subsequent commands.', !db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the transaction', !db, db)).addOption(createAccountOption('Alias or address of the account to send the transaction from', !db, db)).option('--no-wait', 'Print transaction hash without waiting for it to be mined').option('--no-cancel', 'Do not allow the transaction to be cancelled. This makes for cheaper transactions.');
|
|
83
|
+
const sendCommand = program.command('send').description('Calls a function on an Aztec contract.').argument('<functionName>', 'Name of function to execute').addOption(pxeOption).addOption(createArgsOption(false, db)).addOption(createArtifactOption(db)).addOption(createContractAddressOption(db)).addOption(createAliasOption('Alias for the transaction hash. Used for easy reference in subsequent commands.', !db)).addOption(createSecretKeyOption("The sender's secret key", !db, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('account')).addOption(createAuthwitnessOption('Authorization witness to use for the transaction. If using multiple, pass a comma separated string', !db, db)).addOption(createAccountOption('Alias or address of the account to send the transaction from', !db, db)).option('--no-wait', 'Print transaction hash without waiting for it to be mined').option('--no-cancel', 'Do not allow the transaction to be cancelled. This makes for cheaper transactions.');
|
|
84
84
|
addOptions(sendCommand, FeeOpts.getOptions()).action(async (functionName, _options, command)=>{
|
|
85
85
|
const { send } = await import('./send.js');
|
|
86
86
|
const options = command.optsWithGlobals();
|
|
87
|
-
const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, wait, rpcUrl, secretKey, alias, cancel, authWitness } = options;
|
|
87
|
+
const { args, contractArtifact: artifactPathPromise, contractAddress, from: parsedFromAddress, wait, rpcUrl, secretKey, alias, cancel, authWitness: authWitnessArray } = options;
|
|
88
88
|
const client = pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
|
|
89
89
|
const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey);
|
|
90
90
|
const wallet = await account.getWallet();
|
|
91
91
|
const artifactPath = await artifactPathFromPromiseOrAlias(artifactPathPromise, contractAddress, db);
|
|
92
92
|
debugLogger.info(`Using wallet with address ${wallet.getCompleteAddress().address.toString()}`);
|
|
93
|
-
const authWitnesses = cleanupAuthWitnesses(
|
|
93
|
+
const authWitnesses = cleanupAuthWitnesses(authWitnessArray);
|
|
94
94
|
const sentTx = await send(wallet, functionName, args, artifactPath, contractAddress, wait, cancel, await FeeOpts.fromCli(options, client, log, db), authWitnesses, log);
|
|
95
95
|
if (db && sentTx) {
|
|
96
96
|
const txAlias = alias ? alias : `${functionName}-${sentTx.nonce.toString().slice(-4)}`;
|
|
@@ -127,7 +127,6 @@ export function injectCommands(program, log, debugLogger, db, pxeWrapper) {
|
|
|
127
127
|
const { bridgeL1FeeJuice } = await import('./bridge_fee_juice.js');
|
|
128
128
|
const { rpcUrl, l1ChainId, l1RpcUrls, l1PrivateKey, mnemonic, mint, json, wait, interval: intervalS } = options;
|
|
129
129
|
const client = pxeWrapper?.getPXE() ?? await createCompatibleClient(rpcUrl, debugLogger);
|
|
130
|
-
log(`Minting ${amount} fee juice on L1 and pushing to L2`);
|
|
131
130
|
const [secret, messageLeafIndex] = await bridgeL1FeeJuice(amount, recipient, client, l1RpcUrls, l1ChainId, l1PrivateKey, mnemonic, mint, json, wait, intervalS * 1000, log, debugLogger);
|
|
132
131
|
if (db) {
|
|
133
132
|
await db.pushBridgedFeeJuice(recipient, secret, amount, messageLeafIndex, log);
|
|
@@ -5,7 +5,7 @@ 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
7
|
export declare function aliasedTxHashParser(txHash: string, db?: WalletDB): import("@aztec/aztec.js/tx_hash").TxHash;
|
|
8
|
-
export declare function aliasedAuthWitParser(
|
|
8
|
+
export declare function aliasedAuthWitParser(witnesses: string, db?: WalletDB): AuthWitness[];
|
|
9
9
|
export declare function aliasedAddressParser(defaultPrefix: AliasType, address: string, db?: WalletDB): AztecAddress;
|
|
10
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;
|
|
@@ -18,5 +18,5 @@ export declare function createDebugExecutionStepsDirOption(): Option;
|
|
|
18
18
|
export declare function artifactPathParser(filePath: string, db?: WalletDB): Promise<string>;
|
|
19
19
|
export declare function artifactPathFromPromiseOrAlias(artifactPathPromise: Promise<string>, contractAddress: AztecAddress, db?: WalletDB): Promise<string>;
|
|
20
20
|
export declare function createArtifactOption(db?: WalletDB): Option;
|
|
21
|
-
export declare function cleanupAuthWitnesses(authWitnesses: AuthWitness |
|
|
21
|
+
export declare function cleanupAuthWitnesses(authWitnesses: AuthWitness[] | undefined): AuthWitness[];
|
|
22
22
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -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,EACb,OAAO,EAAE,MAAM,EACf,GAAG,SAA0B,EAC7B,GAAG,SAA0B,UAU9B;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,4CAQhE;AAED,wBAAgB,oBAAoB,CAAC,
|
|
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,EACb,OAAO,EAAE,MAAM,EACf,GAAG,SAA0B,EAC7B,GAAG,SAA0B,UAU9B;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,4CAQhE;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,iBAYpE;AAED,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,gBAQ5F;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,0CAQ/D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,UAEnE;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,QAAQ,UAIpF;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,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,EAAE,GAAG,SAAS,GAAG,WAAW,EAAE,CAE5F"}
|
|
@@ -24,14 +24,17 @@ export function aliasedTxHashParser(txHash, db) {
|
|
|
24
24
|
return parseTxHash(rawTxHash);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
export function aliasedAuthWitParser(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
export function aliasedAuthWitParser(witnesses, db) {
|
|
28
|
+
const parsedWitnesses = witnesses.split(',').map((witness)=>{
|
|
29
|
+
try {
|
|
30
|
+
return AuthWitness.fromString(witness);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
const prefixed = witness.includes(':') ? witness : `authwits:${witness}`;
|
|
33
|
+
const rawAuthWitness = db ? db.tryRetrieveAlias(prefixed) : witness;
|
|
34
|
+
return AuthWitness.fromString(rawAuthWitness);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return parsedWitnesses;
|
|
35
38
|
}
|
|
36
39
|
export function aliasedAddressParser(defaultPrefix, address, db) {
|
|
37
40
|
if (address.startsWith('0x')) {
|
|
@@ -58,7 +61,7 @@ export function createAccountOption(description, hide, db) {
|
|
|
58
61
|
return new Option(`-f, --from <string>`, description).hideHelp(hide).argParser((address)=>aliasedAddressParser('accounts', address, db));
|
|
59
62
|
}
|
|
60
63
|
export function createAuthwitnessOption(description, hide, db) {
|
|
61
|
-
return new Option('-aw, --auth-witness <string
|
|
64
|
+
return new Option('-aw, --auth-witness <string,...>', description).hideHelp(hide).argParser((witness)=>aliasedAuthWitParser(witness, db));
|
|
62
65
|
}
|
|
63
66
|
export function createTypeOption(mandatory) {
|
|
64
67
|
return new Option('-t, --type <string>', 'Type of account to create').choices(AccountTypes).default('schnorr').conflicts('account-or-address').makeOptionMandatory(mandatory);
|
|
@@ -124,8 +127,5 @@ async function contractArtifactFromWorkspace(pkg, contractName) {
|
|
|
124
127
|
return `${cwd}/${TARGET_DIR}/${bestMatch[0]}`;
|
|
125
128
|
}
|
|
126
129
|
export function cleanupAuthWitnesses(authWitnesses) {
|
|
127
|
-
|
|
128
|
-
authWitnesses
|
|
129
|
-
];
|
|
130
|
-
return authWitnessArray.filter((w)=>w !== undefined);
|
|
130
|
+
return authWitnesses?.filter((w)=>w !== undefined) ?? [];
|
|
131
131
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "0.84.0-nightly.
|
|
3
|
+
"version": "0.84.0-nightly.20250412",
|
|
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.84.0-nightly.
|
|
69
|
-
"@aztec/aztec.js": "0.84.0-nightly.
|
|
70
|
-
"@aztec/cli": "0.84.0-nightly.
|
|
71
|
-
"@aztec/entrypoints": "0.84.0-nightly.
|
|
72
|
-
"@aztec/ethereum": "0.84.0-nightly.
|
|
73
|
-
"@aztec/foundation": "0.84.0-nightly.
|
|
74
|
-
"@aztec/kv-store": "0.84.0-nightly.
|
|
75
|
-
"@aztec/noir-contracts.js": "0.84.0-nightly.
|
|
76
|
-
"@aztec/noir-noirc_abi": "0.84.0-nightly.
|
|
77
|
-
"@aztec/pxe": "0.84.0-nightly.
|
|
78
|
-
"@aztec/stdlib": "0.84.0-nightly.
|
|
68
|
+
"@aztec/accounts": "0.84.0-nightly.20250412",
|
|
69
|
+
"@aztec/aztec.js": "0.84.0-nightly.20250412",
|
|
70
|
+
"@aztec/cli": "0.84.0-nightly.20250412",
|
|
71
|
+
"@aztec/entrypoints": "0.84.0-nightly.20250412",
|
|
72
|
+
"@aztec/ethereum": "0.84.0-nightly.20250412",
|
|
73
|
+
"@aztec/foundation": "0.84.0-nightly.20250412",
|
|
74
|
+
"@aztec/kv-store": "0.84.0-nightly.20250412",
|
|
75
|
+
"@aztec/noir-contracts.js": "0.84.0-nightly.20250412",
|
|
76
|
+
"@aztec/noir-noirc_abi": "0.84.0-nightly.20250412",
|
|
77
|
+
"@aztec/pxe": "0.84.0-nightly.20250412",
|
|
78
|
+
"@aztec/stdlib": "0.84.0-nightly.20250412",
|
|
79
79
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
80
80
|
"commander": "^12.1.0",
|
|
81
81
|
"inquirer": "^10.1.8",
|
package/src/cmds/index.ts
CHANGED
|
@@ -267,7 +267,13 @@ export function injectCommands(
|
|
|
267
267
|
.addOption(
|
|
268
268
|
createSecretKeyOption("The sender's secret key", !db, sk => aliasedSecretKeyParser(sk, db)).conflicts('account'),
|
|
269
269
|
)
|
|
270
|
-
.addOption(
|
|
270
|
+
.addOption(
|
|
271
|
+
createAuthwitnessOption(
|
|
272
|
+
'Authorization witness to use for the transaction. If using multiple, pass a comma separated string',
|
|
273
|
+
!db,
|
|
274
|
+
db,
|
|
275
|
+
),
|
|
276
|
+
)
|
|
271
277
|
.addOption(createAccountOption('Alias or address of the account to send the transaction from', !db, db))
|
|
272
278
|
.option('--no-wait', 'Print transaction hash without waiting for it to be mined')
|
|
273
279
|
.option('--no-cancel', 'Do not allow the transaction to be cancelled. This makes for cheaper transactions.');
|
|
@@ -285,7 +291,7 @@ export function injectCommands(
|
|
|
285
291
|
secretKey,
|
|
286
292
|
alias,
|
|
287
293
|
cancel,
|
|
288
|
-
authWitness,
|
|
294
|
+
authWitness: authWitnessArray,
|
|
289
295
|
} = options;
|
|
290
296
|
const client = pxeWrapper?.getPXE() ?? (await createCompatibleClient(rpcUrl, debugLogger));
|
|
291
297
|
const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey);
|
|
@@ -294,7 +300,7 @@ export function injectCommands(
|
|
|
294
300
|
|
|
295
301
|
debugLogger.info(`Using wallet with address ${wallet.getCompleteAddress().address.toString()}`);
|
|
296
302
|
|
|
297
|
-
const authWitnesses = cleanupAuthWitnesses(
|
|
303
|
+
const authWitnesses = cleanupAuthWitnesses(authWitnessArray);
|
|
298
304
|
const sentTx = await send(
|
|
299
305
|
wallet,
|
|
300
306
|
functionName,
|
|
@@ -427,7 +433,6 @@ export function injectCommands(
|
|
|
427
433
|
const { bridgeL1FeeJuice } = await import('./bridge_fee_juice.js');
|
|
428
434
|
const { rpcUrl, l1ChainId, l1RpcUrls, l1PrivateKey, mnemonic, mint, json, wait, interval: intervalS } = options;
|
|
429
435
|
const client = pxeWrapper?.getPXE() ?? (await createCompatibleClient(rpcUrl, debugLogger));
|
|
430
|
-
log(`Minting ${amount} fee juice on L1 and pushing to L2`);
|
|
431
436
|
|
|
432
437
|
const [secret, messageLeafIndex] = await bridgeL1FeeJuice(
|
|
433
438
|
amount,
|
|
@@ -39,14 +39,18 @@ export function aliasedTxHashParser(txHash: string, db?: WalletDB) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function aliasedAuthWitParser(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
export function aliasedAuthWitParser(witnesses: string, db?: WalletDB) {
|
|
43
|
+
const parsedWitnesses = witnesses.split(',').map(witness => {
|
|
44
|
+
try {
|
|
45
|
+
return AuthWitness.fromString(witness);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
const prefixed = witness.includes(':') ? witness : `authwits:${witness}`;
|
|
48
|
+
const rawAuthWitness = db ? db.tryRetrieveAlias(prefixed) : witness;
|
|
49
|
+
return AuthWitness.fromString(rawAuthWitness);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return parsedWitnesses;
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
export function aliasedAddressParser(defaultPrefix: AliasType, address: string, db?: WalletDB) {
|
|
@@ -80,7 +84,7 @@ export function createAccountOption(description: string, hide: boolean, db?: Wal
|
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
export function createAuthwitnessOption(description: string, hide: boolean, db?: WalletDB) {
|
|
83
|
-
return new Option('-aw, --auth-witness <string
|
|
87
|
+
return new Option('-aw, --auth-witness <string,...>', description)
|
|
84
88
|
.hideHelp(hide)
|
|
85
89
|
.argParser(witness => aliasedAuthWitParser(witness, db));
|
|
86
90
|
}
|
|
@@ -180,7 +184,6 @@ async function contractArtifactFromWorkspace(pkg?: string, contractName?: string
|
|
|
180
184
|
return `${cwd}/${TARGET_DIR}/${bestMatch[0]}`;
|
|
181
185
|
}
|
|
182
186
|
|
|
183
|
-
export function cleanupAuthWitnesses(authWitnesses: AuthWitness |
|
|
184
|
-
|
|
185
|
-
return authWitnessArray.filter(w => w !== undefined);
|
|
187
|
+
export function cleanupAuthWitnesses(authWitnesses: AuthWitness[] | undefined): AuthWitness[] {
|
|
188
|
+
return authWitnesses?.filter(w => w !== undefined) ?? [];
|
|
186
189
|
}
|