zo-sdk 0.1.85 → 0.1.87
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/dist/consts/deployments-shared-mainnet.json +1 -1
- package/dist/consts/deployments-usdz-mainnet.json +11 -1
- package/dist/consts/price_id_to_object_id.mainnet.json +2 -1
- package/dist/implementations/ZLPAPI.cjs +60 -2
- package/dist/implementations/ZLPAPI.cjs.map +1 -1
- package/dist/implementations/ZLPAPI.d.cts +3 -0
- package/dist/implementations/ZLPAPI.d.cts.map +1 -1
- package/dist/implementations/ZLPAPI.d.mts +3 -0
- package/dist/implementations/ZLPAPI.d.mts.map +1 -1
- package/dist/implementations/ZLPAPI.mjs +60 -2
- package/dist/implementations/ZLPAPI.mjs.map +1 -1
- package/dist/interfaces/zlp.d.cts +3 -0
- package/dist/interfaces/zlp.d.cts.map +1 -1
- package/dist/interfaces/zlp.d.mts +3 -0
- package/dist/interfaces/zlp.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/consts/deployments-shared-mainnet.json +1 -1
- package/src/consts/deployments-usdz-mainnet.json +11 -1
- package/src/consts/price_id_to_object_id.mainnet.json +2 -1
- package/src/implementations/ZLPAPI.ts +83 -2
- package/src/interfaces/zlp.ts +19 -0
|
@@ -2872,7 +2872,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
2872
2872
|
|
|
2873
2873
|
for (const [i, beneficiary] of beneficiaries.entries()) {
|
|
2874
2874
|
const moveCallArgs = {
|
|
2875
|
-
target: `${this.sharedConfig.zoLootboxV2.
|
|
2875
|
+
target: `${this.sharedConfig.zoLootboxV2.upgradedPackage}::lootbox::admin_issue_lootbox`,
|
|
2876
2876
|
typeArguments: [module],
|
|
2877
2877
|
arguments: [
|
|
2878
2878
|
tx.object(this.sharedConfig.zoLootboxV2.adminCap),
|
|
@@ -2905,7 +2905,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
2905
2905
|
}
|
|
2906
2906
|
|
|
2907
2907
|
tx.moveCall({
|
|
2908
|
-
target: `${this.sharedConfig.zoLootboxV2.
|
|
2908
|
+
target: `${this.sharedConfig.zoLootboxV2.upgradedPackage}::lootbox::open_lootbox`,
|
|
2909
2909
|
typeArguments: [module],
|
|
2910
2910
|
arguments: [
|
|
2911
2911
|
tx.object(this.sharedConfig.zoLootboxV2.lootboxTreasury),
|
|
@@ -2917,4 +2917,85 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
2917
2917
|
|
|
2918
2918
|
return tx
|
|
2919
2919
|
}
|
|
2920
|
+
|
|
2921
|
+
// Vesting Lootbox Methods (V2)
|
|
2922
|
+
public adminIssueVestingLootboxV2(
|
|
2923
|
+
coin: string,
|
|
2924
|
+
beneficiaries: string[],
|
|
2925
|
+
unlockedAmounts: number[],
|
|
2926
|
+
lockedAmounts: number[],
|
|
2927
|
+
lockDurationsMs: number[],
|
|
2928
|
+
tx: Transaction,
|
|
2929
|
+
): void {
|
|
2930
|
+
let module = `${this.consts.zoCore.package}::zlp::ZLP`
|
|
2931
|
+
let metadata = this.consts.zoCore.zlpMetadata
|
|
2932
|
+
if (coin !== 'zlp') {
|
|
2933
|
+
module = this.consts.coins[coin].module
|
|
2934
|
+
metadata = this.consts.coins[coin].metadata
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
for (const [i, beneficiary] of beneficiaries.entries()) {
|
|
2938
|
+
tx.moveCall({
|
|
2939
|
+
target: `${this.sharedConfig.zoLootboxV2.upgradedPackage}::lootbox::admin_issue_vesting_lootbox`,
|
|
2940
|
+
typeArguments: [module],
|
|
2941
|
+
arguments: [
|
|
2942
|
+
tx.object(this.sharedConfig.zoLootboxV2.adminCap),
|
|
2943
|
+
tx.object(this.sharedConfig.zoLootboxV2.lootboxTreasury),
|
|
2944
|
+
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
2945
|
+
tx.object(metadata),
|
|
2946
|
+
tx.pure.u64(unlockedAmounts[i]),
|
|
2947
|
+
tx.pure.u64(lockedAmounts[i]),
|
|
2948
|
+
tx.pure.u64(lockDurationsMs[i]),
|
|
2949
|
+
tx.pure.address(beneficiary),
|
|
2950
|
+
],
|
|
2951
|
+
})
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
public claimUnlockedV2(
|
|
2956
|
+
coin: string,
|
|
2957
|
+
vestingLootbox: string,
|
|
2958
|
+
): Transaction {
|
|
2959
|
+
const tx = new Transaction()
|
|
2960
|
+
|
|
2961
|
+
let module = `${this.consts.zoCore.package}::zlp::ZLP`
|
|
2962
|
+
if (coin !== 'zlp') {
|
|
2963
|
+
module = this.consts.coins[coin].module
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
tx.moveCall({
|
|
2967
|
+
target: `${this.sharedConfig.zoLootboxV2.upgradedPackage}::lootbox::claim_unlocked`,
|
|
2968
|
+
typeArguments: [module],
|
|
2969
|
+
arguments: [
|
|
2970
|
+
tx.object(this.sharedConfig.zoLootboxV2.lootboxTreasury),
|
|
2971
|
+
tx.object(vestingLootbox),
|
|
2972
|
+
],
|
|
2973
|
+
})
|
|
2974
|
+
|
|
2975
|
+
return tx
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
public claimVestedV2(
|
|
2979
|
+
coin: string,
|
|
2980
|
+
vestingLootbox: string,
|
|
2981
|
+
): Transaction {
|
|
2982
|
+
const tx = new Transaction()
|
|
2983
|
+
|
|
2984
|
+
let module = `${this.consts.zoCore.package}::zlp::ZLP`
|
|
2985
|
+
if (coin !== 'zlp') {
|
|
2986
|
+
module = this.consts.coins[coin].module
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
tx.moveCall({
|
|
2990
|
+
target: `${this.sharedConfig.zoLootboxV2.upgradedPackage}::lootbox::claim_vested`,
|
|
2991
|
+
typeArguments: [module],
|
|
2992
|
+
arguments: [
|
|
2993
|
+
tx.object(this.sharedConfig.zoLootboxV2.lootboxTreasury),
|
|
2994
|
+
tx.object(vestingLootbox),
|
|
2995
|
+
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
2996
|
+
],
|
|
2997
|
+
})
|
|
2998
|
+
|
|
2999
|
+
return tx
|
|
3000
|
+
}
|
|
2920
3001
|
}
|
package/src/interfaces/zlp.ts
CHANGED
|
@@ -173,6 +173,25 @@ export interface IZLPAPI extends IBaseAPI {
|
|
|
173
173
|
lootbox: string
|
|
174
174
|
) => Transaction
|
|
175
175
|
|
|
176
|
+
adminIssueVestingLootboxV2: (
|
|
177
|
+
coin: string,
|
|
178
|
+
beneficiaries: string[],
|
|
179
|
+
unlockedAmounts: number[],
|
|
180
|
+
lockedAmounts: number[],
|
|
181
|
+
lockDurationsMs: number[],
|
|
182
|
+
tx: Transaction,
|
|
183
|
+
) => void
|
|
184
|
+
|
|
185
|
+
claimUnlockedV2: (
|
|
186
|
+
coin: string,
|
|
187
|
+
vestingLootbox: string,
|
|
188
|
+
) => Transaction
|
|
189
|
+
|
|
190
|
+
claimVestedV2: (
|
|
191
|
+
coin: string,
|
|
192
|
+
vestingLootbox: string,
|
|
193
|
+
) => Transaction
|
|
194
|
+
|
|
176
195
|
depositPtb: (
|
|
177
196
|
coin: string,
|
|
178
197
|
coinObjects: string[],
|