@sign-global/tokentable-core 1.2.0 → 1.2.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/CHANGELOG.md +12 -0
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants/chain-config.ts +2 -2
- package/src/contracts/sui/BaseDistributorClient.ts +1 -8
- package/src/contracts/sui/DistributorWithFeeClient.ts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -300,11 +300,11 @@ var ChainConfig = {
|
|
|
300
300
|
rpcUrl: solanaMainNet.rpcUrls.default.http[0]
|
|
301
301
|
},
|
|
302
302
|
[suiTestNet.id]: {
|
|
303
|
-
contractAddress: "
|
|
303
|
+
contractAddress: "0xeb9691cd945745a89fd497746d30fb1a1e936865c6c514817d913fadef66df44",
|
|
304
304
|
rpcUrl: suiTestNet.rpcUrls.default.http[0]
|
|
305
305
|
},
|
|
306
306
|
[suiMainNet.id]: {
|
|
307
|
-
contractAddress: "",
|
|
307
|
+
contractAddress: "0x3f73ec78d3e8a99277496edb6183d6075490983c2a29542a1c3f709aa31169b5",
|
|
308
308
|
rpcUrl: suiMainNet.rpcUrls.default.http[0]
|
|
309
309
|
}
|
|
310
310
|
};
|
|
@@ -12433,7 +12433,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12433
12433
|
arguments: [tx.pure(projectIdBytes), tx.object(projectRegistryId)]
|
|
12434
12434
|
});
|
|
12435
12435
|
const result = await this.signAndExecute(tx);
|
|
12436
|
-
console.log(result, "res");
|
|
12437
12436
|
let distributorId;
|
|
12438
12437
|
if (result.effects?.created) {
|
|
12439
12438
|
const createdObj = result.effects.created.find(
|
|
@@ -12474,7 +12473,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12474
12473
|
return this.signAndExecute(tx);
|
|
12475
12474
|
}
|
|
12476
12475
|
async getDistributorInfo() {
|
|
12477
|
-
console.log(this.client, this.distributorId, "distributorId");
|
|
12478
12476
|
const res = await this.client.getObject({
|
|
12479
12477
|
id: this.distributorId,
|
|
12480
12478
|
options: { showContent: true }
|
|
@@ -12489,7 +12487,7 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12489
12487
|
signer: fields?.authorized_signer,
|
|
12490
12488
|
ownerCapId: fields?.owner_cap_id,
|
|
12491
12489
|
version: fields?.version ? String.fromCharCode(...fields.version) : void 0,
|
|
12492
|
-
feeCollector: fields?.
|
|
12490
|
+
feeCollector: fields?.fee_collector_config,
|
|
12493
12491
|
token: coinType,
|
|
12494
12492
|
tokenBalance: fields?.token_balance,
|
|
12495
12493
|
paused: fields?.paused
|
|
@@ -12513,7 +12511,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12513
12511
|
[coinType],
|
|
12514
12512
|
[this.distributorId, claimIdsBytes]
|
|
12515
12513
|
);
|
|
12516
|
-
console.log(res, "claims");
|
|
12517
12514
|
const [data, type] = res;
|
|
12518
12515
|
if (type === "vector<bool>" && data) {
|
|
12519
12516
|
const uint8Array = new Uint8Array(data);
|
|
@@ -12527,7 +12524,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12527
12524
|
[],
|
|
12528
12525
|
[projectRegistryId, Array.from(Buffer.from(projectId, "utf8"))]
|
|
12529
12526
|
);
|
|
12530
|
-
console.log(distributorId, "id");
|
|
12531
12527
|
return distributorId.Some;
|
|
12532
12528
|
}
|
|
12533
12529
|
async getOwnerCapId() {
|
|
@@ -12537,7 +12533,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12537
12533
|
StructType: `${this.packageId}::ownable::OwnerCap`
|
|
12538
12534
|
}
|
|
12539
12535
|
});
|
|
12540
|
-
console.log(objects, "objects");
|
|
12541
12536
|
const ownerCapId = objects.data[0]?.data?.objectId;
|
|
12542
12537
|
return ownerCapId;
|
|
12543
12538
|
}
|
|
@@ -12567,7 +12562,6 @@ var SuiDistributorWithFeeClient = class extends SuiContractClientBase {
|
|
|
12567
12562
|
throw new Error(`Insufficient balance. Required: ${totalFeesStr}, Available coins: ${coins.data.length}`);
|
|
12568
12563
|
}
|
|
12569
12564
|
async claimWithFee(coinType, feeCollector, data) {
|
|
12570
|
-
console.log(data, feeCollector, this.distributorId, "data");
|
|
12571
12565
|
const recipients = data.map((item) => item.recipient);
|
|
12572
12566
|
const claimIds = data.map((item) => item.claimId);
|
|
12573
12567
|
const signatures = data.map((item) => item.signature);
|