@sign-global/tokentable-core 1.2.1 → 1.3.0

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/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: "0x74524ef68146dfcf830ef9ddc80d6b292a9764a9c30f8c0dfb35a555b34d2d25",
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
  };
@@ -331,6 +331,7 @@ var SupportedChains = [
331
331
  var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
332
332
  var CONST = {
333
333
  TWITTER_AUTH_SUCCESS: "twitter:auth:success",
334
+ DISCORD_AUTH_SUCCESS: "discord:auth:success",
334
335
  GOOGLE_AUTH_SUCCESS: "google:auth:success",
335
336
  WELCOME_SIGNATURE_STATEMENT: "Welcome to TokenTable!"
336
337
  };
@@ -3728,6 +3729,7 @@ var AirdropSigIdentityTypeEnum = /* @__PURE__ */ ((AirdropSigIdentityTypeEnum2)
3728
3729
  AirdropSigIdentityTypeEnum2["EVMWallet"] = "EVM Wallet";
3729
3730
  AirdropSigIdentityTypeEnum2["TONWallet"] = "TON Wallet";
3730
3731
  AirdropSigIdentityTypeEnum2["Google"] = "Google Account";
3732
+ AirdropSigIdentityTypeEnum2["Discord"] = "Discord Account";
3731
3733
  return AirdropSigIdentityTypeEnum2;
3732
3734
  })(AirdropSigIdentityTypeEnum || {});
3733
3735
  var ETokenType = /* @__PURE__ */ ((ETokenType2) => {
@@ -10531,6 +10533,12 @@ var connectGoogleApi = async (data, baseURL) => {
10531
10533
  headers: getSidHeader(data.projectId)
10532
10534
  });
10533
10535
  };
10536
+ var connectDiscordApi = async (data, baseURL) => {
10537
+ const client = createApiClient(baseURL);
10538
+ return client.post("/airdrop-open/connect-discord", data, {
10539
+ headers: getSidHeader(data.projectId)
10540
+ });
10541
+ };
10534
10542
  var checkEligibility = async (data, baseURL) => {
10535
10543
  const headers = getSidHeader(data.projectId);
10536
10544
  if (!headers.sid)
@@ -12433,7 +12441,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
12433
12441
  arguments: [tx.pure(projectIdBytes), tx.object(projectRegistryId)]
12434
12442
  });
12435
12443
  const result = await this.signAndExecute(tx);
12436
- console.log(result, "res");
12437
12444
  let distributorId;
12438
12445
  if (result.effects?.created) {
12439
12446
  const createdObj = result.effects.created.find(
@@ -12474,7 +12481,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
12474
12481
  return this.signAndExecute(tx);
12475
12482
  }
12476
12483
  async getDistributorInfo() {
12477
- console.log(this.client, this.distributorId, "distributorId");
12478
12484
  const res = await this.client.getObject({
12479
12485
  id: this.distributorId,
12480
12486
  options: { showContent: true }
@@ -12513,7 +12519,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
12513
12519
  [coinType],
12514
12520
  [this.distributorId, claimIdsBytes]
12515
12521
  );
12516
- console.log(res, "claims");
12517
12522
  const [data, type] = res;
12518
12523
  if (type === "vector<bool>" && data) {
12519
12524
  const uint8Array = new Uint8Array(data);
@@ -12527,7 +12532,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
12527
12532
  [],
12528
12533
  [projectRegistryId, Array.from(Buffer.from(projectId, "utf8"))]
12529
12534
  );
12530
- console.log(distributorId, "id");
12531
12535
  return distributorId.Some;
12532
12536
  }
12533
12537
  async getOwnerCapId() {
@@ -12537,7 +12541,6 @@ var SuiBaseDistributorClient = class extends SuiContractClientBase {
12537
12541
  StructType: `${this.packageId}::ownable::OwnerCap`
12538
12542
  }
12539
12543
  });
12540
- console.log(objects, "objects");
12541
12544
  const ownerCapId = objects.data[0]?.data?.objectId;
12542
12545
  return ownerCapId;
12543
12546
  }
@@ -12567,7 +12570,6 @@ var SuiDistributorWithFeeClient = class extends SuiContractClientBase {
12567
12570
  throw new Error(`Insufficient balance. Required: ${totalFeesStr}, Available coins: ${coins.data.length}`);
12568
12571
  }
12569
12572
  async claimWithFee(coinType, feeCollector, data) {
12570
- console.log(data, feeCollector, this.distributorId, "data");
12571
12573
  const recipients = data.map((item) => item.recipient);
12572
12574
  const claimIds = data.map((item) => item.claimId);
12573
12575
  const signatures = data.map((item) => item.signature);
@@ -12694,6 +12696,7 @@ export {
12694
12696
  checkGetSignatures,
12695
12697
  cleanUrlParams,
12696
12698
  clusterApiUrl,
12699
+ connectDiscordApi,
12697
12700
  connectGoogleApi,
12698
12701
  connectTwitter,
12699
12702
  delay,