@layerzerolabs/lz-sui-sdk-v2 3.0.135 → 3.0.137
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/CHANGELOG.md +16 -0
- package/deployments/sui-mainnet/blocked_message_lib.json +32 -32
- package/deployments/sui-mainnet/blocked_msglib_ptb_builder.json +32 -32
- package/deployments/sui-mainnet/call.json +20 -21
- package/deployments/sui-mainnet/counter.json +47 -47
- package/deployments/sui-mainnet/dvn.json +20 -19
- package/deployments/sui-mainnet/dvn_call_type.json +24 -24
- package/deployments/sui-mainnet/dvn_fee_lib.json +31 -31
- package/deployments/sui-mainnet/dvn_layerzero.json +25 -25
- package/deployments/sui-mainnet/dvn_ptb_builder.json +19 -19
- package/deployments/sui-mainnet/endpoint_ptb_builder.json +34 -34
- package/deployments/sui-mainnet/endpoint_v2.json +43 -43
- package/deployments/sui-mainnet/executor.json +20 -19
- package/deployments/sui-mainnet/executor_call_type.json +24 -24
- package/deployments/sui-mainnet/executor_fee_lib.json +25 -25
- package/deployments/sui-mainnet/executor_layerzero.json +32 -32
- package/deployments/sui-mainnet/executor_ptb_builder.json +19 -19
- package/deployments/sui-mainnet/layerzero_views.json +25 -25
- package/deployments/sui-mainnet/message_lib_common.json +25 -25
- package/deployments/sui-mainnet/msglib_ptb_builder_call_types.json +19 -19
- package/deployments/sui-mainnet/multi_call.json +45 -0
- package/deployments/sui-mainnet/oapp.json +27 -25
- package/deployments/sui-mainnet/object-BlockedMessageLib.json +5 -5
- package/deployments/sui-mainnet/object-BlockedMsglibPtbBuilder.json +5 -5
- package/deployments/sui-mainnet/object-Counter.json +5 -5
- package/deployments/sui-mainnet/object-CounterAdminCap.json +5 -5
- package/deployments/sui-mainnet/object-CounterOApp.json +5 -5
- package/deployments/sui-mainnet/object-DVN.json +2 -2
- package/deployments/sui-mainnet/object-DVNCap.json +5 -5
- package/deployments/sui-mainnet/object-DVNFeeLib.json +5 -5
- package/deployments/sui-mainnet/object-EndpointPtbBuilder.json +5 -5
- package/deployments/sui-mainnet/object-EndpointPtbBuilderAdminCap.json +5 -5
- package/deployments/sui-mainnet/object-EndpointV2.json +5 -5
- package/deployments/sui-mainnet/object-EndpointV2AdminCap.json +5 -5
- package/deployments/sui-mainnet/object-Executor.json +2 -2
- package/deployments/sui-mainnet/object-ExecutorCap.json +5 -5
- package/deployments/sui-mainnet/object-ExecutorFeeLib.json +5 -5
- package/deployments/sui-mainnet/object-ExecutorOwnerCap.json +2 -2
- package/deployments/sui-mainnet/object-PackageWhitelistValidator.json +5 -5
- package/deployments/sui-mainnet/object-PriceFeed.json +5 -5
- package/deployments/sui-mainnet/object-PriceFeedOwnerCap.json +5 -5
- package/deployments/sui-mainnet/object-SimpleMessageLib.json +5 -5
- package/deployments/sui-mainnet/object-SimpleMessageLibAdminCap.json +5 -5
- package/deployments/sui-mainnet/object-SmlPtbBuilder.json +5 -5
- package/deployments/sui-mainnet/object-Treasury.json +5 -5
- package/deployments/sui-mainnet/object-TreasuryAdminCap.json +5 -5
- package/deployments/sui-mainnet/object-ULN302.json +5 -5
- package/deployments/sui-mainnet/object-ULN302AdminCap.json +5 -5
- package/deployments/sui-mainnet/object-Uln302PtbBuilder.json +5 -5
- package/deployments/sui-mainnet/object-Uln302Verification.json +5 -5
- package/deployments/sui-mainnet/object-WorkerRegistry.json +9 -0
- package/deployments/sui-mainnet/object-ZroCoinMetadata.json +5 -5
- package/deployments/sui-mainnet/object-ZroTreasuryCap.json +5 -5
- package/deployments/sui-mainnet/package_whitelist_validator.json +54 -54
- package/deployments/sui-mainnet/price_feed.json +34 -34
- package/deployments/sui-mainnet/price_feed_call_types.json +24 -24
- package/deployments/sui-mainnet/ptb_move_call.json +19 -19
- package/deployments/sui-mainnet/simple_message_lib.json +39 -39
- package/deployments/sui-mainnet/simple_msglib_ptb_builder.json +32 -32
- package/deployments/sui-mainnet/treasury.json +40 -40
- package/deployments/sui-mainnet/uln_302.json +47 -51
- package/deployments/sui-mainnet/uln_302_ptb_builder.json +32 -32
- package/deployments/sui-mainnet/uln_common.json +49 -0
- package/deployments/sui-mainnet/utils.json +31 -24
- package/deployments/sui-mainnet/worker_common.json +21 -20
- package/deployments/sui-mainnet/worker_registry.json +58 -0
- package/deployments/sui-mainnet/zro.json +37 -37
- package/deployments/sui-sandbox-local/blocked_message_lib.json +23 -23
- package/deployments/sui-sandbox-local/blocked_msglib_ptb_builder.json +23 -23
- package/deployments/sui-sandbox-local/call.json +18 -19
- package/deployments/sui-sandbox-local/counter.json +28 -28
- package/deployments/sui-sandbox-local/dvn.json +10 -10
- package/deployments/sui-sandbox-local/dvn_fee_lib.json +21 -21
- package/deployments/sui-sandbox-local/dvn_layerzero.json +14 -14
- package/deployments/sui-sandbox-local/dvn_ptb_builder.json +10 -10
- package/deployments/sui-sandbox-local/endpoint_ptb_builder.json +24 -24
- package/deployments/sui-sandbox-local/endpoint_v2.json +16 -16
- package/deployments/sui-sandbox-local/executor.json +22 -22
- package/deployments/sui-sandbox-local/executor_call_type.json +28 -28
- package/deployments/sui-sandbox-local/executor_fee_lib.json +27 -27
- package/deployments/sui-sandbox-local/executor_layerzero.json +25 -25
- package/deployments/sui-sandbox-local/executor_ptb_builder.json +14 -14
- package/deployments/sui-sandbox-local/layerzero_views.json +10 -10
- package/deployments/sui-sandbox-local/message_lib_common.json +10 -10
- package/deployments/sui-sandbox-local/msglib_ptb_builder_call_types.json +10 -10
- package/deployments/sui-sandbox-local/{sequential_multi_call.json → multi_call.json} +18 -18
- package/deployments/sui-sandbox-local/oapp.json +19 -19
- package/deployments/sui-sandbox-local/object-BlockedMessageLib.json +4 -4
- package/deployments/sui-sandbox-local/object-BlockedMsglibPtbBuilder.json +4 -4
- package/deployments/sui-sandbox-local/object-Counter.json +4 -4
- package/deployments/sui-sandbox-local/object-CounterAdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-CounterOApp.json +4 -4
- package/deployments/sui-sandbox-local/object-DVN.json +2 -2
- package/deployments/sui-sandbox-local/object-DVNCap.json +4 -4
- package/deployments/sui-sandbox-local/object-DVNFeeLib.json +4 -4
- package/deployments/sui-sandbox-local/object-EndpointPtbBuilder.json +4 -4
- package/deployments/sui-sandbox-local/object-EndpointPtbBuilderAdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-EndpointV2.json +4 -4
- package/deployments/sui-sandbox-local/object-EndpointV2AdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-Executor.json +2 -2
- package/deployments/sui-sandbox-local/object-ExecutorCap.json +5 -5
- package/deployments/sui-sandbox-local/object-ExecutorFeeLib.json +5 -5
- package/deployments/sui-sandbox-local/object-ExecutorOwnerCap.json +2 -2
- package/deployments/sui-sandbox-local/object-PackageWhitelistValidator.json +4 -4
- package/deployments/sui-sandbox-local/object-PriceFeed.json +4 -4
- package/deployments/sui-sandbox-local/object-PriceFeedOwnerCap.json +4 -4
- package/deployments/sui-sandbox-local/object-SimpleMessageLib.json +4 -4
- package/deployments/sui-sandbox-local/object-SimpleMessageLibAdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-SmlPtbBuilder.json +4 -4
- package/deployments/sui-sandbox-local/object-Treasury.json +4 -4
- package/deployments/sui-sandbox-local/object-TreasuryAdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-ULN302.json +4 -4
- package/deployments/sui-sandbox-local/object-ULN302AdminCap.json +4 -4
- package/deployments/sui-sandbox-local/object-Uln302PtbBuilder.json +4 -4
- package/deployments/sui-sandbox-local/object-Uln302Verification.json +4 -4
- package/deployments/sui-sandbox-local/object-WorkerRegistry.json +4 -4
- package/deployments/sui-sandbox-local/package_whitelist_validator.json +41 -41
- package/deployments/sui-sandbox-local/price_feed.json +30 -30
- package/deployments/sui-sandbox-local/price_feed_call_types.json +9 -9
- package/deployments/sui-sandbox-local/ptb_move_call.json +18 -18
- package/deployments/sui-sandbox-local/simple_message_lib.json +17 -17
- package/deployments/sui-sandbox-local/simple_msglib_ptb_builder.json +13 -13
- package/deployments/sui-sandbox-local/treasury.json +27 -27
- package/deployments/sui-sandbox-local/uln_302.json +28 -28
- package/deployments/sui-sandbox-local/uln_302_ptb_builder.json +20 -20
- package/deployments/sui-sandbox-local/uln_common.json +9 -9
- package/deployments/sui-sandbox-local/worker_common.json +18 -18
- package/deployments/sui-sandbox-local/worker_registry.json +23 -23
- package/deployments/sui-testnet/blocked_message_lib.json +26 -26
- package/deployments/sui-testnet/blocked_msglib_ptb_builder.json +22 -22
- package/deployments/sui-testnet/call.json +21 -22
- package/deployments/sui-testnet/counter.json +46 -39
- package/deployments/sui-testnet/dvn.json +13 -13
- package/deployments/sui-testnet/dvn_call_type.json +12 -12
- package/deployments/sui-testnet/dvn_fee_lib.json +22 -22
- package/deployments/sui-testnet/dvn_layerzero.json +17 -17
- package/deployments/sui-testnet/dvn_ptb_builder.json +20 -20
- package/deployments/sui-testnet/endpoint_ptb_builder.json +33 -33
- package/deployments/sui-testnet/endpoint_v2.json +30 -30
- package/deployments/sui-testnet/executor.json +21 -21
- package/deployments/sui-testnet/executor_call_type.json +19 -19
- package/deployments/sui-testnet/executor_fee_lib.json +26 -26
- package/deployments/sui-testnet/executor_layerzero.json +17 -17
- package/deployments/sui-testnet/executor_ptb_builder.json +20 -20
- package/deployments/sui-testnet/layerzero_views.json +13 -13
- package/deployments/sui-testnet/message_lib_common.json +13 -13
- package/deployments/sui-testnet/msglib_ptb_builder_call_types.json +13 -13
- package/deployments/sui-testnet/multi_call.json +45 -0
- package/deployments/sui-testnet/oapp.json +21 -21
- package/deployments/sui-testnet/object-BlockedMessageLib.json +5 -5
- package/deployments/sui-testnet/object-BlockedMsglibPtbBuilder.json +5 -5
- package/deployments/sui-testnet/object-Counter.json +5 -5
- package/deployments/sui-testnet/object-CounterAdminCap.json +5 -5
- package/deployments/sui-testnet/object-CounterOApp.json +5 -5
- package/deployments/sui-testnet/object-DVN.json +2 -2
- package/deployments/sui-testnet/object-DVNCap.json +5 -5
- package/deployments/sui-testnet/object-DVNFeeLib.json +5 -5
- package/deployments/sui-testnet/object-EndpointPtbBuilder.json +5 -5
- package/deployments/sui-testnet/object-EndpointPtbBuilderAdminCap.json +5 -5
- package/deployments/sui-testnet/object-EndpointV2.json +5 -5
- package/deployments/sui-testnet/object-EndpointV2AdminCap.json +5 -5
- package/deployments/sui-testnet/object-Executor.json +2 -2
- package/deployments/sui-testnet/object-ExecutorCap.json +5 -5
- package/deployments/sui-testnet/object-ExecutorFeeLib.json +5 -5
- package/deployments/sui-testnet/object-ExecutorOwnerCap.json +2 -2
- package/deployments/sui-testnet/object-OFT-TokenTwo.json +5 -0
- package/deployments/sui-testnet/object-OFTComposerManager.json +9 -0
- package/deployments/sui-testnet/object-OFTInitTicket-TokenTwo.json +9 -0
- package/deployments/sui-testnet/object-OFTOApp-TokenTwo.json +9 -0
- package/deployments/sui-testnet/object-PackageWhitelistValidator.json +5 -5
- package/deployments/sui-testnet/object-PriceFeed.json +5 -5
- package/deployments/sui-testnet/object-PriceFeedOwnerCap.json +5 -5
- package/deployments/sui-testnet/object-SimpleMessageLib.json +5 -5
- package/deployments/sui-testnet/object-SimpleMessageLibAdminCap.json +5 -5
- package/deployments/sui-testnet/object-SmlPtbBuilder.json +5 -5
- package/deployments/sui-testnet/object-TestCoinMetadata.json +9 -0
- package/deployments/sui-testnet/object-TestCoinTreasuryCap.json +9 -0
- package/deployments/sui-testnet/object-Treasury.json +5 -5
- package/deployments/sui-testnet/object-TreasuryAdminCap.json +5 -5
- package/deployments/sui-testnet/object-ULN302.json +5 -5
- package/deployments/sui-testnet/object-ULN302AdminCap.json +5 -5
- package/deployments/sui-testnet/object-Uln302PtbBuilder.json +5 -5
- package/deployments/sui-testnet/object-Uln302Verification.json +5 -5
- package/deployments/sui-testnet/object-WorkerRegistry.json +5 -5
- package/deployments/sui-testnet/object-ZroCoinMetadata.json +5 -5
- package/deployments/sui-testnet/object-ZroTreasuryCap.json +5 -5
- package/deployments/sui-testnet/oft-TokenTwo.json +82 -0
- package/deployments/sui-testnet/oft_common.json +61 -0
- package/deployments/sui-testnet/package_whitelist_validator.json +50 -50
- package/deployments/sui-testnet/price_feed.json +31 -31
- package/deployments/sui-testnet/price_feed_call_types.json +19 -19
- package/deployments/sui-testnet/ptb_move_call.json +13 -13
- package/deployments/sui-testnet/simple_message_lib.json +22 -22
- package/deployments/sui-testnet/simple_msglib_ptb_builder.json +25 -25
- package/deployments/sui-testnet/test_coin.json +69 -0
- package/deployments/sui-testnet/treasury.json +29 -29
- package/deployments/sui-testnet/uln_302.json +46 -46
- package/deployments/sui-testnet/uln_302_ptb_builder.json +18 -18
- package/deployments/sui-testnet/uln_common.json +21 -21
- package/deployments/sui-testnet/utils.json +20 -20
- package/deployments/sui-testnet/worker_common.json +13 -13
- package/deployments/sui-testnet/worker_registry.json +26 -26
- package/deployments/sui-testnet/zro.json +27 -27
- package/dist/index.cjs +218 -226
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +33 -34
- package/dist/index.d.ts +33 -34
- package/dist/index.mjs +218 -226
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/generated/addresses.ts +169 -169
- package/src/modules/call.ts +2 -2
- package/src/modules/endpoint.ts +46 -53
- package/src/modules/oapps/counter.ts +5 -8
- package/src/modules/oapps/oapp.ts +1 -1
- package/deployments/sui-testnet/sequential_multi_call.json +0 -45
package/src/modules/endpoint.ts
CHANGED
|
@@ -68,12 +68,9 @@ export const EndpointErrorCode = {
|
|
|
68
68
|
MessagingComposer_EComposeNotFound: 3,
|
|
69
69
|
MessagingComposer_EComposerNotRegistered: 4,
|
|
70
70
|
MessagingComposer_EComposerRegistered: 5,
|
|
71
|
-
MessagingComposer_EInvalidLZComposeInfo: 6,
|
|
72
|
-
|
|
73
71
|
// OAppRegistry related errors (with OAppRegistry_ prefix)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
OAppRegistry_EOAppRegistered: 3,
|
|
72
|
+
OAppRegistry_EOAppNotRegistered: 1,
|
|
73
|
+
OAppRegistry_EOAppRegistered: 2,
|
|
77
74
|
|
|
78
75
|
// Endpoint related errors (with Endpoint_ prefix)
|
|
79
76
|
Endpoint_EAlreadyInitialized: 1,
|
|
@@ -120,16 +117,17 @@ export class Endpoint {
|
|
|
120
117
|
* Register an OApp with the endpoint
|
|
121
118
|
* @param tx - The transaction to add the move call to
|
|
122
119
|
* @param oappCap - The OApp capability object ID or transaction argument
|
|
123
|
-
* @param
|
|
120
|
+
* @param oappInfo - OApp information including lz_receive execution information
|
|
121
|
+
* @returns Transaction result containing the messaging channel address
|
|
124
122
|
*/
|
|
125
123
|
registerOAppMoveCall(
|
|
126
124
|
tx: Transaction,
|
|
127
125
|
oappCap: string | TransactionArgument,
|
|
128
|
-
|
|
129
|
-
):
|
|
130
|
-
tx.moveCall({
|
|
126
|
+
oappInfo: Uint8Array | TransactionArgument
|
|
127
|
+
): TransactionResult {
|
|
128
|
+
return tx.moveCall({
|
|
131
129
|
target: this.#target('register_oapp'),
|
|
132
|
-
arguments: [tx.object(this.objects.endpointV2), asObject(tx, oappCap), asBytes(tx,
|
|
130
|
+
arguments: [tx.object(this.objects.endpointV2), asObject(tx, oappCap), asBytes(tx, oappInfo)],
|
|
133
131
|
})
|
|
134
132
|
}
|
|
135
133
|
|
|
@@ -151,25 +149,25 @@ export class Endpoint {
|
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
/**
|
|
154
|
-
* Set
|
|
152
|
+
* Set OApp information for an OApp
|
|
155
153
|
* @param tx - The transaction to add the move call to
|
|
156
154
|
* @param callerCap - The caller capability object ID or transaction argument
|
|
157
155
|
* @param oapp - The OApp address or transaction argument
|
|
158
|
-
* @param
|
|
156
|
+
* @param oappInfo - The OApp information including lz_receive execution information as bytes or transaction argument
|
|
159
157
|
*/
|
|
160
|
-
|
|
158
|
+
setOappInfoMoveCall(
|
|
161
159
|
tx: Transaction,
|
|
162
160
|
callerCap: string | TransactionArgument,
|
|
163
161
|
oapp: string | TransactionArgument,
|
|
164
|
-
|
|
162
|
+
oappInfo: Uint8Array | TransactionArgument
|
|
165
163
|
): void {
|
|
166
164
|
tx.moveCall({
|
|
167
|
-
target: this.#target('
|
|
165
|
+
target: this.#target('set_oapp_info'),
|
|
168
166
|
arguments: [
|
|
169
167
|
tx.object(this.objects.endpointV2),
|
|
170
168
|
asObject(tx, callerCap),
|
|
171
169
|
asAddress(tx, oapp),
|
|
172
|
-
asBytes(tx,
|
|
170
|
+
asBytes(tx, oappInfo),
|
|
173
171
|
],
|
|
174
172
|
})
|
|
175
173
|
}
|
|
@@ -555,33 +553,34 @@ export class Endpoint {
|
|
|
555
553
|
* Register a composer with the endpoint
|
|
556
554
|
* @param tx - The transaction to add the move call to
|
|
557
555
|
* @param composerCap - The composer capability object ID or transaction argument
|
|
558
|
-
* @param
|
|
556
|
+
* @param composerInfo - Composer information including lz_compose execution information as bytes
|
|
557
|
+
* @returns Transaction result containing the compose queue address
|
|
559
558
|
*/
|
|
560
559
|
registerComposerMoveCall(
|
|
561
560
|
tx: Transaction,
|
|
562
561
|
composerCap: string | TransactionArgument,
|
|
563
|
-
|
|
564
|
-
):
|
|
565
|
-
tx.moveCall({
|
|
562
|
+
composerInfo: Uint8Array | TransactionArgument
|
|
563
|
+
): TransactionResult {
|
|
564
|
+
return tx.moveCall({
|
|
566
565
|
target: this.#target('register_composer'),
|
|
567
|
-
arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx,
|
|
566
|
+
arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, composerInfo)],
|
|
568
567
|
})
|
|
569
568
|
}
|
|
570
569
|
|
|
571
570
|
/**
|
|
572
|
-
* Set
|
|
571
|
+
* Set composer information for a composer
|
|
573
572
|
* @param tx - The transaction to add the move call to
|
|
574
573
|
* @param composerCap - The composer capability object ID or transaction argument
|
|
575
|
-
* @param
|
|
574
|
+
* @param composerInfo - Composer information including lz_compose execution information as bytes or transaction argument
|
|
576
575
|
*/
|
|
577
|
-
|
|
576
|
+
setComposerInfoMoveCall(
|
|
578
577
|
tx: Transaction,
|
|
579
578
|
composerCap: string | TransactionArgument,
|
|
580
|
-
|
|
579
|
+
composerInfo: Uint8Array | TransactionArgument
|
|
581
580
|
): void {
|
|
582
581
|
tx.moveCall({
|
|
583
|
-
target: this.#target('
|
|
584
|
-
arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx,
|
|
582
|
+
target: this.#target('set_composer_info'),
|
|
583
|
+
arguments: [tx.object(this.objects.endpointV2), asObject(tx, composerCap), asBytes(tx, composerInfo)],
|
|
585
584
|
})
|
|
586
585
|
}
|
|
587
586
|
|
|
@@ -1032,28 +1031,28 @@ export class Endpoint {
|
|
|
1032
1031
|
}
|
|
1033
1032
|
|
|
1034
1033
|
/**
|
|
1035
|
-
* Get
|
|
1034
|
+
* Get OApp information for an OApp
|
|
1036
1035
|
* @param tx - The transaction to add the move call to
|
|
1037
1036
|
* @param oapp - The OApp address or transaction argument
|
|
1038
|
-
* @returns Transaction result containing the
|
|
1037
|
+
* @returns Transaction result containing the OApp information including lz_receive execution information
|
|
1039
1038
|
*/
|
|
1040
|
-
|
|
1039
|
+
getOappInfoMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult {
|
|
1041
1040
|
return tx.moveCall({
|
|
1042
|
-
target: this.#target('
|
|
1041
|
+
target: this.#target('get_oapp_info'),
|
|
1043
1042
|
arguments: [tx.object(this.objects.endpointV2), asAddress(tx, oapp)],
|
|
1044
1043
|
})
|
|
1045
1044
|
}
|
|
1046
1045
|
|
|
1047
1046
|
/**
|
|
1048
|
-
* Get
|
|
1047
|
+
* Get OApp information for an OApp
|
|
1049
1048
|
* @param oapp - The OApp address
|
|
1050
|
-
* @returns Promise<Uint8Array> - The
|
|
1049
|
+
* @returns Promise<Uint8Array> - The OApp information including lz_receive execution information as bytes
|
|
1051
1050
|
*/
|
|
1052
|
-
async
|
|
1051
|
+
async getOappInfo(oapp: string): Promise<Uint8Array> {
|
|
1053
1052
|
return executeSimulate(
|
|
1054
1053
|
this.client,
|
|
1055
1054
|
(tx) => {
|
|
1056
|
-
return this.
|
|
1055
|
+
return this.getOappInfoMoveCall(tx, oapp)
|
|
1057
1056
|
},
|
|
1058
1057
|
(result) => {
|
|
1059
1058
|
const parsed = bcs.vector(bcs.u8()).parse(result[0].value)
|
|
@@ -1147,28 +1146,28 @@ export class Endpoint {
|
|
|
1147
1146
|
}
|
|
1148
1147
|
|
|
1149
1148
|
/**
|
|
1150
|
-
* Get
|
|
1149
|
+
* Get composer information for a registered composer
|
|
1151
1150
|
* @param tx - The transaction to add the move call to
|
|
1152
1151
|
* @param composer - The composer address or transaction argument
|
|
1153
|
-
* @returns Transaction result containing the
|
|
1152
|
+
* @returns Transaction result containing the composer information
|
|
1154
1153
|
*/
|
|
1155
|
-
|
|
1154
|
+
getComposerInfoMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult {
|
|
1156
1155
|
return tx.moveCall({
|
|
1157
|
-
target: this.#target('
|
|
1156
|
+
target: this.#target('get_composer_info'),
|
|
1158
1157
|
arguments: [tx.object(this.objects.endpointV2), asAddress(tx, composer)],
|
|
1159
1158
|
})
|
|
1160
1159
|
}
|
|
1161
1160
|
|
|
1162
1161
|
/**
|
|
1163
|
-
* Get
|
|
1162
|
+
* Get composer information for a registered composer
|
|
1164
1163
|
* @param composer - The composer address
|
|
1165
|
-
* @returns Promise<Uint8Array> - The
|
|
1164
|
+
* @returns Promise<Uint8Array> - The composer information as bytes
|
|
1166
1165
|
*/
|
|
1167
|
-
async
|
|
1166
|
+
async getComposerInfo(composer: string): Promise<Uint8Array> {
|
|
1168
1167
|
return executeSimulate(
|
|
1169
1168
|
this.client,
|
|
1170
1169
|
(tx) => {
|
|
1171
|
-
this.
|
|
1170
|
+
this.getComposerInfoMoveCall(tx, composer)
|
|
1172
1171
|
},
|
|
1173
1172
|
(result) => {
|
|
1174
1173
|
const parsed = bcs.vector(bcs.u8()).parse(result[0].value)
|
|
@@ -2317,16 +2316,13 @@ export class Endpoint {
|
|
|
2317
2316
|
async populateLzReceiveTransaction(
|
|
2318
2317
|
tx: Transaction,
|
|
2319
2318
|
lzReceiveCall: TransactionResult,
|
|
2320
|
-
oapp: string, // receiver oapp
|
|
2319
|
+
oapp: string | TransactionArgument, // receiver oapp
|
|
2321
2320
|
sender: string | undefined = undefined,
|
|
2322
2321
|
validators: IPTBValidator[] = [],
|
|
2323
2322
|
maxSimulationTimes = DEFAULT_SIMULATION_TIMES
|
|
2324
2323
|
): Promise<MoveCall[]> {
|
|
2325
2324
|
const simulateTx = Transaction.from(tx)
|
|
2326
|
-
|
|
2327
|
-
target: this.#target('get_lz_receive_info'),
|
|
2328
|
-
arguments: [simulateTx.object(this.objects.endpointV2), simulateTx.pure.address(oapp)],
|
|
2329
|
-
})
|
|
2325
|
+
this.getOappInfoMoveCall(simulateTx, oapp)
|
|
2330
2326
|
const moveCalls = await this.moduleManager.getPtbBuilder().simulateLzReceivePtb(simulateTx, sender)
|
|
2331
2327
|
|
|
2332
2328
|
const [_, finalMoveCalls] = await this.moduleManager
|
|
@@ -2361,16 +2357,13 @@ export class Endpoint {
|
|
|
2361
2357
|
async populateLzComposeTransaction(
|
|
2362
2358
|
tx: Transaction,
|
|
2363
2359
|
endpointLzComposeCall: TransactionResult,
|
|
2364
|
-
composer: string,
|
|
2360
|
+
composer: string | TransactionArgument,
|
|
2365
2361
|
sender: string | undefined = undefined,
|
|
2366
2362
|
validators: IPTBValidator[] = [],
|
|
2367
2363
|
maxSimulationTimes = DEFAULT_SIMULATION_TIMES
|
|
2368
2364
|
): Promise<MoveCall[]> {
|
|
2369
2365
|
const simulateTx = Transaction.from(tx)
|
|
2370
|
-
|
|
2371
|
-
target: this.#target('get_lz_compose_info'),
|
|
2372
|
-
arguments: [simulateTx.object(this.objects.endpointV2), simulateTx.pure.address(composer)],
|
|
2373
|
-
})
|
|
2366
|
+
this.getComposerInfoMoveCall(simulateTx, composer)
|
|
2374
2367
|
const moveCalls = await this.moduleManager.getPtbBuilder().simulateLzComposePtb(simulateTx, sender)
|
|
2375
2368
|
|
|
2376
2369
|
const [_, finalMoveCalls] = await this.moduleManager
|
|
@@ -109,7 +109,6 @@ export class Counter {
|
|
|
109
109
|
* @param dstEid - Destination endpoint ID
|
|
110
110
|
* @param msgType - Message type (SEND or SEND_AND_CALL)
|
|
111
111
|
* @param options - Execution options as bytes
|
|
112
|
-
* @param sendValue - Value to send with the message
|
|
113
112
|
* @param nativeFee - Native token fee amount
|
|
114
113
|
* @param zroFee - ZRO token fee amount
|
|
115
114
|
* @param refundAddress - Address for fee refunds
|
|
@@ -120,7 +119,6 @@ export class Counter {
|
|
|
120
119
|
dstEid: EndpointId | TransactionArgument,
|
|
121
120
|
msgType: number | TransactionArgument,
|
|
122
121
|
options: Uint8Array | TransactionArgument,
|
|
123
|
-
sendValue: bigint | TransactionArgument,
|
|
124
122
|
nativeFee: bigint | TransactionArgument,
|
|
125
123
|
zroFee: bigint | TransactionArgument,
|
|
126
124
|
refundAddress: string | TransactionArgument,
|
|
@@ -138,7 +136,6 @@ export class Counter {
|
|
|
138
136
|
asU32(tx, dstEid),
|
|
139
137
|
asU8(tx, msgType),
|
|
140
138
|
asBytes(tx, options),
|
|
141
|
-
asU64(tx, sendValue),
|
|
142
139
|
nativeToken,
|
|
143
140
|
zroToken,
|
|
144
141
|
asAddress(tx, refundAddress),
|
|
@@ -148,19 +145,19 @@ export class Counter {
|
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
/**
|
|
151
|
-
* Set
|
|
148
|
+
* Set composer information for counter
|
|
152
149
|
* @param tx - The transaction to add the move call to
|
|
153
|
-
* @param
|
|
150
|
+
* @param composerInfo - Composer information including lz_compose execution information as bytes
|
|
154
151
|
*/
|
|
155
|
-
|
|
152
|
+
setComposerInfoMoveCall(tx: Transaction, composerInfo: Uint8Array | TransactionArgument): void {
|
|
156
153
|
tx.moveCall({
|
|
157
|
-
target: this.#target('
|
|
154
|
+
target: this.#target('set_composer_info'),
|
|
158
155
|
arguments: [
|
|
159
156
|
tx.object(this.objects.counter),
|
|
160
157
|
tx.object(this.objects.counterOapp),
|
|
161
158
|
tx.object(this.objects.counterAdminCap),
|
|
162
159
|
tx.object(this.objects.endpointV2),
|
|
163
|
-
asBytes(tx,
|
|
160
|
+
asBytes(tx, composerInfo),
|
|
164
161
|
],
|
|
165
162
|
})
|
|
166
163
|
}
|
|
@@ -335,7 +335,7 @@ export class OApp {
|
|
|
335
335
|
|
|
336
336
|
getOAppInfoV1MoveCall(tx: Transaction): TransactionResult {
|
|
337
337
|
const endpoint = this.moduleManager.getEndpoint()
|
|
338
|
-
const oappInfoRaw = endpoint.
|
|
338
|
+
const oappInfoRaw = endpoint.getOappInfoMoveCall(tx, this.oappCallCapId) // the new OAppInfo used to be named as lz_receive_info
|
|
339
339
|
return tx.moveCall({
|
|
340
340
|
target: `${this.packageId}::oapp_info_v1::decode`,
|
|
341
341
|
arguments: [oappInfoRaw],
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sequential_multi_call",
|
|
3
|
-
"address": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
|
|
4
|
-
"originalAddress": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
|
|
5
|
-
"publishedVersion": "1",
|
|
6
|
-
"network": "sui-testnet",
|
|
7
|
-
"digest": "6d5dc218b057ca033f1066b6c02d6541d76e497b986bb06b8ee5a59759aae397",
|
|
8
|
-
"transactionHash": "HKfzq9GBKo3rcuWx56e2YJPqy6N1DRu5Tjhi9tsqH9wb",
|
|
9
|
-
"upgradeCapId": "0x6b31bfdfdbc9f035e5fd27426173c947fb6e58e738d56aed4ade5172f18f0308",
|
|
10
|
-
"deployer": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
|
|
11
|
-
"objectChanges": [
|
|
12
|
-
{
|
|
13
|
-
"type": "mutated",
|
|
14
|
-
"sender": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
|
|
15
|
-
"owner": {
|
|
16
|
-
"AddressOwner": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a"
|
|
17
|
-
},
|
|
18
|
-
"objectType": "0x2::coin::Coin<0x2::sui::SUI>",
|
|
19
|
-
"objectId": "0x83b783a49bdf7efbc2e18987fc7c45cd069f3452fd37c51549fdf8490374b2ae",
|
|
20
|
-
"version": "577853062",
|
|
21
|
-
"previousVersion": "577853061",
|
|
22
|
-
"digest": "6Rk7B8xdJJ2tFy1mwudE46jMeZxJvDMnDFsvjWf7JttQ"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "created",
|
|
26
|
-
"sender": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a",
|
|
27
|
-
"owner": {
|
|
28
|
-
"AddressOwner": "0xcf1ac8c5f6eda68c74a5c64027ab5eb8e1664a50f1248876e9464ee4fb60a16a"
|
|
29
|
-
},
|
|
30
|
-
"objectType": "0x2::package::UpgradeCap",
|
|
31
|
-
"objectId": "0x6b31bfdfdbc9f035e5fd27426173c947fb6e58e738d56aed4ade5172f18f0308",
|
|
32
|
-
"version": "577853062",
|
|
33
|
-
"digest": "Fsuhz4apoMegERostJkrBemqX1Sd9cTVYn2E58o7XhZF"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "published",
|
|
37
|
-
"packageId": "0xd047c658acf4c7233f39f50f1de333e42604f30c2f78f823ed3f329cb8b439f9",
|
|
38
|
-
"version": "1",
|
|
39
|
-
"digest": "CsRcHBi7mKv8NEJQYyTYZUD9TRcBXbizTVkx9Y9oqQ8v",
|
|
40
|
-
"modules": [
|
|
41
|
-
"sequential_multi_call"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|