@layerzerolabs/lz-movevm-sdk-v2 3.0.87 → 3.0.89
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 +135 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +92 -1
- package/dist/index.d.ts +92 -1
- package/dist/index.mjs +135 -1
- 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.89
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 49985f3: testnets
|
|
8
|
+
- Updated dependencies [49985f3]
|
|
9
|
+
- @layerzerolabs/lz-definitions@3.0.89
|
|
10
|
+
- @layerzerolabs/lz-serdes@3.0.89
|
|
11
|
+
- @layerzerolabs/lz-utilities@3.0.89
|
|
12
|
+
- @layerzerolabs/lz-v2-utilities@3.0.89
|
|
13
|
+
- @layerzerolabs/move-definitions@3.0.89
|
|
14
|
+
|
|
15
|
+
## 3.0.88
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- d0cda5e: ton sdk-tools refactored, added rawDispatch action to funC++
|
|
20
|
+
- Updated dependencies [d0cda5e]
|
|
21
|
+
- @layerzerolabs/lz-definitions@3.0.88
|
|
22
|
+
- @layerzerolabs/lz-serdes@3.0.88
|
|
23
|
+
- @layerzerolabs/lz-utilities@3.0.88
|
|
24
|
+
- @layerzerolabs/lz-v2-utilities@3.0.88
|
|
25
|
+
- @layerzerolabs/move-definitions@3.0.88
|
|
26
|
+
|
|
3
27
|
## 3.0.87
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -362,6 +362,139 @@ var Counter = class {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
|
+
var DvnUpGrader = class {
|
|
366
|
+
/**
|
|
367
|
+
* Creates an instance of DvnWorker SDK.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* This constructor is intended to be used internally by the SDK and does not need to be called directly.
|
|
371
|
+
*
|
|
372
|
+
* @param {MoveSdkImpl<AccountType>} sdk - The SDK implementation.
|
|
373
|
+
*/
|
|
374
|
+
constructor(sdk) {
|
|
375
|
+
this.sdk = sdk;
|
|
376
|
+
this.module = [sdk.accounts.dvn_upgrader?.toString() ?? "0x0", "dvn_upgrader"];
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Gets the VID.
|
|
380
|
+
* VID is endpointId % 30000.
|
|
381
|
+
*
|
|
382
|
+
* @returns {Promise<number>} The VID.
|
|
383
|
+
*/
|
|
384
|
+
async getVid() {
|
|
385
|
+
const view = await this.sdk.viewFunction({
|
|
386
|
+
functionName: `${this.module[0]}::${this.module[1]}::vid`,
|
|
387
|
+
functionArgs: []
|
|
388
|
+
});
|
|
389
|
+
return view[0];
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Gets the owner of the DVN upGrader.
|
|
393
|
+
*
|
|
394
|
+
* @returns {Promise<string>} The owner of the DVN upGrader.
|
|
395
|
+
*/
|
|
396
|
+
async getOwner() {
|
|
397
|
+
const view = await this.sdk.viewFunction({
|
|
398
|
+
functionName: `${this.module[0]}::${this.module[1]}::dvn_owner`,
|
|
399
|
+
functionArgs: []
|
|
400
|
+
});
|
|
401
|
+
return view[0];
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Gets the function signature of the DVN.
|
|
405
|
+
* The function signature is a unique 4 byte representation for
|
|
406
|
+
* each the DVN multisig actions initiable through this contract
|
|
407
|
+
*
|
|
408
|
+
* @param {Uint8Array} functionName - The function name.
|
|
409
|
+
* @returns {Promise<Uint8Array>} The function signature.
|
|
410
|
+
*/
|
|
411
|
+
async getFunctionSignature(functionName) {
|
|
412
|
+
const view = await this.sdk.viewFunction({
|
|
413
|
+
functionName: `${this.module[0]}::${this.module[1]}::function_signature`,
|
|
414
|
+
functionArgs: [functionName],
|
|
415
|
+
functionArgTypes: ["vector<u8>"]
|
|
416
|
+
});
|
|
417
|
+
return view[0];
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Creates an upgrade hash.
|
|
421
|
+
*
|
|
422
|
+
* @param {Uint8Array} metadataSerialized - The serialized metadata of the DVN.
|
|
423
|
+
* @param {Uint8Array[]} code - The code of the DVN.
|
|
424
|
+
* @param {string} dvnAddress - The address of the DVN.
|
|
425
|
+
* @param {number} vid - The VID.
|
|
426
|
+
* @param {bigint} expiration - The expiration.
|
|
427
|
+
* @returns {Promise<Uint8Array>} The upgrade hash.
|
|
428
|
+
*/
|
|
429
|
+
async createUpgradeHash(metadataSerialized, code, dvnAddress, vid, expiration) {
|
|
430
|
+
const view = await this.sdk.viewFunction({
|
|
431
|
+
functionName: `${this.module[0]}::${this.module[1]}::upgrade_hash`,
|
|
432
|
+
functionArgs: [metadataSerialized, code, dvnAddress, vid, expiration],
|
|
433
|
+
functionArgTypes: ["vector<u8>", "vector<vector<u8>>", "address", "u32", "u64"]
|
|
434
|
+
});
|
|
435
|
+
const hash = view[0];
|
|
436
|
+
return hash.bytes;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Creates a transfer ownership hash.
|
|
440
|
+
*
|
|
441
|
+
* @param {string} dvnAddress - The address of the DVN.
|
|
442
|
+
* @param {string} newOwner - The new owner address.
|
|
443
|
+
* @param {number} vid - The VID.
|
|
444
|
+
* @param {bigint} expiration - The expiration.
|
|
445
|
+
* @returns {Promise<Uint8Array>} The transfer ownership hash.
|
|
446
|
+
*/
|
|
447
|
+
async createTransferOwnershipHash(dvnAddress, newOwner, vid, expiration) {
|
|
448
|
+
const view = await this.sdk.viewFunction({
|
|
449
|
+
functionName: `${this.module[0]}::${this.module[1]}::ownership_transfer_hash`,
|
|
450
|
+
functionArgs: [dvnAddress, newOwner, vid, expiration],
|
|
451
|
+
functionArgTypes: ["address", "address", "u32", "u64"]
|
|
452
|
+
});
|
|
453
|
+
const hash = view[0];
|
|
454
|
+
return hash.bytes;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Upgrades the DVN.
|
|
458
|
+
*
|
|
459
|
+
* @param {AccountType | PrivateKey | MnemonicAndPath} signer - The signer of the transaction.
|
|
460
|
+
* @param {Uint8Array} metadataSerialized - The serialized metadata of the DVN.
|
|
461
|
+
* @param {Uint8Array[]} code - The code of the DVN.
|
|
462
|
+
* @param {string} dvnAddress - The address of the DVN.
|
|
463
|
+
* @param {string} signatures - The signatures.
|
|
464
|
+
* @param {number} expiration - The expiration.
|
|
465
|
+
* @param {GasOptions} [gasOptions] - The gas options.
|
|
466
|
+
* @returns {Promise<TransactionResponse>} The transaction response.
|
|
467
|
+
*/
|
|
468
|
+
async upgrade(signer, metadataSerialized, code, dvnAddress, signatures, expiration, gasOptions) {
|
|
469
|
+
return this.sdk.sendAndConfirmTransaction(
|
|
470
|
+
signer,
|
|
471
|
+
`${this.module[0]}::${this.module[1]}::upgrade`,
|
|
472
|
+
[metadataSerialized, code, dvnAddress, lzUtilities.arrayify(signatures), expiration],
|
|
473
|
+
["vector<u8>", "vector<vector<u8>>", "address", "vector<u8>", "u64"],
|
|
474
|
+
gasOptions
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Transfers the ownership of the DVN.
|
|
479
|
+
*
|
|
480
|
+
* @param {AccountType | PrivateKey | MnemonicAndPath} signer - The signer of the transaction.
|
|
481
|
+
* @param {string} dvnAddress - The address of the DVN.
|
|
482
|
+
* @param {string} newOwner - The new owner address.
|
|
483
|
+
* @param {string} signatures - The signatures.
|
|
484
|
+
* @param {number} expiration - The expiration.
|
|
485
|
+
* @param {GasOptions} [gasOptions] - The gas options.
|
|
486
|
+
* @returns {Promise<TransactionResponse>} The transaction response.
|
|
487
|
+
*/
|
|
488
|
+
async transferOwnership(signer, dvnAddress, newOwner, signatures, expiration, gasOptions) {
|
|
489
|
+
return this.sdk.sendAndConfirmTransaction(
|
|
490
|
+
signer,
|
|
491
|
+
`${this.module[0]}::${this.module[1]}::transfer_ownership`,
|
|
492
|
+
[dvnAddress, newOwner, lzUtilities.arrayify(signatures), expiration],
|
|
493
|
+
["address", "address", "vector<u8>", "u64"],
|
|
494
|
+
gasOptions
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
};
|
|
365
498
|
var EDVN_DST_EID_NOT_CONFIGURED = 4;
|
|
366
499
|
var EEXECUTOR_DST_EID_NOT_CONFIGURED = 5;
|
|
367
500
|
var EWORKER_NOT_REGISTERED = 16;
|
|
@@ -3992,6 +4125,7 @@ var LayerZeroModulesSdk = class {
|
|
|
3992
4125
|
this.Executor = new Executor(sdk);
|
|
3993
4126
|
this.SimpleMsgLib = new SimpleMsgLib(sdk);
|
|
3994
4127
|
this.DvnWorker = new DvnWorker(sdk);
|
|
4128
|
+
this.DvnUpGrader = new DvnUpGrader(sdk);
|
|
3995
4129
|
this.Counter = new Counter(sdk);
|
|
3996
4130
|
this.Oft = new Oft(sdk);
|
|
3997
4131
|
this.PriceFeed = new PriceFeed(sdk);
|
|
@@ -4002,6 +4136,7 @@ var LayerZeroModulesSdk = class {
|
|
|
4002
4136
|
};
|
|
4003
4137
|
|
|
4004
4138
|
exports.Counter = Counter;
|
|
4139
|
+
exports.DvnUpGrader = DvnUpGrader;
|
|
4005
4140
|
exports.DvnWorker = DvnWorker;
|
|
4006
4141
|
exports.Endpoint = Endpoint;
|
|
4007
4142
|
exports.Executor = Executor;
|