@layerzerolabs/lz-movevm-sdk-v2 3.0.41 → 3.0.43
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 +24 -0
- package/dist/index.cjs +87 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.mjs +87 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @layerzerolabs/lz-movevm-sdk-v2
|
|
2
2
|
|
|
3
|
+
## 3.0.43
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ce4d3d5: Publish new TON packages with new testnet deployments
|
|
8
|
+
- Updated dependencies [ce4d3d5]
|
|
9
|
+
- @layerzerolabs/lz-definitions@3.0.43
|
|
10
|
+
- @layerzerolabs/lz-serdes@3.0.43
|
|
11
|
+
- @layerzerolabs/lz-utilities@3.0.43
|
|
12
|
+
- @layerzerolabs/lz-v2-utilities@3.0.43
|
|
13
|
+
- @layerzerolabs/move-definitions@3.0.43
|
|
14
|
+
|
|
15
|
+
## 3.0.42
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 6dd4df1: deploy aptos mainnet
|
|
20
|
+
- Updated dependencies [6dd4df1]
|
|
21
|
+
- @layerzerolabs/lz-definitions@3.0.42
|
|
22
|
+
- @layerzerolabs/lz-serdes@3.0.42
|
|
23
|
+
- @layerzerolabs/lz-utilities@3.0.42
|
|
24
|
+
- @layerzerolabs/lz-v2-utilities@3.0.42
|
|
25
|
+
- @layerzerolabs/move-definitions@3.0.42
|
|
26
|
+
|
|
3
27
|
## 3.0.41
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1218,6 +1218,25 @@ var EndpointCommon = class {
|
|
|
1218
1218
|
throw e;
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Create a payload for transferring the LayerZero admin.
|
|
1223
|
+
* @param newAdmin
|
|
1224
|
+
*/
|
|
1225
|
+
createTransferLayerzeroAdminPayload(newAdmin) {
|
|
1226
|
+
return {
|
|
1227
|
+
function: `${this.universalConfigModule[0]}::${this.universalConfigModule[1]}::transfer_layerzero_admin`,
|
|
1228
|
+
functionArguments: [newAdmin],
|
|
1229
|
+
functionArgumentTypes: ["address"]
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
async getLayerzeroAdmin() {
|
|
1233
|
+
const view = await this.sdk.viewFunction({
|
|
1234
|
+
functionName: `${this.universalConfigModule[0]}::${this.universalConfigModule[1]}::layerzero_admin`,
|
|
1235
|
+
functionArgs: [],
|
|
1236
|
+
functionArgTypes: []
|
|
1237
|
+
});
|
|
1238
|
+
return view[0];
|
|
1239
|
+
}
|
|
1221
1240
|
};
|
|
1222
1241
|
var Executor = class {
|
|
1223
1242
|
/**
|
|
@@ -3322,6 +3341,73 @@ var SimpleMsgLib = class {
|
|
|
3322
3341
|
}
|
|
3323
3342
|
};
|
|
3324
3343
|
|
|
3344
|
+
// src/modules/treasury.ts
|
|
3345
|
+
var Treasury = class {
|
|
3346
|
+
/**
|
|
3347
|
+
* Creates an instance of Treasury SDK.
|
|
3348
|
+
*
|
|
3349
|
+
* @remarks
|
|
3350
|
+
* This constructor is intended to be used internally by the SDK and does not need to be called directly.
|
|
3351
|
+
*
|
|
3352
|
+
* @param {MoveSdkImpl<AccountType>} sdk - The SDK implementation.
|
|
3353
|
+
*/
|
|
3354
|
+
constructor(sdk) {
|
|
3355
|
+
this.sdk = sdk;
|
|
3356
|
+
this.module = [sdk.accounts.treasury?.toString() ?? "0x0", "treasury"];
|
|
3357
|
+
}
|
|
3358
|
+
/**
|
|
3359
|
+
* Updates the deposit address.
|
|
3360
|
+
*
|
|
3361
|
+
* @param {AccountType | PrivateKey | MnemonicAndPath} signer - The signer of the transaction.
|
|
3362
|
+
* @param {string} newAddress - The new deposit address.
|
|
3363
|
+
* @param {GasOptions} [gasOptions] - The gas options.
|
|
3364
|
+
* @returns {Promise<TransactionResponse>} The transaction response.
|
|
3365
|
+
*/
|
|
3366
|
+
async updateDepositAddress(signer, newAddress, gasOptions) {
|
|
3367
|
+
return this.sdk.sendAndConfirmTransaction(
|
|
3368
|
+
signer,
|
|
3369
|
+
`${this.module[0]}::${this.module[1]}::update_deposit_address`,
|
|
3370
|
+
[newAddress],
|
|
3371
|
+
["address"],
|
|
3372
|
+
gasOptions
|
|
3373
|
+
);
|
|
3374
|
+
}
|
|
3375
|
+
/**
|
|
3376
|
+
* Gets the fee for the specified total fee and LayerZero token flag.
|
|
3377
|
+
*
|
|
3378
|
+
* @param {bigint} total_fee - The total fee.
|
|
3379
|
+
* @param {boolean} lztoken - The LayerZero token flag.
|
|
3380
|
+
* @returns {Promise<bigint>} The fee.
|
|
3381
|
+
*/
|
|
3382
|
+
async getFee(total_fee, lztoken) {
|
|
3383
|
+
const view = await this.sdk.viewFunction({
|
|
3384
|
+
functionName: `${this.module[0]}::${this.module[1]}::get_fee`,
|
|
3385
|
+
functionArgs: [total_fee, lztoken],
|
|
3386
|
+
functionArgTypes: ["u64", "bool"]
|
|
3387
|
+
});
|
|
3388
|
+
return view[0];
|
|
3389
|
+
}
|
|
3390
|
+
/*
|
|
3391
|
+
* Create a payload for transferring the treasury admin.
|
|
3392
|
+
* @param newAdmin
|
|
3393
|
+
*/
|
|
3394
|
+
createTransferTreasuryAdminPayload(newAdmin) {
|
|
3395
|
+
return {
|
|
3396
|
+
function: `${this.module[0]}::${this.module[1]}::transfer_treasury_admin`,
|
|
3397
|
+
functionArguments: [newAdmin],
|
|
3398
|
+
functionArgumentTypes: ["address"]
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3401
|
+
async getTreasuryAdmin() {
|
|
3402
|
+
const view = await this.sdk.viewFunction({
|
|
3403
|
+
functionName: `${this.module[0]}::${this.module[1]}::layerzero_treasury_admin`,
|
|
3404
|
+
functionArgs: [],
|
|
3405
|
+
functionArgTypes: []
|
|
3406
|
+
});
|
|
3407
|
+
return view[0];
|
|
3408
|
+
}
|
|
3409
|
+
};
|
|
3410
|
+
|
|
3325
3411
|
// src/modules/uln302.ts
|
|
3326
3412
|
var Uln302 = class {
|
|
3327
3413
|
/**
|
|
@@ -3628,6 +3714,7 @@ var LayerZeroModulesSdk = class {
|
|
|
3628
3714
|
this.PriceFeed = new PriceFeed(sdk);
|
|
3629
3715
|
this.WorkerCommon = new WorkerCommon(sdk);
|
|
3630
3716
|
this.EndpointV2Common = new EndpointCommon(sdk);
|
|
3717
|
+
this.Treasury = new Treasury(sdk);
|
|
3631
3718
|
}
|
|
3632
3719
|
};
|
|
3633
3720
|
|