@sign-global/tokentable 0.3.0 → 0.4.0-beta.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/.github/workflows/beta.yml +28 -0
- package/dist/cjs/airdrop/AirdropClient.d.ts +46 -0
- package/dist/cjs/airdrop/AirdropClient.js +251 -0
- package/dist/cjs/airdrop/AirdropClient.js.map +1 -0
- package/dist/cjs/airdrop/SignatureAirdropClient.d.ts +24 -0
- package/dist/cjs/airdrop/SignatureAirdropClient.js +109 -0
- package/dist/cjs/airdrop/SignatureAirdropClient.js.map +1 -0
- package/dist/cjs/airdrop/common/index.d.ts +1 -1
- package/dist/cjs/airdrop/constants/index.d.ts +4 -0
- package/dist/cjs/airdrop/constants/index.js +5 -1
- package/dist/cjs/airdrop/constants/index.js.map +1 -1
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +15 -0
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js +51 -0
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -0
- package/dist/cjs/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.d.ts +32 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.js +71 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletBase.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.d.ts +8 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.js +38 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/WalletFactory.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.d.ts +2 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.js +21 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/index.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.d.ts +26 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js +70 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.d.ts +9 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js +35 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.d.ts +3 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.js +14 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/index.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.d.ts +27 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js +119 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.d.ts +23 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js +117 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.d.ts +9 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js +29 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.d.ts +38 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.js +30 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/types.js.map +1 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.d.ts +8 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.js +41 -0
- package/dist/cjs/airdrop/core/useWeb3ConnectWallet/utils/index.js.map +1 -0
- package/dist/cjs/airdrop/index.d.ts +4 -46
- package/dist/cjs/airdrop/index.js +22 -241
- package/dist/cjs/airdrop/index.js.map +1 -1
- package/dist/cjs/airdrop/services/index.d.ts +15 -0
- package/dist/cjs/airdrop/services/index.js +16 -1
- package/dist/cjs/airdrop/services/index.js.map +1 -1
- package/dist/cjs/airdrop/types/index.d.ts +19 -4
- package/dist/cjs/airdrop/types/index.js +7 -1
- package/dist/cjs/airdrop/types/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/utils.d.ts +1 -0
- package/dist/cjs/utils/utils.js +2 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/airdrop/AirdropClient.d.ts +46 -0
- package/dist/esm/airdrop/AirdropClient.js +247 -0
- package/dist/esm/airdrop/AirdropClient.js.map +1 -0
- package/dist/esm/airdrop/SignatureAirdropClient.d.ts +24 -0
- package/dist/esm/airdrop/SignatureAirdropClient.js +105 -0
- package/dist/esm/airdrop/SignatureAirdropClient.js.map +1 -0
- package/dist/esm/airdrop/common/index.d.ts +1 -1
- package/dist/esm/airdrop/constants/index.d.ts +4 -0
- package/dist/esm/airdrop/constants/index.js +4 -0
- package/dist/esm/airdrop/constants/index.js.map +1 -1
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +15 -0
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js +44 -0
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -0
- package/dist/esm/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.d.ts +32 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.js +67 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletBase.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.d.ts +8 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.js +34 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/WalletFactory.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.d.ts +2 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.js +3 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/index.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.d.ts +26 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js +65 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.d.ts +9 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js +29 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/evm/index.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.d.ts +3 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.js +5 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/index.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.d.ts +27 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js +109 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/solana/index.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.d.ts +23 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js +112 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.d.ts +9 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js +24 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/providers/ton/index.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.d.ts +38 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.js +27 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/types.js.map +1 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.d.ts +8 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.js +35 -0
- package/dist/esm/airdrop/core/useWeb3ConnectWallet/utils/index.js.map +1 -0
- package/dist/esm/airdrop/index.d.ts +4 -46
- package/dist/esm/airdrop/index.js +4 -239
- package/dist/esm/airdrop/index.js.map +1 -1
- package/dist/esm/airdrop/services/index.d.ts +15 -0
- package/dist/esm/airdrop/services/index.js +12 -0
- package/dist/esm/airdrop/services/index.js.map +1 -1
- package/dist/esm/airdrop/types/index.d.ts +19 -4
- package/dist/esm/airdrop/types/index.js +6 -0
- package/dist/esm/airdrop/types/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +1 -0
- package/dist/esm/utils/utils.js +1 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/package.json +15 -3
- package/src/airdrop/AirdropClient.ts +307 -0
- package/src/airdrop/SignatureAirdropClient.ts +120 -0
- package/src/airdrop/constants/index.ts +5 -0
- package/src/airdrop/core/evm/contracts/AirdropSignatureClient.ts +59 -0
- package/src/airdrop/core/evm/contracts/abis/FungibleTokenECDSADistributor.json +564 -0
- package/src/airdrop/core/useWeb3ConnectWallet/WalletBase.ts +92 -0
- package/src/airdrop/core/useWeb3ConnectWallet/WalletFactory.tsx +35 -0
- package/src/airdrop/core/useWeb3ConnectWallet/index.ts +3 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/evm/EvmWallet.ts +90 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/evm/index.tsx +43 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/index.ts +4 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/solana/index.tsx +141 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/ton/TonWallet.ts +149 -0
- package/src/airdrop/core/useWeb3ConnectWallet/providers/ton/index.tsx +41 -0
- package/src/airdrop/core/useWeb3ConnectWallet/types.ts +45 -0
- package/src/airdrop/core/useWeb3ConnectWallet/utils/index.ts +61 -0
- package/src/airdrop/index.ts +4 -304
- package/src/airdrop/services/index.ts +29 -1
- package/src/airdrop/types/index.ts +23 -5
- package/src/index.ts +9 -1
- package/src/utils/utils.ts +2 -0
- package/tsconfig.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtendedWalletType = exports.ChainType = exports.WalletType = void 0;
|
|
4
|
+
var WalletType;
|
|
5
|
+
(function (WalletType) {
|
|
6
|
+
WalletType["EVM"] = "evm";
|
|
7
|
+
WalletType["BITCOIN"] = "bitcoin";
|
|
8
|
+
WalletType["SOLANA"] = "solana";
|
|
9
|
+
WalletType["TON"] = "ton";
|
|
10
|
+
WalletType["APTOS"] = "aptos";
|
|
11
|
+
WalletType["PARTICLE"] = "particle-evm";
|
|
12
|
+
WalletType["OKX"] = "okx";
|
|
13
|
+
WalletType["Cyber"] = "cyber";
|
|
14
|
+
WalletType["StarkNet"] = "starknet";
|
|
15
|
+
WalletType["WALLETCONNECT"] = "walletconnect";
|
|
16
|
+
WalletType["Cardano"] = "cardano";
|
|
17
|
+
})(WalletType || (exports.WalletType = WalletType = {}));
|
|
18
|
+
var ChainType;
|
|
19
|
+
(function (ChainType) {
|
|
20
|
+
ChainType["Evm"] = "evm";
|
|
21
|
+
ChainType["Ton"] = "ton";
|
|
22
|
+
// Starknet = 'starknet',
|
|
23
|
+
ChainType["Solana"] = "solana";
|
|
24
|
+
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
25
|
+
var ExtendedWalletType;
|
|
26
|
+
(function (ExtendedWalletType) {
|
|
27
|
+
ExtendedWalletType["UNISAT"] = "unisat";
|
|
28
|
+
ExtendedWalletType["OKXBTC"] = "okx_btc";
|
|
29
|
+
})(ExtendedWalletType || (exports.ExtendedWalletType = ExtendedWalletType = {}));
|
|
30
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/airdrop/core/useWeb3ConnectWallet/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAYX;AAZD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,uCAAyB,CAAA;IACzB,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,mCAAqB,CAAA;IACrB,6CAA+B,CAAA;IAC/B,iCAAmB,CAAA;AACrB,CAAC,EAZW,UAAU,0BAAV,UAAU,QAYrB;AAED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,yBAAyB;IACzB,8BAAiB,CAAA;AACnB,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AACD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,wCAAkB,CAAA;AACpB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISignInMessage } from '../types';
|
|
2
|
+
export declare const getCustomNaNoId: () => string;
|
|
3
|
+
export declare function prepareSignMessage({ chainId, address, statement }: {
|
|
4
|
+
address: string;
|
|
5
|
+
chainId: number | string;
|
|
6
|
+
statement?: string;
|
|
7
|
+
}): ISignInMessage;
|
|
8
|
+
export declare const get4361Message: ({ domain, version, nonce, issuedAt, statement, chainId, uri, address }: ISignInMessage) => string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.get4361Message = exports.getCustomNaNoId = void 0;
|
|
4
|
+
exports.prepareSignMessage = prepareSignMessage;
|
|
5
|
+
const nanoid_1 = require("nanoid");
|
|
6
|
+
const getCustomNaNoId = () => {
|
|
7
|
+
const nanoid = (0, nanoid_1.customAlphabet)('1234567890abcdefghijklmnopqrstuvwxyz', 10);
|
|
8
|
+
return nanoid();
|
|
9
|
+
};
|
|
10
|
+
exports.getCustomNaNoId = getCustomNaNoId;
|
|
11
|
+
function prepareSignMessage({ chainId, address, statement }) {
|
|
12
|
+
return {
|
|
13
|
+
statement: statement || 'Welcome to EthSign',
|
|
14
|
+
chainId: chainId,
|
|
15
|
+
address: address,
|
|
16
|
+
issuedAt: new Date().toISOString(),
|
|
17
|
+
domain: window.location.host,
|
|
18
|
+
uri: window.location.origin,
|
|
19
|
+
version: '1',
|
|
20
|
+
nonce: (0, exports.getCustomNaNoId)()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const get4361Message = ({ domain, version, nonce, issuedAt, statement, chainId, uri, address }) => {
|
|
24
|
+
const header = `${domain} wants you to sign in with your Ethereum account:`;
|
|
25
|
+
const uriField = `URI: ${uri}`;
|
|
26
|
+
let prefix = [header, address].join('\n');
|
|
27
|
+
const versionField = `Version: ${version}`;
|
|
28
|
+
// const addressField = `Address: ` + address;
|
|
29
|
+
const chainField = `Chain ID: ` + chainId || '1';
|
|
30
|
+
const nonceField = `Nonce: ${nonce}`;
|
|
31
|
+
const suffixArray = [uriField, versionField, chainField, nonceField];
|
|
32
|
+
suffixArray.push(`Issued At: ${issuedAt}`);
|
|
33
|
+
const suffix = suffixArray.join('\n');
|
|
34
|
+
prefix = [prefix, statement].join('\n\n');
|
|
35
|
+
if (statement) {
|
|
36
|
+
prefix += '\n';
|
|
37
|
+
}
|
|
38
|
+
return [prefix, suffix].join('\n');
|
|
39
|
+
};
|
|
40
|
+
exports.get4361Message = get4361Message;
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/airdrop/core/useWeb3ConnectWallet/utils/index.ts"],"names":[],"mappings":";;;AAQA,gDAmBC;AA1BD,mCAAwC;AAEjC,MAAM,eAAe,GAAG,GAAW,EAAE;IAC1C,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,sCAAsC,EAAE,EAAE,CAAC,CAAC;IAC1E,OAAO,MAAM,EAAE,CAAC;AAClB,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B;AAEF,SAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,OAAO,EACP,SAAS,EAKV;IACC,OAAO;QACL,SAAS,EAAE,SAAS,IAAI,oBAAoB;QAC5C,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAClC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;QAC5B,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;QAC3B,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,IAAA,uBAAe,GAAE;KACzB,CAAC;AACJ,CAAC;AAEM,MAAM,cAAc,GAAG,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,EACH,OAAO,EACQ,EAAU,EAAE;IAC3B,MAAM,MAAM,GAAG,GAAG,MAAM,mDAAmD,CAAC;IAC5E,MAAM,QAAQ,GAAG,QAAQ,GAAG,EAAE,CAAC;IAC/B,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,YAAY,OAAO,EAAE,CAAC;IAE3C,8CAA8C;IAE9C,MAAM,UAAU,GAAG,YAAY,GAAG,OAAO,IAAI,GAAG,CAAC;IAEjD,MAAM,UAAU,GAAG,UAAU,KAAK,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAErE,WAAW,CAAC,IAAI,CAAC,cAAc,QAAQ,EAAE,CAAC,CAAC;IAE3C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,IAAI,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC;AA/BW,QAAA,cAAc,kBA+BzB"}
|
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
private tonClient?;
|
|
6
|
-
private slug?;
|
|
7
|
-
private projectId?;
|
|
8
|
-
private endpoint?;
|
|
9
|
-
private project;
|
|
10
|
-
protected claims?: IAirdropClaim[];
|
|
11
|
-
private projectPromise;
|
|
12
|
-
private claimHook;
|
|
13
|
-
private contractConfig;
|
|
14
|
-
constructor(params: IAirdropOptions);
|
|
15
|
-
setTonClient(tonClient: TonClient): void;
|
|
16
|
-
private getTonClient;
|
|
17
|
-
private fetchProjectFromSlug;
|
|
18
|
-
private fetchProjectDetails;
|
|
19
|
-
protected initializeProjects(address?: string): Promise<void>;
|
|
20
|
-
getProjectInfo(): Promise<IProject>;
|
|
21
|
-
getAirdropClaims(data: {
|
|
22
|
-
address: string;
|
|
23
|
-
}): Promise<IAirdropClaim[]>;
|
|
24
|
-
getStrategy(walletClient?: IWalletClient): Promise<IAirdropStrategy>;
|
|
25
|
-
private getClaimDataById;
|
|
26
|
-
setClaimHook(fn: (v: any) => any): void;
|
|
27
|
-
private getDefaultExtraData;
|
|
28
|
-
private calculateClaimFee;
|
|
29
|
-
claimAirdrop({ claimId, walletClient }: {
|
|
30
|
-
claimId: string;
|
|
31
|
-
walletClient: IWalletClient;
|
|
32
|
-
}, options?: {
|
|
33
|
-
onLoading?: () => void;
|
|
34
|
-
}): Promise<any>;
|
|
35
|
-
checkClaimed(claimId: string): Promise<boolean>;
|
|
36
|
-
private getContractConfig;
|
|
37
|
-
getVersion(): Promise<string>;
|
|
38
|
-
getPaused(): Promise<boolean>;
|
|
39
|
-
getClaimFee(amount?: bigint): Promise<string | bigint>;
|
|
40
|
-
batchCheckClaimed(): Promise<{
|
|
41
|
-
result: boolean;
|
|
42
|
-
status: string;
|
|
43
|
-
}[]>;
|
|
44
|
-
getNFT(): Promise<string>;
|
|
45
|
-
getKycThreshold(): Promise<bigint>;
|
|
46
|
-
}
|
|
1
|
+
export { AirdropClient } from './AirdropClient';
|
|
2
|
+
export { SignatureAirdropClient } from './SignatureAirdropClient';
|
|
3
|
+
export { CONST } from './constants';
|
|
4
|
+
export * from './core/useWeb3ConnectWallet';
|
|
@@ -1,244 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AirdropClient = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
slug;
|
|
12
|
-
projectId;
|
|
13
|
-
endpoint;
|
|
14
|
-
project;
|
|
15
|
-
claims;
|
|
16
|
-
projectPromise;
|
|
17
|
-
claimHook;
|
|
18
|
-
contractConfig = null;
|
|
19
|
-
constructor(params) {
|
|
20
|
-
if ('slug' in params) {
|
|
21
|
-
this.slug = params.slug;
|
|
22
|
-
}
|
|
23
|
-
this.projectId = params.projectId;
|
|
24
|
-
this.endpoint = params.endpoint;
|
|
25
|
-
this.projectPromise = this.initializeProjects();
|
|
26
|
-
}
|
|
27
|
-
setTonClient(tonClient) {
|
|
28
|
-
this.tonClient = tonClient;
|
|
29
|
-
}
|
|
30
|
-
getTonClient() {
|
|
31
|
-
if (!this.tonClient) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
return this.tonClient;
|
|
35
|
-
}
|
|
36
|
-
async fetchProjectFromSlug(address) {
|
|
37
|
-
if (!this.slug)
|
|
38
|
-
return undefined;
|
|
39
|
-
const res = await (0, services_1.getAirdropPro)(this.slug, this.endpoint);
|
|
40
|
-
const projectMap = res?.childProjectMapping || {};
|
|
41
|
-
return (0, common_1.getTonProjectIdByAddress)({
|
|
42
|
-
address,
|
|
43
|
-
slug: this.slug,
|
|
44
|
-
data: projectMap
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async fetchProjectDetails(projectId) {
|
|
48
|
-
this.project = await (0, services_1.getAirdropProject)(projectId, this.endpoint);
|
|
49
|
-
}
|
|
50
|
-
async initializeProjects(address) {
|
|
51
|
-
try {
|
|
52
|
-
let projectId = this.projectId;
|
|
53
|
-
// If slug is provided, try to fetch project ID from slug
|
|
54
|
-
if (!projectId) {
|
|
55
|
-
projectId = await this.fetchProjectFromSlug(address);
|
|
56
|
-
}
|
|
57
|
-
if (!projectId) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
// Fetch project details
|
|
61
|
-
await this.fetchProjectDetails(projectId);
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
throw new Error(`Failed to initialize project: ${error.message}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async getProjectInfo() {
|
|
68
|
-
await this.projectPromise;
|
|
69
|
-
if (!this.project)
|
|
70
|
-
throw new Error('Project not found');
|
|
71
|
-
return this.project;
|
|
72
|
-
}
|
|
73
|
-
async getAirdropClaims(data) {
|
|
74
|
-
if (this.slug) {
|
|
75
|
-
await this.initializeProjects(data.address); // Fetch project details by address & slug
|
|
76
|
-
}
|
|
77
|
-
const project = await this.getProjectInfo();
|
|
78
|
-
const res = await (0, services_1.getAirdropQuery)({
|
|
79
|
-
recipient: data.address,
|
|
80
|
-
projectId: project.id,
|
|
81
|
-
recipientType: project.recipientType
|
|
82
|
-
}, this.endpoint);
|
|
83
|
-
const claimsRes = res.claims?.map((it) => ({
|
|
84
|
-
...it,
|
|
85
|
-
project: project,
|
|
86
|
-
claimId: project.chainType === types_1.ChainType.Evm ? `${project.id}:${it.leaf}` : `${project.id}:${it.index}`
|
|
87
|
-
}));
|
|
88
|
-
this.claims = claimsRes;
|
|
89
|
-
return this.claims;
|
|
90
|
-
}
|
|
91
|
-
async getStrategy(walletClient) {
|
|
92
|
-
const project = await this.getProjectInfo();
|
|
93
|
-
const version = this.contractConfig?.version || undefined;
|
|
94
|
-
const hasWallet = !!walletClient;
|
|
95
|
-
// Try to get cached strategy
|
|
96
|
-
let strategy = StrategyCache_1.strategyCache.getStrategy(project.contractAddress, project.chainId, project.chainType, hasWallet);
|
|
97
|
-
if (!strategy) {
|
|
98
|
-
// Create new strategy if not cached
|
|
99
|
-
strategy = AirdropStrategyFactory_1.AirdropStrategyFactory.createStrategy({
|
|
100
|
-
chainType: project.chainType,
|
|
101
|
-
contractAddress: project.contractAddress,
|
|
102
|
-
chainId: project.chainId,
|
|
103
|
-
walletClient,
|
|
104
|
-
tonClient: this.getTonClient(),
|
|
105
|
-
version
|
|
106
|
-
});
|
|
107
|
-
// Initialize the strategy
|
|
108
|
-
await strategy.initialize(walletClient);
|
|
109
|
-
// Cache the initialized strategy
|
|
110
|
-
StrategyCache_1.strategyCache.setStrategy(project.contractAddress, project.chainId, project.chainType, strategy, hasWallet);
|
|
111
|
-
}
|
|
112
|
-
else if (hasWallet) {
|
|
113
|
-
// If we have a wallet and the strategy exists, just initialize with the new wallet
|
|
114
|
-
await strategy.initialize(walletClient);
|
|
115
|
-
}
|
|
116
|
-
return strategy;
|
|
117
|
-
}
|
|
118
|
-
getClaimDataById(claimId) {
|
|
119
|
-
const claimData = this.claims?.find((it) => it.claimId === claimId);
|
|
120
|
-
if (!claimData)
|
|
121
|
-
throw new Error('Claim data not found');
|
|
122
|
-
return claimData;
|
|
123
|
-
}
|
|
124
|
-
setClaimHook(fn) {
|
|
125
|
-
this.claimHook = fn;
|
|
126
|
-
}
|
|
127
|
-
getDefaultExtraData() {
|
|
128
|
-
return {
|
|
129
|
-
isLegacy: true,
|
|
130
|
-
attestationId: BigInt(1)
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
async calculateClaimFee(project, claimAmount) {
|
|
134
|
-
if (project.chainType === types_1.ChainType.Evm) {
|
|
135
|
-
const version = await this.getVersion();
|
|
136
|
-
const isNativeFreeVersion = project.tokenType === types_1.ETokenType.Native &&
|
|
137
|
-
[types_1.EvmAirdropVersionEnum.V3, types_1.EvmAirdropVersionEnum.V4].includes(version);
|
|
138
|
-
return isNativeFreeVersion ? undefined : await this.getClaimFee(BigInt(claimAmount));
|
|
139
|
-
}
|
|
140
|
-
if (project.chainType === types_1.ChainType.Ton) {
|
|
141
|
-
return await this.getClaimFee(BigInt(claimAmount));
|
|
142
|
-
}
|
|
143
|
-
return undefined;
|
|
144
|
-
}
|
|
145
|
-
async claimAirdrop({ claimId, walletClient }, options) {
|
|
146
|
-
// Get claim data and initialize strategy
|
|
147
|
-
const claimData = this.getClaimDataById(claimId);
|
|
148
|
-
const strategy = await this.getStrategy(walletClient);
|
|
149
|
-
const project = await this.getProjectInfo();
|
|
150
|
-
// Process extra data
|
|
151
|
-
const extraData = project.chainType === types_1.ChainType.Ton
|
|
152
|
-
? undefined
|
|
153
|
-
: this.claimHook
|
|
154
|
-
? this.claimHook(claimData)
|
|
155
|
-
: this.getDefaultExtraData();
|
|
156
|
-
// Calculate claim value based on project type
|
|
157
|
-
const value = await this.calculateClaimFee(project, claimData.amount);
|
|
158
|
-
// Execute claim with processed data
|
|
159
|
-
return strategy.claim({
|
|
160
|
-
...claimData,
|
|
161
|
-
extraData,
|
|
162
|
-
value
|
|
163
|
-
}, options);
|
|
164
|
-
}
|
|
165
|
-
async checkClaimed(claimId) {
|
|
166
|
-
const claimData = this.getClaimDataById(claimId);
|
|
167
|
-
const strategy = await this.getStrategy();
|
|
168
|
-
return strategy.checkClaimed(claimData);
|
|
169
|
-
}
|
|
170
|
-
async getContractConfig() {
|
|
171
|
-
try {
|
|
172
|
-
const project = await this.getProjectInfo();
|
|
173
|
-
if (!this.contractConfig) {
|
|
174
|
-
this.contractConfig = await (0, services_1.getAirdropContractConfig)({
|
|
175
|
-
chainId: project.chainId,
|
|
176
|
-
chainType: project.chainType,
|
|
177
|
-
contractAddress: project.contractAddress
|
|
178
|
-
}, this.endpoint);
|
|
179
|
-
}
|
|
180
|
-
return this.contractConfig;
|
|
181
|
-
}
|
|
182
|
-
catch (error) {
|
|
183
|
-
console.error('Error fetching contract config:', error);
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
async getVersion() {
|
|
188
|
-
const config = await this.getContractConfig();
|
|
189
|
-
if (config?.version) {
|
|
190
|
-
return config.version;
|
|
191
|
-
}
|
|
192
|
-
const strategy = await this.getStrategy();
|
|
193
|
-
return strategy.getVersion();
|
|
194
|
-
}
|
|
195
|
-
async getPaused() {
|
|
196
|
-
const config = await this.getContractConfig();
|
|
197
|
-
if (config && config?.paused !== null) {
|
|
198
|
-
return config.paused;
|
|
199
|
-
}
|
|
200
|
-
const strategy = await this.getStrategy();
|
|
201
|
-
if (!strategy.getPaused) {
|
|
202
|
-
throw new Error('getPaused is not supported for this chain');
|
|
203
|
-
}
|
|
204
|
-
return strategy.getPaused();
|
|
205
|
-
}
|
|
206
|
-
async getClaimFee(amount) {
|
|
207
|
-
const config = await this.getContractConfig();
|
|
208
|
-
if (config?.claimFee) {
|
|
209
|
-
return config.claimFee;
|
|
210
|
-
}
|
|
211
|
-
const strategy = await this.getStrategy();
|
|
212
|
-
if (!strategy.getClaimFee) {
|
|
213
|
-
throw new Error('getClaimFee is not supported for this chain');
|
|
214
|
-
}
|
|
215
|
-
return strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(0));
|
|
216
|
-
}
|
|
217
|
-
// params claimId[]
|
|
218
|
-
async batchCheckClaimed() {
|
|
219
|
-
const strategy = await this.getStrategy();
|
|
220
|
-
if (!strategy.batchCheckClaimed) {
|
|
221
|
-
throw new Error('batchCheckClaimed is not supported for this chain');
|
|
222
|
-
}
|
|
223
|
-
const leafs = this.claims?.map((it) => it.leaf);
|
|
224
|
-
if (!leafs)
|
|
225
|
-
return [];
|
|
226
|
-
return strategy.batchCheckClaimed(leafs);
|
|
227
|
-
}
|
|
228
|
-
async getNFT() {
|
|
229
|
-
const strategy = await this.getStrategy();
|
|
230
|
-
if (!strategy.getNFT) {
|
|
231
|
-
throw new Error('getNFT is not supported for this chain');
|
|
232
|
-
}
|
|
233
|
-
return strategy.getNFT();
|
|
234
|
-
}
|
|
235
|
-
async getKycThreshold() {
|
|
236
|
-
const strategy = await this.getStrategy();
|
|
237
|
-
if (!strategy.getKycThreshold) {
|
|
238
|
-
throw new Error('getKycThreshold is not supported for this chain');
|
|
239
|
-
}
|
|
240
|
-
return strategy.getKycThreshold();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.AirdropClient = AirdropClient;
|
|
17
|
+
exports.CONST = exports.SignatureAirdropClient = exports.AirdropClient = void 0;
|
|
18
|
+
var AirdropClient_1 = require("./AirdropClient");
|
|
19
|
+
Object.defineProperty(exports, "AirdropClient", { enumerable: true, get: function () { return AirdropClient_1.AirdropClient; } });
|
|
20
|
+
var SignatureAirdropClient_1 = require("./SignatureAirdropClient");
|
|
21
|
+
Object.defineProperty(exports, "SignatureAirdropClient", { enumerable: true, get: function () { return SignatureAirdropClient_1.SignatureAirdropClient; } });
|
|
22
|
+
var constants_1 = require("./constants");
|
|
23
|
+
Object.defineProperty(exports, "CONST", { enumerable: true, get: function () { return constants_1.CONST; } });
|
|
24
|
+
__exportStar(require("./core/useWeb3ConnectWallet"), exports);
|
|
244
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/airdrop/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/airdrop/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAE/B,yCAAoC;AAA3B,kGAAA,KAAK,OAAA;AACd,8DAA4C"}
|
|
@@ -26,3 +26,18 @@ export declare const getJettonInfo: (data: {
|
|
|
26
26
|
address: string;
|
|
27
27
|
isTestnet: "true" | "false";
|
|
28
28
|
}, baseURL?: string) => Promise<any>;
|
|
29
|
+
export declare const connectTwitter: (data: {
|
|
30
|
+
code: string;
|
|
31
|
+
redirectUri: string;
|
|
32
|
+
}, baseURL?: string) => Promise<unknown>;
|
|
33
|
+
export declare const checkEligibility: (data: {
|
|
34
|
+
projectId: string;
|
|
35
|
+
}, baseURL?: string) => Promise<unknown>;
|
|
36
|
+
export declare const bindWallet: (data: {
|
|
37
|
+
projectId: string;
|
|
38
|
+
key: string;
|
|
39
|
+
signature: string;
|
|
40
|
+
message: string;
|
|
41
|
+
timestamp: number;
|
|
42
|
+
recipientType: string;
|
|
43
|
+
}, baseURL?: string) => Promise<unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getJettonInfo = exports.getAirdropContractConfig = exports.getAirdropQuery = exports.getAirdropPro = exports.getAirdropProjectId = exports.getAirdropProject = exports.TonWalletService = void 0;
|
|
3
|
+
exports.bindWallet = exports.checkEligibility = exports.connectTwitter = exports.getJettonInfo = exports.getAirdropContractConfig = exports.getAirdropQuery = exports.getAirdropPro = exports.getAirdropProjectId = exports.getAirdropProject = exports.TonWalletService = void 0;
|
|
4
4
|
const api_client_1 = require("../../utils/api-client");
|
|
5
5
|
const utils_1 = require("../../utils/utils");
|
|
6
6
|
var ton_1 = require("./wallet-service/ton");
|
|
@@ -46,4 +46,19 @@ const getJettonInfo = async (data, baseURL) => {
|
|
|
46
46
|
return client.get(`/airdrop-open/jetton/${data.address}?isTestnet=${data.isTestnet}`);
|
|
47
47
|
};
|
|
48
48
|
exports.getJettonInfo = getJettonInfo;
|
|
49
|
+
const connectTwitter = async (data, baseURL) => {
|
|
50
|
+
const client = createApiClient(baseURL);
|
|
51
|
+
return client.post('/airdrop-open/connect-twitter', data);
|
|
52
|
+
};
|
|
53
|
+
exports.connectTwitter = connectTwitter;
|
|
54
|
+
const checkEligibility = async (data, baseURL) => {
|
|
55
|
+
const client = createApiClient(baseURL);
|
|
56
|
+
return client.post('/airdrop-open/check-eligibility', data);
|
|
57
|
+
};
|
|
58
|
+
exports.checkEligibility = checkEligibility;
|
|
59
|
+
const bindWallet = async (data, baseURL) => {
|
|
60
|
+
const client = createApiClient(baseURL);
|
|
61
|
+
return client.post('/airdrop-open/connect-wallet', data);
|
|
62
|
+
};
|
|
63
|
+
exports.bindWallet = bindWallet;
|
|
49
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/services/index.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,6CAAkD;AAGlD,4CAAwD;AAA/C,uGAAA,gBAAgB,OAAA;AAEzB,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,sBAAS,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,sBAAS,CAAC;AAC7D,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,KAAK,EAAE,SAAiB,EAAE,OAAgB,EAAqB,EAAE;IAChG,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAM,0BAA0B,SAAS,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC,CAAC,WAAW;IACjC,MAAM,aAAa,GAAG,GAAG,EAAE,SAAS,CAAC;IACrC,MAAM,cAAc,GAAG,IAAA,qBAAa,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACpE,OAAO;QACL,GAAG,GAAG;QACN,cAAc;KACf,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B;AAEK,MAAM,mBAAmB,GAAG,KAAK,EACtC,IAGC,EACD,OAAgB,EACsC,EAAE;IACxD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,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C,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,OAAO,cAAc,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;AACxF,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEK,MAAM,cAAc,GAAG,KAAK,EAAE,IAA2C,EAAE,OAAgB,EAAE,EAAE;IACpG,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,IAAI,CAAC,CAAC;AAC5D,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEK,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAA2B,EAAE,OAAgB,EAAE,EAAE;IACtF,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEK,MAAM,UAAU,GAAG,KAAK,EAC7B,IAOC,EACD,OAAgB,EAChB,EAAE;IACF,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -55,10 +55,24 @@ export interface IProject {
|
|
|
55
55
|
blockCountries: Record<string, string>;
|
|
56
56
|
themeConf: ThemeConfig | null;
|
|
57
57
|
version: string;
|
|
58
|
-
extra?:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
extra?: IProjectExtra;
|
|
59
|
+
identities: Identity[];
|
|
60
|
+
}
|
|
61
|
+
export interface Identity {
|
|
62
|
+
identityType: string;
|
|
63
|
+
authorizeUrl?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare enum AirdropSigIdentityTypeEnum {
|
|
66
|
+
Twitter = "X Account",
|
|
67
|
+
SolanaWallet = "Solana Wallet",
|
|
68
|
+
EVMWallet = "EVM Wallet"
|
|
69
|
+
}
|
|
70
|
+
export interface IProjectExtra {
|
|
71
|
+
kyc: boolean;
|
|
72
|
+
tag: string;
|
|
73
|
+
seed: number;
|
|
74
|
+
signer: string;
|
|
75
|
+
identities: string[];
|
|
62
76
|
}
|
|
63
77
|
export declare enum ETokenType {
|
|
64
78
|
Erc20 = "ERC20",
|
|
@@ -102,6 +116,7 @@ export type IWalletClient = TonConnectUI | ViemWalletClient;
|
|
|
102
116
|
export type IAirdropService = TonAirdropService | EvmAirdropService;
|
|
103
117
|
type BaseAirdropOptions = {
|
|
104
118
|
endpoint?: string;
|
|
119
|
+
project?: IProject;
|
|
105
120
|
};
|
|
106
121
|
type ProjectIdOptions = BaseAirdropOptions & {
|
|
107
122
|
projectId: string;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EvmAirdropVersionEnum = exports.TonAirdropVersionEnum = exports.ETokenType = exports.ChainType = void 0;
|
|
3
|
+
exports.EvmAirdropVersionEnum = exports.TonAirdropVersionEnum = exports.ETokenType = exports.AirdropSigIdentityTypeEnum = exports.ChainType = void 0;
|
|
4
4
|
var ChainType;
|
|
5
5
|
(function (ChainType) {
|
|
6
6
|
ChainType["Evm"] = "evm";
|
|
7
7
|
ChainType["Ton"] = "ton";
|
|
8
8
|
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
9
|
+
var AirdropSigIdentityTypeEnum;
|
|
10
|
+
(function (AirdropSigIdentityTypeEnum) {
|
|
11
|
+
AirdropSigIdentityTypeEnum["Twitter"] = "X Account";
|
|
12
|
+
AirdropSigIdentityTypeEnum["SolanaWallet"] = "Solana Wallet";
|
|
13
|
+
AirdropSigIdentityTypeEnum["EVMWallet"] = "EVM Wallet";
|
|
14
|
+
})(AirdropSigIdentityTypeEnum || (exports.AirdropSigIdentityTypeEnum = AirdropSigIdentityTypeEnum = {}));
|
|
9
15
|
var ETokenType;
|
|
10
16
|
(function (ETokenType) {
|
|
11
17
|
ETokenType["Erc20"] = "ERC20";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/types/index.ts"],"names":[],"mappings":";;;AAgBA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,wBAAW,CAAA;AACb,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/types/index.ts"],"names":[],"mappings":";;;AAgBA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,wBAAW,CAAA;AACb,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAqDD,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,mDAAqB,CAAA;IACrB,4DAA8B,CAAA;IAC9B,sDAAwB,CAAA;AAC1B,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC;AAUD,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,qCAAuB,CAAA;IACvB,4BAAc,CAAA;AAChB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AA6BD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,qCAAY,CAAA;IACZ,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;AACrB,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,qCAAY,CAAA;IACZ,qCAAY,CAAA,CAAC,yBAAyB;AACxC,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AirdropClient } from './airdrop';
|
|
1
|
+
export { AirdropClient, SignatureAirdropClient, CONST, WalletFactory, EvmProvider, SolanaProvider, TonProvider } from './airdrop';
|
|
2
2
|
export * from './airdrop/types';
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,8 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AirdropClient = void 0;
|
|
17
|
+
exports.TonProvider = exports.SolanaProvider = exports.EvmProvider = exports.WalletFactory = exports.CONST = exports.SignatureAirdropClient = exports.AirdropClient = void 0;
|
|
18
18
|
var airdrop_1 = require("./airdrop");
|
|
19
19
|
Object.defineProperty(exports, "AirdropClient", { enumerable: true, get: function () { return airdrop_1.AirdropClient; } });
|
|
20
|
+
Object.defineProperty(exports, "SignatureAirdropClient", { enumerable: true, get: function () { return airdrop_1.SignatureAirdropClient; } });
|
|
21
|
+
Object.defineProperty(exports, "CONST", { enumerable: true, get: function () { return airdrop_1.CONST; } });
|
|
22
|
+
Object.defineProperty(exports, "WalletFactory", { enumerable: true, get: function () { return airdrop_1.WalletFactory; } });
|
|
23
|
+
Object.defineProperty(exports, "EvmProvider", { enumerable: true, get: function () { return airdrop_1.EvmProvider; } });
|
|
24
|
+
Object.defineProperty(exports, "SolanaProvider", { enumerable: true, get: function () { return airdrop_1.SolanaProvider; } });
|
|
25
|
+
Object.defineProperty(exports, "TonProvider", { enumerable: true, get: function () { return airdrop_1.TonProvider; } });
|
|
20
26
|
__exportStar(require("./airdrop/types"), exports);
|
|
21
27
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAQmB;AAPjB,wGAAA,aAAa,OAAA;AACb,iHAAA,sBAAsB,OAAA;AACtB,gGAAA,KAAK,OAAA;AACL,wGAAA,aAAa,OAAA;AACb,sGAAA,WAAW,OAAA;AACX,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AAEb,kDAAgC"}
|
package/dist/cjs/utils/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.delay = exports.isBeforeByUnix = exports.safeParseJSON = void 0;
|
|
6
|
+
exports.isLocal = exports.delay = exports.isBeforeByUnix = exports.safeParseJSON = void 0;
|
|
7
7
|
exports.retry = retry;
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const safeParseJSON = (str) => {
|
|
@@ -36,4 +36,5 @@ async function retry(fn, options) {
|
|
|
36
36
|
}
|
|
37
37
|
throw lastError;
|
|
38
38
|
}
|
|
39
|
+
exports.isLocal = window.location.href.includes('localhost');
|
|
39
40
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":";;;;;;AAgBA,sBAaC;AA7BD,kDAA0B;AAEnB,MAAM,aAAa,GAAG,CAAC,GAAW,EAAO,EAAE;IAChD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,CAAC;AANW,QAAA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