@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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants/chain-config.ts +2 -2
- package/src/constants/index.ts +1 -0
- package/src/contracts/sui/BaseDistributorClient.ts +0 -7
- package/src/contracts/sui/DistributorWithFeeClient.ts +0 -1
- package/src/services/airdrop/index.ts +7 -0
- package/src/types/index.ts +2 -1
package/package.json
CHANGED
|
@@ -107,11 +107,11 @@ export const ChainConfig = {
|
|
|
107
107
|
rpcUrl: solanaMainNet.rpcUrls.default.http[0]
|
|
108
108
|
},
|
|
109
109
|
[suiTestNet.id]: {
|
|
110
|
-
contractAddress: '
|
|
110
|
+
contractAddress: '0xeb9691cd945745a89fd497746d30fb1a1e936865c6c514817d913fadef66df44',
|
|
111
111
|
rpcUrl: suiTestNet.rpcUrls.default.http[0]
|
|
112
112
|
},
|
|
113
113
|
[suiMainNet.id]: {
|
|
114
|
-
contractAddress: '',
|
|
114
|
+
contractAddress: '0x3f73ec78d3e8a99277496edb6183d6075490983c2a29542a1c3f709aa31169b5',
|
|
115
115
|
rpcUrl: suiMainNet.rpcUrls.default.http[0]
|
|
116
116
|
}
|
|
117
117
|
};
|
package/src/constants/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
|
3
3
|
|
|
4
4
|
export const CONST = {
|
|
5
5
|
TWITTER_AUTH_SUCCESS: 'twitter:auth:success',
|
|
6
|
+
DISCORD_AUTH_SUCCESS: 'discord:auth:success',
|
|
6
7
|
GOOGLE_AUTH_SUCCESS: 'google:auth:success',
|
|
7
8
|
WELCOME_SIGNATURE_STATEMENT: 'Welcome to TokenTable!'
|
|
8
9
|
} as const;
|
|
@@ -20,8 +20,6 @@ export class SuiBaseDistributorClient extends SuiContractClientBase {
|
|
|
20
20
|
|
|
21
21
|
const result = await this.signAndExecute(tx);
|
|
22
22
|
|
|
23
|
-
console.log(result, 'res');
|
|
24
|
-
|
|
25
23
|
let distributorId: string | undefined;
|
|
26
24
|
if (result.effects?.created) {
|
|
27
25
|
const createdObj = result.effects.created.find(
|
|
@@ -71,7 +69,6 @@ export class SuiBaseDistributorClient extends SuiContractClientBase {
|
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
async getDistributorInfo() {
|
|
74
|
-
console.log(this.client, this.distributorId, 'distributorId');
|
|
75
72
|
const res = await this.client.getObject({
|
|
76
73
|
id: this.distributorId!,
|
|
77
74
|
options: { showContent: true }
|
|
@@ -121,7 +118,6 @@ export class SuiBaseDistributorClient extends SuiContractClientBase {
|
|
|
121
118
|
[coinType],
|
|
122
119
|
[this.distributorId!, claimIdsBytes]
|
|
123
120
|
);
|
|
124
|
-
console.log(res, 'claims');
|
|
125
121
|
|
|
126
122
|
const [data, type] = res;
|
|
127
123
|
|
|
@@ -140,7 +136,6 @@ export class SuiBaseDistributorClient extends SuiContractClientBase {
|
|
|
140
136
|
[],
|
|
141
137
|
[projectRegistryId, Array.from(Buffer.from(projectId, 'utf8'))]
|
|
142
138
|
);
|
|
143
|
-
console.log(distributorId, 'id');
|
|
144
139
|
return distributorId.Some;
|
|
145
140
|
}
|
|
146
141
|
|
|
@@ -152,8 +147,6 @@ export class SuiBaseDistributorClient extends SuiContractClientBase {
|
|
|
152
147
|
}
|
|
153
148
|
});
|
|
154
149
|
|
|
155
|
-
console.log(objects, 'objects');
|
|
156
|
-
|
|
157
150
|
// 获取 OwnerCap 对象ID
|
|
158
151
|
const ownerCapId = objects.data[0]?.data?.objectId;
|
|
159
152
|
|
|
@@ -36,7 +36,6 @@ export class SuiDistributorWithFeeClient extends SuiContractClientBase {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async claimWithFee(coinType: string, feeCollector: string, data: ISignatureClaimData[]) {
|
|
39
|
-
console.log(data, feeCollector, this.distributorId, 'data');
|
|
40
39
|
const recipients = data.map((item) => item.recipient);
|
|
41
40
|
const claimIds = data.map((item) => item.claimId);
|
|
42
41
|
const signatures = data.map((item) => item.signature);
|
|
@@ -114,6 +114,13 @@ export const connectGoogleApi = async (data: SocialConnectParams, baseURL?: stri
|
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
export const connectDiscordApi = async (data: SocialConnectParams, baseURL?: string): Promise<SidResponse> => {
|
|
118
|
+
const client = createApiClient(baseURL);
|
|
119
|
+
return client.post('/airdrop-open/connect-discord', data, {
|
|
120
|
+
headers: getSidHeader(data.projectId)
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
117
124
|
export const checkEligibility = async (
|
|
118
125
|
data: { projectId: string },
|
|
119
126
|
baseURL?: string
|
package/src/types/index.ts
CHANGED
|
@@ -80,7 +80,8 @@ export enum AirdropSigIdentityTypeEnum {
|
|
|
80
80
|
SolanaWallet = 'Solana Wallet',
|
|
81
81
|
EVMWallet = 'EVM Wallet',
|
|
82
82
|
TONWallet = 'TON Wallet',
|
|
83
|
-
Google = 'Google Account'
|
|
83
|
+
Google = 'Google Account',
|
|
84
|
+
Discord = 'Discord Account'
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface IProjectExtra {
|