@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @sign-global/tokentable-core
|
|
2
2
|
|
|
3
|
+
## 1.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- refactor: update Sui contract addresses and remove debug logs
|
|
8
|
+
|
|
9
|
+
## 1.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix: update Sui contract address and fee collector field
|
|
14
|
+
|
|
3
15
|
## 1.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -382,11 +382,11 @@ var ChainConfig = {
|
|
|
382
382
|
rpcUrl: solanaMainNet.rpcUrls.default.http[0]
|
|
383
383
|
},
|
|
384
384
|
[suiTestNet.id]: {
|
|
385
|
-
contractAddress: "
|
|
385
|
+
contractAddress: "0xeb9691cd945745a89fd497746d30fb1a1e936865c6c514817d913fadef66df44",
|
|
386
386
|
rpcUrl: suiTestNet.rpcUrls.default.http[0]
|
|
387
387
|
},
|
|
388
388
|
[suiMainNet.id]: {
|
|
389
|
-
contractAddress: "",
|
|
389
|
+
contractAddress: "0x3f73ec78d3e8a99277496edb6183d6075490983c2a29542a1c3f709aa31169b5",
|
|
390
390
|
rpcUrl: suiMainNet.rpcUrls.default.http[0]
|
|
391
391
|
}
|
|
392
392
|
};
|
|
@@ -12476,7 +12476,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12476
12476
|
arguments: [tx.pure(projectIdBytes), tx.object(projectRegistryId)]
|
|
12477
12477
|
});
|
|
12478
12478
|
const result = await this.signAndExecute(tx);
|
|
12479
|
-
console.log(result, "res");
|
|
12480
12479
|
let distributorId;
|
|
12481
12480
|
if (result.effects?.created) {
|
|
12482
12481
|
const createdObj = result.effects.created.find(
|
|
@@ -12517,7 +12516,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12517
12516
|
return this.signAndExecute(tx);
|
|
12518
12517
|
}
|
|
12519
12518
|
async getDistributorInfo() {
|
|
12520
|
-
console.log(this.client, this.distributorId, "distributorId");
|
|
12521
12519
|
const res = await this.client.getObject({
|
|
12522
12520
|
id: this.distributorId,
|
|
12523
12521
|
options: { showContent: true }
|
|
@@ -12532,7 +12530,7 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12532
12530
|
signer: fields?.authorized_signer,
|
|
12533
12531
|
ownerCapId: fields?.owner_cap_id,
|
|
12534
12532
|
version: fields?.version ? String.fromCharCode(...fields.version) : void 0,
|
|
12535
|
-
feeCollector: fields?.
|
|
12533
|
+
feeCollector: fields?.fee_collector_config,
|
|
12536
12534
|
token: coinType,
|
|
12537
12535
|
tokenBalance: fields?.token_balance,
|
|
12538
12536
|
paused: fields?.paused
|
|
@@ -12556,7 +12554,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12556
12554
|
[coinType],
|
|
12557
12555
|
[this.distributorId, claimIdsBytes]
|
|
12558
12556
|
);
|
|
12559
|
-
console.log(res, "claims");
|
|
12560
12557
|
const [data, type] = res;
|
|
12561
12558
|
if (type === "vector<bool>" && data) {
|
|
12562
12559
|
const uint8Array = new Uint8Array(data);
|
|
@@ -12570,7 +12567,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12570
12567
|
[],
|
|
12571
12568
|
[projectRegistryId, Array.from(Buffer.from(projectId, "utf8"))]
|
|
12572
12569
|
);
|
|
12573
|
-
console.log(distributorId, "id");
|
|
12574
12570
|
return distributorId.Some;
|
|
12575
12571
|
}
|
|
12576
12572
|
async getOwnerCapId() {
|
|
@@ -12580,7 +12576,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
|
|
|
12580
12576
|
StructType: `${this.packageId}::ownable::OwnerCap`
|
|
12581
12577
|
}
|
|
12582
12578
|
});
|
|
12583
|
-
console.log(objects, "objects");
|
|
12584
12579
|
const ownerCapId = objects.data[0]?.data?.objectId;
|
|
12585
12580
|
return ownerCapId;
|
|
12586
12581
|
}
|
|
@@ -12610,7 +12605,6 @@ var SuiDistributorWithFeeClient = class extends SuiContractClientBase {
|
|
|
12610
12605
|
throw new Error(`Insufficient balance. Required: ${totalFeesStr}, Available coins: ${coins.data.length}`);
|
|
12611
12606
|
}
|
|
12612
12607
|
async claimWithFee(coinType, feeCollector, data) {
|
|
12613
|
-
console.log(data, feeCollector, this.distributorId, "data");
|
|
12614
12608
|
const recipients = data.map((item) => item.recipient);
|
|
12615
12609
|
const claimIds = data.map((item) => item.claimId);
|
|
12616
12610
|
const signatures = data.map((item) => item.signature);
|