@aztec/aztec.js 3.0.0-canary.a9708bd → 3.0.0-devnet.2
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/account/account.d.ts +60 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +59 -0
- package/dest/account/account_contract.d.ts +5 -5
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_contract.js +0 -1
- package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
- package/dest/account/account_with_secret_key.d.ts.map +1 -0
- package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
- package/dest/account/index.d.ts +1 -4
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +1 -4
- package/dest/account/signerless_account.d.ts +24 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +27 -0
- package/dest/api/abi.d.ts +1 -0
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/account.d.ts +4 -2
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +3 -1
- package/dest/api/addresses.d.ts +1 -0
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +2 -0
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +2 -0
- package/dest/api/block.d.ts +3 -0
- package/dest/api/block.d.ts.map +1 -0
- package/dest/api/block.js +2 -0
- package/dest/api/contract.d.ts +4 -5
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +3 -3
- package/dest/api/crypto.d.ts +2 -0
- package/dest/api/crypto.d.ts.map +1 -0
- package/dest/api/crypto.js +1 -0
- package/dest/api/ethereum.d.ts +0 -1
- package/dest/api/ethereum.d.ts.map +1 -1
- package/dest/api/ethereum.js +0 -1
- package/dest/api/events.d.ts +12 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +30 -0
- package/dest/api/fee.d.ts +1 -2
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +0 -1
- package/dest/api/keys.d.ts +4 -0
- package/dest/api/keys.d.ts.map +1 -0
- package/dest/api/keys.js +3 -0
- package/dest/api/log.d.ts +1 -0
- package/dest/api/log.d.ts.map +1 -1
- package/dest/api/log.js +1 -0
- package/dest/api/messaging.d.ts +3 -0
- package/dest/api/messaging.d.ts.map +1 -0
- package/dest/api/messaging.js +2 -0
- package/dest/api/node.d.ts +21 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +18 -0
- package/dest/api/note.d.ts +2 -0
- package/dest/api/note.d.ts.map +1 -0
- package/dest/api/note.js +1 -0
- package/dest/api/protocol.d.ts +3 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +2 -0
- package/dest/api/trees.d.ts +3 -0
- package/dest/api/trees.d.ts.map +1 -0
- package/dest/api/trees.js +2 -0
- package/dest/api/tx.d.ts +2 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +10 -6
- package/dest/api/utils.d.ts.map +1 -1
- package/dest/api/utils.js +10 -5
- package/dest/api/wallet.d.ts +4 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +4 -1
- package/dest/contract/base_contract_interaction.d.ts +6 -48
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +6 -106
- package/dest/contract/batch_call.d.ts +6 -14
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +42 -52
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +2 -12
- package/dest/contract/contract_base.d.ts +1 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +29 -40
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +41 -53
- package/dest/contract/deploy_method.d.ts +63 -56
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +68 -86
- package/dest/contract/deploy_sent_tx.d.ts +0 -1
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +7 -10
- package/dest/contract/interaction_options.d.ts +74 -19
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +51 -3
- package/dest/contract/sent_tx.d.ts +3 -3
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +5 -5
- package/dest/contract/wait_for_proven.d.ts +3 -3
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +2 -2
- package/dest/deployment/publish_instance.d.ts +1 -1
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +2 -5
- package/dest/ethereum/portal_manager.d.ts +3 -4
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +3 -5
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +12 -7
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +21 -12
- package/dest/fee/fee_payment_method.d.ts +26 -0
- package/dest/fee/fee_payment_method.d.ts.map +1 -0
- package/dest/fee/fee_payment_method.js +3 -0
- package/dest/fee/private_fee_payment_method.d.ts +22 -5
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +34 -13
- package/dest/fee/public_fee_payment_method.d.ts +22 -5
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +37 -14
- package/dest/fee/sponsored_fee_payment.d.ts +2 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +4 -0
- package/dest/utils/authwit.d.ts +77 -25
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +219 -24
- package/dest/utils/cross_chain.d.ts +24 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +30 -0
- package/dest/utils/fee_juice.d.ts +3 -2
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +3 -2
- package/dest/{fee → wallet}/account_entrypoint_meta_payment_method.d.ts +13 -10
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
- package/dest/wallet/account_manager.d.ts +69 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +113 -0
- package/dest/wallet/base_wallet.d.ts +78 -35
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +216 -48
- package/dest/wallet/deploy_account_method.d.ts +52 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +77 -0
- package/dest/wallet/index.d.ts +2 -15
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -19
- package/dest/wallet/wallet.d.ts +2473 -6
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +202 -3
- package/package.json +25 -21
- package/src/account/account.ts +97 -0
- package/src/account/account_contract.ts +4 -6
- package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
- package/src/account/index.ts +1 -4
- package/src/account/signerless_account.ts +46 -0
- package/src/api/abi.ts +11 -0
- package/src/api/account.ts +4 -2
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +11 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +16 -8
- package/src/api/crypto.ts +1 -0
- package/src/api/ethereum.ts +0 -1
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -2
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +1 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +20 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +2 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +11 -0
- package/src/api/utils.ts +12 -19
- package/src/api/wallet.ts +33 -5
- package/src/contract/base_contract_interaction.ts +9 -138
- package/src/contract/batch_call.ts +52 -61
- package/src/contract/contract.ts +2 -12
- package/src/contract/contract_function_interaction.ts +65 -97
- package/src/contract/deploy_method.ts +117 -99
- package/src/contract/deploy_sent_tx.ts +4 -10
- package/src/contract/interaction_options.ts +126 -24
- package/src/contract/sent_tx.ts +4 -4
- package/src/contract/wait_for_proven.ts +4 -4
- package/src/deployment/publish_instance.ts +3 -8
- package/src/ethereum/portal_manager.ts +4 -12
- package/src/fee/fee_juice_payment_method_with_claim.ts +26 -17
- package/src/fee/fee_payment_method.ts +26 -0
- package/src/fee/private_fee_payment_method.ts +60 -41
- package/src/fee/public_fee_payment_method.ts +73 -49
- package/src/fee/sponsored_fee_payment.ts +6 -0
- package/src/utils/authwit.ts +250 -38
- package/src/utils/cross_chain.ts +53 -0
- package/src/utils/fee_juice.ts +4 -3
- package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
- package/src/wallet/account_manager.ts +154 -0
- package/src/wallet/base_wallet.ts +287 -78
- package/src/wallet/deploy_account_method.ts +125 -0
- package/src/wallet/index.ts +2 -32
- package/src/wallet/wallet.ts +357 -29
- package/dest/account_manager/account_manager.d.ts +0 -119
- package/dest/account_manager/account_manager.d.ts.map +0 -1
- package/dest/account_manager/account_manager.js +0 -202
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.js +0 -29
- package/dest/account_manager/index.d.ts +0 -3
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -2
- package/dest/api/interfaces.d.ts +0 -2
- package/dest/api/interfaces.d.ts.map +0 -1
- package/dest/api/interfaces.js +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/log_id.js +0 -1
- package/dest/api/rpc.d.ts +0 -3
- package/dest/api/rpc.d.ts.map +0 -1
- package/dest/api/rpc.js +0 -2
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -21
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.js +0 -21
- package/dest/contract/proven_tx.d.ts +0 -21
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -23
- package/dest/ethereum/l1_contracts.d.ts +0 -3
- package/dest/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/ethereum/l1_contracts.js +0 -13
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
- package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.js +0 -21
- package/dest/fee/utils.d.ts +0 -13
- package/dest/fee/utils.d.ts.map +0 -1
- package/dest/fee/utils.js +0 -32
- package/dest/index.d.ts +0 -59
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -62
- package/dest/rpc_clients/node/index.d.ts +0 -12
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.js +0 -72
- package/dest/rpc_clients/pxe_client.d.ts +0 -10
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.js +0 -23
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/utils/pxe.js +0 -14
- package/dest/wallet/account_wallet.d.ts +0 -74
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -232
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.d.ts +0 -23
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -33
- package/src/account_manager/account_manager.ts +0 -276
- package/src/account_manager/deploy_account_sent_tx.ts +0 -46
- package/src/account_manager/index.ts +0 -2
- package/src/api/interfaces.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/rpc.ts +0 -2
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -45
- package/src/contract/proven_tx.ts +0 -36
- package/src/ethereum/l1_contracts.ts +0 -21
- package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
- package/src/fee/fee_juice_payment_method.ts +0 -25
- package/src/fee/utils.ts +0 -39
- package/src/index.ts +0 -85
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -246
- package/src/wallet/signerless_wallet.ts +0 -56
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type EventMetadataDefinition, EventSelector, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns decoded public events given search parameters.
|
|
6
|
+
* @param node - The node to request events from
|
|
7
|
+
* @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
8
|
+
* @param from - The block number to search from.
|
|
9
|
+
* @param limit - The amount of blocks to search.
|
|
10
|
+
* @returns - The deserialized events.
|
|
11
|
+
*/
|
|
12
|
+
export async function getDecodedPublicEvents<T>(
|
|
13
|
+
node: AztecNode,
|
|
14
|
+
eventMetadataDef: EventMetadataDefinition,
|
|
15
|
+
from: number,
|
|
16
|
+
limit: number,
|
|
17
|
+
): Promise<T[]> {
|
|
18
|
+
const { logs } = await node.getPublicLogs({
|
|
19
|
+
fromBlock: from,
|
|
20
|
+
toBlock: from + limit,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const decodedEvents = logs
|
|
24
|
+
.map(log => {
|
|
25
|
+
// +1 for the event selector
|
|
26
|
+
const expectedLength = eventMetadataDef.fieldNames.length + 1;
|
|
27
|
+
if (log.log.fields.length !== expectedLength) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length. Expected ${expectedLength}. Got ${log.log.fields.length}.`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const logFields = log.log.getEmittedFields();
|
|
34
|
+
// We are assuming here that event logs are the last 4 bytes of the event. This is not enshrined but is a function of aztec.nr raw log emission.
|
|
35
|
+
if (!EventSelector.fromField(logFields[logFields.length - 1]).equals(eventMetadataDef.eventSelector)) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return decodeFromAbi([eventMetadataDef.abiType], log.log.fields) as T;
|
|
40
|
+
})
|
|
41
|
+
.filter(log => log !== undefined) as T[];
|
|
42
|
+
|
|
43
|
+
return decodedEvents;
|
|
44
|
+
}
|
package/src/api/fee.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export type { FeePaymentMethod } from '
|
|
2
|
-
export { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js';
|
|
1
|
+
export type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
3
2
|
export { PrivateFeePaymentMethod } from '../fee/private_fee_payment_method.js';
|
|
4
3
|
export { PublicFeePaymentMethod } from '../fee/public_fee_payment_method.js';
|
|
5
4
|
export { FeeJuicePaymentMethodWithClaim } from '../fee/fee_juice_payment_method_with_claim.js';
|
package/src/api/keys.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
|
|
2
|
+
export {
|
|
3
|
+
computeAppNullifierSecretKey,
|
|
4
|
+
deriveKeys,
|
|
5
|
+
deriveMasterIncomingViewingSecretKey,
|
|
6
|
+
deriveMasterNullifierSecretKey,
|
|
7
|
+
} from '@aztec/stdlib/keys';
|
|
8
|
+
export { generatePublicKey } from '../utils/pub_key.js';
|
package/src/api/log.ts
CHANGED
package/src/api/node.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node` module provides utilities for connecting to and interacting with an Aztec node.
|
|
3
|
+
*
|
|
4
|
+
* The primary function is {@link createAztecNodeClient}, which creates a JSON-RPC client
|
|
5
|
+
* that connects to a running Aztec node instance. Use {@link waitForNode} to wait for
|
|
6
|
+
* the node to be ready before proceeding.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createAztecNodeClient, waitForNode } from '@aztec/aztec.js/node';
|
|
11
|
+
*
|
|
12
|
+
* const node = createAztecNodeClient('http://localhost:8080');
|
|
13
|
+
* await waitForNode(node);
|
|
14
|
+
* const blockNumber = await node.getBlockNumber();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { createAztecNodeClient, waitForNode, type AztecNode } from '../utils/node.js';
|
|
20
|
+
export { type NodeInfo } from '@aztec/stdlib/contract';
|
package/src/api/note.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UniqueNote, Comparator, Note } from '@aztec/stdlib/note';
|
package/src/api/trees.ts
ADDED
package/src/api/tx.ts
ADDED
package/src/api/utils.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
computeInnerAuthWitHashFromAction,
|
|
14
|
-
type IntentAction,
|
|
15
|
-
type IntentInnerHash,
|
|
16
|
-
} from '../utils/authwit.js';
|
|
17
|
-
export { computeInnerAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
18
|
-
export { waitForPXE } from '../utils/pxe.js';
|
|
19
|
-
export { waitForNode, createAztecNodeClient, type AztecNode } from '../utils/node.js';
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for aztec.js.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: This module contains low-usage utilities and may be deprecated in the future.
|
|
5
|
+
* Prefer using more specific modules:
|
|
6
|
+
* - Node connection utilities → `@aztec/aztec.js/node`
|
|
7
|
+
* - Type converters → `@aztec/aztec.js/abi`
|
|
8
|
+
* - Key generation → `@aztec/aztec.js/keys`
|
|
9
|
+
* - Messaging utilities → `@aztec/aztec.js/messaging`
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Low-usage utilities - consider these internal/experimental
|
|
20
13
|
export { getFeeJuiceBalance } from '../utils/fee_juice.js';
|
|
21
14
|
export { readFieldCompressedString } from '../utils/field_compressed_string.js';
|
package/src/api/wallet.ts
CHANGED
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
type Aliased,
|
|
3
|
+
type ContractInstanceAndArtifact,
|
|
4
|
+
type UserFeeOptions,
|
|
5
|
+
type SimulateOptions,
|
|
6
|
+
type ProfileOptions,
|
|
7
|
+
type SendOptions,
|
|
8
|
+
type BatchableMethods,
|
|
9
|
+
type BatchedMethod,
|
|
10
|
+
type BatchedMethodResult,
|
|
11
|
+
type BatchedMethodResultWrapper,
|
|
12
|
+
type BatchResults,
|
|
6
13
|
type Wallet,
|
|
7
|
-
|
|
14
|
+
ContractInstantiationDataSchema,
|
|
15
|
+
FunctionCallSchema,
|
|
16
|
+
ExecutionPayloadSchema,
|
|
17
|
+
UserFeeOptionsSchema,
|
|
18
|
+
WalletSimulationFeeOptionSchema,
|
|
19
|
+
SendOptionsSchema,
|
|
20
|
+
SimulateOptionsSchema,
|
|
21
|
+
ProfileOptionsSchema,
|
|
22
|
+
InstanceDataSchema,
|
|
23
|
+
MessageHashOrIntentSchema,
|
|
24
|
+
BatchedMethodSchema,
|
|
25
|
+
ContractMetadataSchema,
|
|
26
|
+
ContractClassMetadataSchema,
|
|
27
|
+
EventMetadataDefinitionSchema,
|
|
28
|
+
WalletSchema,
|
|
29
|
+
} from '../wallet/wallet.js';
|
|
30
|
+
|
|
31
|
+
export { type FeeOptions, BaseWallet } from '../wallet/base_wallet.js';
|
|
32
|
+
|
|
33
|
+
export { AccountManager } from '../wallet/account_manager.js';
|
|
34
|
+
|
|
35
|
+
export { type DeployAccountOptions, DeployAccountMethod } from '../wallet/deploy_account_method.js';
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GAS_ESTIMATION_DA_GAS_LIMIT,
|
|
3
|
-
GAS_ESTIMATION_L2_GAS_LIMIT,
|
|
4
|
-
GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT,
|
|
5
|
-
GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT,
|
|
6
|
-
} from '@aztec/constants';
|
|
7
|
-
import type { FeeOptions, TxExecutionOptions, UserFeeOptions } from '@aztec/entrypoints/interfaces';
|
|
8
1
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
9
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
10
3
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
11
|
-
import {
|
|
12
|
-
import { Gas, GasSettings } from '@aztec/stdlib/gas';
|
|
13
|
-
import type { Capsule, TxExecutionRequest, TxProvingResult } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { Capsule } from '@aztec/stdlib/tx';
|
|
14
5
|
|
|
15
|
-
import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js';
|
|
16
6
|
import type { Wallet } from '../wallet/wallet.js';
|
|
17
|
-
import {
|
|
18
|
-
import type { RequestMethodOptions, SendMethodOptions } from './interaction_options.js';
|
|
19
|
-
import { ProvenTx } from './proven_tx.js';
|
|
7
|
+
import { type RequestInteractionOptions, type SendInteractionOptions, toSendOptions } from './interaction_options.js';
|
|
20
8
|
import { SentTx } from './sent_tx.js';
|
|
21
9
|
|
|
22
10
|
/**
|
|
@@ -32,54 +20,13 @@ export abstract class BaseContractInteraction {
|
|
|
32
20
|
protected capsules: Capsule[] = [],
|
|
33
21
|
) {}
|
|
34
22
|
|
|
35
|
-
/**
|
|
36
|
-
* Create a transaction execution request ready to be simulated.
|
|
37
|
-
* @param options - An optional object containing additional configuration for the transaction.
|
|
38
|
-
* @returns A transaction execution request.
|
|
39
|
-
*/
|
|
40
|
-
public abstract create(options?: SendMethodOptions): Promise<TxExecutionRequest>;
|
|
41
|
-
|
|
42
23
|
/**
|
|
43
24
|
* Returns an execution request that represents this operation.
|
|
44
25
|
* Can be used as a building block for constructing batch requests.
|
|
45
26
|
* @param options - An optional object containing additional configuration for the transaction.
|
|
46
27
|
* @returns An execution request wrapped in promise.
|
|
47
28
|
*/
|
|
48
|
-
public abstract request(options?:
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Creates a transaction execution request, simulates and proves it. Differs from .prove in
|
|
52
|
-
* that its result does not include the wallet nor the composed tx object, but only the proving result.
|
|
53
|
-
* This object can then be used to either create a ProvenTx ready to be sent, or directly send the transaction.
|
|
54
|
-
* @param options - optional arguments to be used in the creation of the transaction
|
|
55
|
-
* @returns The proving result.
|
|
56
|
-
*/
|
|
57
|
-
protected async proveInternal(options: SendMethodOptions): Promise<TxProvingResult> {
|
|
58
|
-
if (options.from !== AztecAddress.ZERO && !options.from.equals(this.wallet.getAddress())) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
`The address provided as from does not match the wallet address. Expected ${this.wallet.getAddress().toString()}, got ${options.from.toString()}.`,
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
const txRequest = await this.create(options);
|
|
64
|
-
return await this.wallet.proveTx(txRequest);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// docs:start:prove
|
|
68
|
-
/**
|
|
69
|
-
* Proves a transaction execution request and returns a tx object ready to be sent.
|
|
70
|
-
* @param options - optional arguments to be used in the creation of the transaction
|
|
71
|
-
* @returns The resulting transaction
|
|
72
|
-
*/
|
|
73
|
-
public async prove(options: SendMethodOptions): Promise<ProvenTx> {
|
|
74
|
-
// docs:end:prove
|
|
75
|
-
const txProvingResult = await this.proveInternal(options);
|
|
76
|
-
return new ProvenTx(
|
|
77
|
-
this.wallet,
|
|
78
|
-
await txProvingResult.toTx(),
|
|
79
|
-
txProvingResult.getOffchainEffects(),
|
|
80
|
-
txProvingResult.stats,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
29
|
+
public abstract request(options?: RequestInteractionOptions): Promise<ExecutionPayload>;
|
|
83
30
|
|
|
84
31
|
// docs:start:send
|
|
85
32
|
/**
|
|
@@ -87,93 +34,17 @@ export abstract class BaseContractInteraction {
|
|
|
87
34
|
* This function throws an error if called on a utility function.
|
|
88
35
|
* It creates and signs the transaction if necessary, and returns a SentTx instance,
|
|
89
36
|
* which can be used to track the transaction status, receipt, and events.
|
|
90
|
-
* @param options - An
|
|
91
|
-
* the AztecAddress of the sender
|
|
37
|
+
* @param options - An object containing 'from' property representing
|
|
38
|
+
* the AztecAddress of the sender and optional fee configuration
|
|
92
39
|
* @returns A SentTx instance for tracking the transaction status and information.
|
|
93
40
|
*/
|
|
94
|
-
public send(options:
|
|
41
|
+
public send(options: SendInteractionOptions): SentTx {
|
|
95
42
|
// docs:end:send
|
|
96
43
|
const sendTx = async () => {
|
|
97
|
-
const
|
|
98
|
-
|
|
44
|
+
const executionPayload = await this.request(options);
|
|
45
|
+
const sendOptions = await toSendOptions(options);
|
|
46
|
+
return this.wallet.sendTx(executionPayload, sendOptions);
|
|
99
47
|
};
|
|
100
48
|
return new SentTx(this.wallet, sendTx);
|
|
101
49
|
}
|
|
102
|
-
|
|
103
|
-
// docs:start:estimateGas
|
|
104
|
-
/**
|
|
105
|
-
* Estimates gas for a given tx request and returns gas limits for it.
|
|
106
|
-
* @param options - Options.
|
|
107
|
-
* @returns Gas limits.
|
|
108
|
-
*/
|
|
109
|
-
public async estimateGas(
|
|
110
|
-
options: Omit<SendMethodOptions, 'estimateGas'>,
|
|
111
|
-
): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>> {
|
|
112
|
-
// docs:end:estimateGas
|
|
113
|
-
const txRequest = await this.create({ ...options, fee: { ...options?.fee, estimateGas: true } });
|
|
114
|
-
return {
|
|
115
|
-
gasLimits: txRequest.txContext.gasSettings.gasLimits,
|
|
116
|
-
teardownGasLimits: txRequest.txContext.gasSettings.teardownGasLimits,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Returns default fee options based on the user opts without running a simulation for gas estimation.
|
|
122
|
-
* @param fee - User-provided fee options.
|
|
123
|
-
*/
|
|
124
|
-
protected async getDefaultFeeOptions(fee: UserFeeOptions | undefined): Promise<FeeOptions> {
|
|
125
|
-
const maxFeesPerGas =
|
|
126
|
-
fee?.gasSettings?.maxFeesPerGas ?? (await this.wallet.getCurrentBaseFees()).mul(1 + (fee?.baseFeePadding ?? 0.5));
|
|
127
|
-
const paymentMethod = fee?.paymentMethod ?? new FeeJuicePaymentMethod(this.wallet.getAddress());
|
|
128
|
-
const gasSettings: GasSettings = GasSettings.default({ ...fee?.gasSettings, maxFeesPerGas });
|
|
129
|
-
this.log.debug(`Using L2 gas settings`, gasSettings);
|
|
130
|
-
return { gasSettings, paymentMethod };
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// docs:start:getFeeOptions
|
|
134
|
-
/**
|
|
135
|
-
* Return fee options based on the user opts, estimating tx gas if needed.
|
|
136
|
-
* @param executionPayload - Execution payload to get the fee for
|
|
137
|
-
* @param fee - User-provided fee options.
|
|
138
|
-
* @param options - Additional options for the transaction. They must faithfully represent the tx to get accurate fee estimates
|
|
139
|
-
* @returns Fee options for the actual transaction.
|
|
140
|
-
*/
|
|
141
|
-
protected async getFeeOptions(
|
|
142
|
-
executionPayload: ExecutionPayload,
|
|
143
|
-
fee: UserFeeOptions = {},
|
|
144
|
-
options: TxExecutionOptions,
|
|
145
|
-
): Promise<FeeOptions> {
|
|
146
|
-
// docs:end:getFeeOptions
|
|
147
|
-
const defaultFeeOptions = await this.getDefaultFeeOptions(fee);
|
|
148
|
-
const paymentMethod = defaultFeeOptions.paymentMethod;
|
|
149
|
-
const maxFeesPerGas = defaultFeeOptions.gasSettings.maxFeesPerGas;
|
|
150
|
-
const maxPriorityFeesPerGas = defaultFeeOptions.gasSettings.maxPriorityFeesPerGas;
|
|
151
|
-
|
|
152
|
-
let gasSettings = defaultFeeOptions.gasSettings;
|
|
153
|
-
if (fee?.estimateGas) {
|
|
154
|
-
// Use unrealistically high gas limits for estimation to avoid running out of gas.
|
|
155
|
-
// They will be tuned down after the simulation.
|
|
156
|
-
const gasSettingsForEstimation = new GasSettings(
|
|
157
|
-
new Gas(GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT),
|
|
158
|
-
new Gas(GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT),
|
|
159
|
-
maxFeesPerGas,
|
|
160
|
-
maxPriorityFeesPerGas,
|
|
161
|
-
);
|
|
162
|
-
const feeForEstimation: FeeOptions = { paymentMethod, gasSettings: gasSettingsForEstimation };
|
|
163
|
-
const txRequest = await this.wallet.createTxExecutionRequest(executionPayload, feeForEstimation, options);
|
|
164
|
-
const simulationResult = await this.wallet.simulateTx(
|
|
165
|
-
txRequest,
|
|
166
|
-
true /*simulatePublic*/,
|
|
167
|
-
undefined /* skipTxValidation */,
|
|
168
|
-
true /* skipFeeEnforcement */,
|
|
169
|
-
);
|
|
170
|
-
const { gasLimits, teardownGasLimits } = getGasLimits(simulationResult, fee?.estimatedGasPadding);
|
|
171
|
-
gasSettings = GasSettings.from({ maxFeesPerGas, maxPriorityFeesPerGas, gasLimits, teardownGasLimits });
|
|
172
|
-
this.log.verbose(
|
|
173
|
-
`Estimated gas limits for tx: DA=${gasLimits.daGas} L2=${gasLimits.l2Gas} teardownDA=${teardownGasLimits.daGas} teardownL2=${teardownGasLimits.l2Gas}`,
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return { gasSettings, paymentMethod };
|
|
178
|
-
}
|
|
179
50
|
}
|
|
@@ -1,49 +1,37 @@
|
|
|
1
1
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
2
2
|
import { type FunctionCall, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
3
|
-
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
4
3
|
|
|
5
4
|
import type { Wallet } from '../wallet/wallet.js';
|
|
6
5
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
7
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
type RequestInteractionOptions,
|
|
8
|
+
type SimulateInteractionOptions,
|
|
9
|
+
toSimulateOptions,
|
|
10
|
+
} from './interaction_options.js';
|
|
8
11
|
|
|
9
12
|
/** A batch of function calls to be sent as a single transaction through a wallet. */
|
|
10
13
|
export class BatchCall extends BaseContractInteraction {
|
|
11
14
|
constructor(
|
|
12
15
|
wallet: Wallet,
|
|
13
|
-
protected
|
|
16
|
+
protected interactions: (BaseContractInteraction | ExecutionPayload)[],
|
|
14
17
|
) {
|
|
15
18
|
super(wallet);
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
/**
|
|
19
|
-
* Create a transaction execution request that represents this batch, encoded and authenticated by the
|
|
20
|
-
* user's wallet, ready to be simulated.
|
|
21
|
-
* @param options - An optional object containing additional configuration for the transaction.
|
|
22
|
-
* @returns A Promise that resolves to a transaction instance.
|
|
23
|
-
*/
|
|
24
|
-
public async create(options: SendMethodOptions = { from: this.wallet.getAddress() }): Promise<TxExecutionRequest> {
|
|
25
|
-
const requestWithoutFee = await this.request(options);
|
|
26
|
-
|
|
27
|
-
const { fee: userFee, txNonce, cancellable } = options;
|
|
28
|
-
const fee = await this.getFeeOptions(requestWithoutFee, userFee, { txNonce, cancellable });
|
|
29
|
-
|
|
30
|
-
return await this.wallet.createTxExecutionRequest(requestWithoutFee, fee, { txNonce, cancellable });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
21
|
/**
|
|
34
22
|
* Returns an execution request that represents this operation.
|
|
35
23
|
* @param options - An optional object containing additional configuration for the request generation.
|
|
36
24
|
* @returns An execution payload wrapped in promise.
|
|
37
25
|
*/
|
|
38
|
-
public async request(options:
|
|
39
|
-
const requests = await this.
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
26
|
+
public async request(options: RequestInteractionOptions = {}): Promise<ExecutionPayload> {
|
|
27
|
+
const requests = await this.getExecutionPayloads();
|
|
28
|
+
const feeExecutionPayload = options.fee?.paymentMethod
|
|
29
|
+
? await options.fee.paymentMethod.getExecutionPayload()
|
|
30
|
+
: undefined;
|
|
31
|
+
const finalExecutionPayload = feeExecutionPayload
|
|
32
|
+
? mergeExecutionPayloads([feeExecutionPayload, ...requests])
|
|
33
|
+
: mergeExecutionPayloads([...requests]);
|
|
34
|
+
return finalExecutionPayload;
|
|
47
35
|
}
|
|
48
36
|
|
|
49
37
|
/**
|
|
@@ -55,8 +43,8 @@ export class BatchCall extends BaseContractInteraction {
|
|
|
55
43
|
* @param options - An optional object containing additional configuration for the transaction.
|
|
56
44
|
* @returns The result of the transaction as returned by the contract function.
|
|
57
45
|
*/
|
|
58
|
-
public async simulate(options:
|
|
59
|
-
const { indexedExecutionPayloads, utility } = (await this.
|
|
46
|
+
public async simulate(options: SimulateInteractionOptions): Promise<any> {
|
|
47
|
+
const { indexedExecutionPayloads, utility } = (await this.getExecutionPayloads()).reduce<{
|
|
60
48
|
/** Keep track of the number of private calls to retrieve the return values */
|
|
61
49
|
privateIndex: 0;
|
|
62
50
|
/** Keep track of the number of public calls to retrieve the return values */
|
|
@@ -84,53 +72,56 @@ export class BatchCall extends BaseContractInteraction {
|
|
|
84
72
|
|
|
85
73
|
const payloads = indexedExecutionPayloads.map(([request]) => request);
|
|
86
74
|
const combinedPayload = mergeExecutionPayloads(payloads);
|
|
87
|
-
const
|
|
75
|
+
const executionPayload = new ExecutionPayload(
|
|
88
76
|
combinedPayload.calls,
|
|
89
77
|
combinedPayload.authWitnesses.concat(options.authWitnesses ?? []),
|
|
90
78
|
combinedPayload.capsules.concat(options.capsules ?? []),
|
|
91
79
|
combinedPayload.extraHashedArgs,
|
|
92
80
|
);
|
|
93
|
-
const { fee: userFee, txNonce, cancellable } = options;
|
|
94
|
-
const fee = await this.getFeeOptions(requestWithoutFee, userFee, {});
|
|
95
|
-
const txRequest = await this.wallet.createTxExecutionRequest(requestWithoutFee, fee, {
|
|
96
|
-
txNonce,
|
|
97
|
-
cancellable,
|
|
98
|
-
});
|
|
99
81
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
82
|
+
const utilityBatchPromise =
|
|
83
|
+
utility.length > 0
|
|
84
|
+
? this.wallet.batch(
|
|
85
|
+
utility.map(([call]) => ({
|
|
86
|
+
name: 'simulateUtility' as const,
|
|
87
|
+
args: [call.name, call.args, call.to, options?.authWitnesses] as const,
|
|
88
|
+
})),
|
|
89
|
+
)
|
|
90
|
+
: Promise.resolve([]);
|
|
107
91
|
|
|
108
|
-
const [
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
const [utilityBatchResults, simulatedTx] = await Promise.all([
|
|
93
|
+
utilityBatchPromise,
|
|
94
|
+
indexedExecutionPayloads.length > 0
|
|
95
|
+
? this.wallet.simulateTx(executionPayload, await toSimulateOptions(options))
|
|
96
|
+
: Promise.resolve(),
|
|
111
97
|
]);
|
|
112
98
|
|
|
113
99
|
const results: any[] = [];
|
|
114
100
|
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
utilityBatchResults.forEach((wrappedResult, utilityIndex) => {
|
|
102
|
+
const [, originalIndex] = utility[utilityIndex];
|
|
103
|
+
results[originalIndex] = wrappedResult.result.result;
|
|
117
104
|
});
|
|
118
|
-
indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
|
|
119
|
-
const call = request.calls[0];
|
|
120
|
-
// As account entrypoints are private, for private functions we retrieve the return values from the first nested call
|
|
121
|
-
// since we're interested in the first set of values AFTER the account entrypoint
|
|
122
|
-
// For public functions we retrieve the first values directly from the public output.
|
|
123
|
-
const rawReturnValues =
|
|
124
|
-
call.type == FunctionType.PRIVATE
|
|
125
|
-
? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values
|
|
126
|
-
: simulatedTx.getPublicReturnValues()?.[resultIndex].values;
|
|
127
105
|
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
if (simulatedTx) {
|
|
107
|
+
indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
|
|
108
|
+
const call = request.calls[0];
|
|
109
|
+
// As account entrypoints are private, for private functions we retrieve the return values from the first nested call
|
|
110
|
+
// since we're interested in the first set of values AFTER the account entrypoint
|
|
111
|
+
// For public functions we retrieve the first values directly from the public output.
|
|
112
|
+
const rawReturnValues =
|
|
113
|
+
call.type == FunctionType.PRIVATE
|
|
114
|
+
? simulatedTx.getPrivateReturnValues()?.nested?.[resultIndex].values
|
|
115
|
+
: simulatedTx.getPublicReturnValues()?.[resultIndex].values;
|
|
116
|
+
|
|
117
|
+
results[callIndex] = rawReturnValues ? decodeFromAbi(call.returnTypes, rawReturnValues) : [];
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
130
121
|
return results;
|
|
131
122
|
}
|
|
132
123
|
|
|
133
|
-
|
|
134
|
-
return await Promise.all(this.
|
|
124
|
+
protected async getExecutionPayloads(): Promise<ExecutionPayload[]> {
|
|
125
|
+
return await Promise.all(this.interactions.map(i => (i instanceof ExecutionPayload ? i : i.request())));
|
|
135
126
|
}
|
|
136
127
|
}
|
package/src/contract/contract.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
4
3
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
5
4
|
|
|
6
5
|
import type { Wallet } from '../wallet/wallet.js';
|
|
@@ -11,7 +10,7 @@ import { DeployMethod } from './deploy_method.js';
|
|
|
11
10
|
* The Contract class represents a contract and provides utility methods for interacting with it.
|
|
12
11
|
* It enables the creation of ContractFunctionInteraction instances for each function in the contract's ABI,
|
|
13
12
|
* allowing users to call or send transactions to these functions. Additionally, the Contract class can be used
|
|
14
|
-
* to attach the contract instance to a deployed contract
|
|
13
|
+
* to attach the contract instance to a deployed contract onchain through the PXE, which facilitates
|
|
15
14
|
* interaction with Aztec's privacy protocol.
|
|
16
15
|
*/
|
|
17
16
|
export class Contract extends ContractBase {
|
|
@@ -23,16 +22,7 @@ export class Contract extends ContractBase {
|
|
|
23
22
|
* @returns A promise that resolves to a new Contract instance.
|
|
24
23
|
*/
|
|
25
24
|
public static async at(address: AztecAddress, artifact: ContractArtifact, wallet: Wallet): Promise<Contract> {
|
|
26
|
-
const instance =
|
|
27
|
-
if (instance === undefined) {
|
|
28
|
-
throw new Error(`Contract instance at ${address.toString()} has not been registered in the wallet's PXE`);
|
|
29
|
-
}
|
|
30
|
-
const thisContractClass = await getContractClassFromArtifact(artifact);
|
|
31
|
-
if (!thisContractClass.id.equals(instance.currentContractClassId)) {
|
|
32
|
-
// wallet holds an outdated version of this contract
|
|
33
|
-
await wallet.updateContract(address, artifact);
|
|
34
|
-
instance.currentContractClassId = thisContractClass.id;
|
|
35
|
-
}
|
|
25
|
+
const instance = await wallet.registerContract(address, artifact);
|
|
36
26
|
return new Contract(instance, artifact, wallet);
|
|
37
27
|
}
|
|
38
28
|
|