@streamflow/distributor 7.5.3 → 8.0.0-alpha.p284.726ba98
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/cjs/index.cjs +3073 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +10 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.cjs +4 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.cjs.map +1 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.d.cts +932 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.cjs +4 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.cjs.map +1 -0
- package/dist/cjs/solana/descriptor/merkle_distributor.d.cts +1128 -0
- package/dist/cjs/solana/index.cjs +3067 -0
- package/dist/cjs/solana/index.cjs.map +1 -0
- package/dist/cjs/solana/index.d.cts +1485 -0
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.js +3047 -1
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/solana/descriptor/aligned_distributor.d.ts +3 -1
- package/dist/esm/solana/descriptor/aligned_distributor.js +3 -1
- package/dist/esm/solana/descriptor/aligned_distributor.js.map +1 -0
- package/dist/esm/solana/descriptor/idl/aligned_distributor.json +851 -1182
- package/dist/esm/solana/descriptor/idl/merkle_distributor.json +1030 -0
- package/dist/esm/solana/descriptor/merkle_distributor.d.ts +3 -1
- package/dist/esm/solana/descriptor/merkle_distributor.js +3 -1
- package/dist/esm/solana/descriptor/merkle_distributor.js.map +1 -0
- package/dist/esm/solana/index.d.ts +1485 -7
- package/dist/esm/solana/index.js +3019 -7
- package/dist/esm/solana/index.js.map +1 -0
- package/package.json +56 -20
- package/dist/cjs/index.js +0 -27
- package/dist/cjs/solana/clients/BaseDistributorClient.js +0 -276
- package/dist/cjs/solana/clients/SolanaAlignedDistributorClient.js +0 -116
- package/dist/cjs/solana/clients/SolanaDistributorClient.js +0 -17
- package/dist/cjs/solana/clients/index.js +0 -10
- package/dist/cjs/solana/constants.js +0 -28
- package/dist/cjs/solana/descriptor/aligned_distributor.js +0 -2
- package/dist/cjs/solana/descriptor/idl/aligned_distributor.json +0 -1255
- package/dist/cjs/solana/descriptor/merkle_distributor.js +0 -2
- package/dist/cjs/solana/generated/accounts/ClaimStatus.js +0 -135
- package/dist/cjs/solana/generated/accounts/MerkleDistributor.js +0 -215
- package/dist/cjs/solana/generated/accounts/index.js +0 -7
- package/dist/cjs/solana/generated/errors/anchor.js +0 -712
- package/dist/cjs/solana/generated/errors/custom.js +0 -321
- package/dist/cjs/solana/generated/errors/index.js +0 -64
- package/dist/cjs/solana/generated/instructions/claimLocked.js +0 -22
- package/dist/cjs/solana/generated/instructions/clawback.js +0 -21
- package/dist/cjs/solana/generated/instructions/closeClaim.js +0 -57
- package/dist/cjs/solana/generated/instructions/index.js +0 -17
- package/dist/cjs/solana/generated/instructions/newClaim.js +0 -59
- package/dist/cjs/solana/generated/instructions/newDistributor.js +0 -104
- package/dist/cjs/solana/generated/instructions/setAdmin.js +0 -17
- package/dist/cjs/solana/generated/instructions/setClawbackReceiver.js +0 -17
- package/dist/cjs/solana/generated/programId.js +0 -8
- package/dist/cjs/solana/index.js +0 -36
- package/dist/cjs/solana/types.js +0 -159
- package/dist/cjs/solana/utils.js +0 -75
- package/dist/esm/solana/clients/BaseDistributorClient.d.ts +0 -43
- package/dist/esm/solana/clients/BaseDistributorClient.js +0 -274
- package/dist/esm/solana/clients/SolanaAlignedDistributorClient.d.ts +0 -16
- package/dist/esm/solana/clients/SolanaAlignedDistributorClient.js +0 -111
- package/dist/esm/solana/clients/SolanaDistributorClient.d.ts +0 -8
- package/dist/esm/solana/clients/SolanaDistributorClient.js +0 -11
- package/dist/esm/solana/clients/index.d.ts +0 -2
- package/dist/esm/solana/clients/index.js +0 -2
- package/dist/esm/solana/constants.d.ts +0 -24
- package/dist/esm/solana/constants.js +0 -25
- package/dist/esm/solana/generated/accounts/ClaimStatus.d.ts +0 -83
- package/dist/esm/solana/generated/accounts/ClaimStatus.js +0 -127
- package/dist/esm/solana/generated/accounts/MerkleDistributor.d.ts +0 -179
- package/dist/esm/solana/generated/accounts/MerkleDistributor.js +0 -239
- package/dist/esm/solana/generated/accounts/index.d.ts +0 -4
- package/dist/esm/solana/generated/accounts/index.js +0 -2
- package/dist/esm/solana/generated/errors/anchor.d.ts +0 -434
- package/dist/esm/solana/generated/errors/anchor.js +0 -707
- package/dist/esm/solana/generated/errors/custom.d.ts +0 -194
- package/dist/esm/solana/generated/errors/custom.js +0 -317
- package/dist/esm/solana/generated/errors/index.d.ts +0 -5
- package/dist/esm/solana/generated/errors/index.js +0 -37
- package/dist/esm/solana/generated/instructions/claimLocked.d.ts +0 -23
- package/dist/esm/solana/generated/instructions/claimLocked.js +0 -19
- package/dist/esm/solana/generated/instructions/clawback.d.ts +0 -17
- package/dist/esm/solana/generated/instructions/clawback.js +0 -18
- package/dist/esm/solana/generated/instructions/closeClaim.d.ts +0 -22
- package/dist/esm/solana/generated/instructions/closeClaim.js +0 -30
- package/dist/esm/solana/generated/instructions/index.d.ts +0 -14
- package/dist/esm/solana/generated/instructions/index.js +0 -7
- package/dist/esm/solana/generated/instructions/newClaim.d.ts +0 -29
- package/dist/esm/solana/generated/instructions/newClaim.js +0 -32
- package/dist/esm/solana/generated/instructions/newDistributor.d.ts +0 -58
- package/dist/esm/solana/generated/instructions/newDistributor.js +0 -77
- package/dist/esm/solana/generated/instructions/setAdmin.d.ts +0 -10
- package/dist/esm/solana/generated/instructions/setAdmin.js +0 -14
- package/dist/esm/solana/generated/instructions/setClawbackReceiver.d.ts +0 -10
- package/dist/esm/solana/generated/instructions/setClawbackReceiver.js +0 -14
- package/dist/esm/solana/generated/programId.d.ts +0 -3
- package/dist/esm/solana/generated/programId.js +0 -5
- package/dist/esm/solana/types.d.ts +0 -258
- package/dist/esm/solana/types.js +0 -156
- package/dist/esm/solana/utils.d.ts +0 -14
- package/dist/esm/solana/utils.js +0 -65
package/package.json
CHANGED
|
@@ -1,41 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/distributor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.p284.726ba98",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
|
|
5
5
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"
|
|
6
|
+
"main": "./dist/cjs/index.cjs",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"types": "./dist/esm/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
8
10
|
"type": "module",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
9
17
|
"exports": {
|
|
10
18
|
".": {
|
|
11
|
-
"types":
|
|
19
|
+
"types": {
|
|
20
|
+
"import": "./dist/esm/index.d.ts",
|
|
21
|
+
"require": "./dist/cjs/index.d.cts"
|
|
22
|
+
},
|
|
12
23
|
"import": "./dist/esm/index.js",
|
|
13
|
-
"require": "./dist/cjs/index.
|
|
24
|
+
"require": "./dist/cjs/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./solana/idl/merkle_distributor.json": {
|
|
27
|
+
"import": "./dist/esm/solana/descriptor/idl/merkle_distributor.json",
|
|
28
|
+
"require": "./dist/esm/solana/descriptor/idl/merkle_distributor.json",
|
|
29
|
+
"default": "./dist/esm/solana/descriptor/idl/merkle_distributor.json"
|
|
30
|
+
},
|
|
31
|
+
"./solana/idl/aligned_distributor.json": {
|
|
32
|
+
"import": "./dist/esm/solana/descriptor/idl/aligned_distributor.json",
|
|
33
|
+
"require": "./dist/esm/solana/descriptor/idl/aligned_distributor.json",
|
|
34
|
+
"default": "./dist/esm/solana/descriptor/idl/aligned_distributor.json"
|
|
14
35
|
},
|
|
15
|
-
"./solana/
|
|
16
|
-
"types":
|
|
17
|
-
|
|
18
|
-
|
|
36
|
+
"./solana/descriptor/merkle_distributor": {
|
|
37
|
+
"types": {
|
|
38
|
+
"import": "./dist/esm/solana/descriptor/merkle_distributor.d.ts",
|
|
39
|
+
"require": "./dist/cjs/solana/descriptor/merkle_distributor.d.cts"
|
|
40
|
+
},
|
|
41
|
+
"import": "./dist/esm/solana/descriptor/merkle_distributor.js",
|
|
42
|
+
"require": "./dist/cjs/solana/descriptor/merkle_distributor.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./solana/descriptor/aligned_distributor": {
|
|
45
|
+
"types": {
|
|
46
|
+
"import": "./dist/esm/solana/descriptor/aligned_distributor.d.ts",
|
|
47
|
+
"require": "./dist/cjs/solana/descriptor/aligned_distributor.d.cts"
|
|
48
|
+
},
|
|
49
|
+
"import": "./dist/esm/solana/descriptor/aligned_distributor.js",
|
|
50
|
+
"require": "./dist/cjs/solana/descriptor/aligned_distributor.cjs"
|
|
19
51
|
},
|
|
20
52
|
"./solana": {
|
|
21
|
-
"types":
|
|
53
|
+
"types": {
|
|
54
|
+
"import": "./dist/esm/solana/index.d.ts",
|
|
55
|
+
"require": "./dist/cjs/solana/index.d.cts"
|
|
56
|
+
},
|
|
22
57
|
"import": "./dist/esm/solana/index.js",
|
|
23
|
-
"require": "./dist/cjs/solana/index.
|
|
24
|
-
}
|
|
58
|
+
"require": "./dist/cjs/solana/index.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./package.json": "./package.json"
|
|
25
61
|
},
|
|
26
62
|
"scripts": {
|
|
27
|
-
"
|
|
28
|
-
"build
|
|
29
|
-
"
|
|
63
|
+
"copyIdls": "mkdir -p dist/esm/solana/descriptor/idl && cp solana/descriptor/idl/*.json dist/esm/solana/descriptor/idl/",
|
|
64
|
+
"build": "rm -rf dist && tsup && pnpm copyIdls",
|
|
65
|
+
"tsc:lint": "tsc --noEmit",
|
|
30
66
|
"pack": "pnpm build && pnpm pack",
|
|
67
|
+
"test": "vitest run --passWithNoTests",
|
|
31
68
|
"lint": "eslint --fix .",
|
|
32
|
-
"prepublishOnly": "
|
|
69
|
+
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run build"
|
|
33
70
|
},
|
|
34
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "76b5232d96fdb7bf7c52d437bd7733bb4afc53ca",
|
|
35
72
|
"devDependencies": {
|
|
36
|
-
"@streamflow/eslint-config": "
|
|
73
|
+
"@streamflow/eslint-config": "8.0.0-alpha.p284.726ba98",
|
|
37
74
|
"@types/bn.js": "5.1.1",
|
|
38
|
-
"date-fns": "2.28.0",
|
|
39
75
|
"typescript": "^5.6.3"
|
|
40
76
|
},
|
|
41
77
|
"dependencies": {
|
|
@@ -45,7 +81,7 @@
|
|
|
45
81
|
"@solana/spl-token": "0.4.9",
|
|
46
82
|
"@solana/wallet-adapter-base": "0.9.19",
|
|
47
83
|
"@solana/web3.js": "1.95.4",
|
|
48
|
-
"@streamflow/common": "
|
|
84
|
+
"@streamflow/common": "8.0.0-alpha.p284.726ba98",
|
|
49
85
|
"bn.js": "5.2.1",
|
|
50
86
|
"borsh": "^2.0.0",
|
|
51
87
|
"bs58": "5.0.0",
|
package/dist/cjs/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.StreamflowDistributorSolana = void 0;
|
|
27
|
-
exports.StreamflowDistributorSolana = __importStar(require("./solana/index.js"));
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
7
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
8
|
-
const common_1 = require("@streamflow/common");
|
|
9
|
-
const solana_1 = require("@streamflow/common/solana");
|
|
10
|
-
const spl_token_1 = require("@solana/spl-token");
|
|
11
|
-
const bs58_1 = __importDefault(require("bs58"));
|
|
12
|
-
const constants_1 = require("../constants");
|
|
13
|
-
const instructions_1 = require("../generated/instructions");
|
|
14
|
-
const accounts_1 = require("../generated/accounts");
|
|
15
|
-
const utils_1 = require("../utils");
|
|
16
|
-
const closeClaim_1 = require("../generated/instructions/closeClaim");
|
|
17
|
-
class BaseDistributorClient {
|
|
18
|
-
constructor({ clusterUrl, cluster = common_1.ICluster.Mainnet, commitment = "confirmed", programId = "", sendRate = 1, sendThrottler, }) {
|
|
19
|
-
this.commitment = commitment;
|
|
20
|
-
this.connection = new web3_js_1.Connection(clusterUrl, this.commitment);
|
|
21
|
-
this.programId = programId !== "" ? new web3_js_1.PublicKey(programId) : new web3_js_1.PublicKey(constants_1.DISTRIBUTOR_PROGRAM_ID[cluster]);
|
|
22
|
-
this.sendThrottler = sendThrottler ?? (0, solana_1.buildSendThrottler)(sendRate);
|
|
23
|
-
}
|
|
24
|
-
getConnection() {
|
|
25
|
-
return this.connection;
|
|
26
|
-
}
|
|
27
|
-
getCommitment() {
|
|
28
|
-
return typeof this.commitment == "string" ? this.commitment : this.commitment.commitment;
|
|
29
|
-
}
|
|
30
|
-
getDistributorProgramId() {
|
|
31
|
-
return this.programId;
|
|
32
|
-
}
|
|
33
|
-
async prepareCreateInstructions(data, extParams) {
|
|
34
|
-
if (!extParams.invoker.publicKey) {
|
|
35
|
-
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
36
|
-
}
|
|
37
|
-
const { version, mint } = data;
|
|
38
|
-
const ixs = (0, solana_1.prepareBaseInstructions)(this.connection, extParams);
|
|
39
|
-
const mintPublicKey = extParams.isNative ? spl_token_1.NATIVE_MINT : new web3_js_1.PublicKey(mint);
|
|
40
|
-
const { mint: mintAccount, tokenProgramId } = await (0, solana_1.getMintAndProgram)(this.connection, mintPublicKey);
|
|
41
|
-
const transferFeeConfig = (0, spl_token_1.getTransferFeeConfig)(mintAccount);
|
|
42
|
-
const distributorPublicKey = (0, utils_1.getDistributorPda)(this.programId, mintPublicKey, version);
|
|
43
|
-
const tokenVault = await (0, solana_1.ata)(mintPublicKey, distributorPublicKey, tokenProgramId);
|
|
44
|
-
const senderTokens = await (0, solana_1.ata)(mintPublicKey, extParams.invoker.publicKey, tokenProgramId);
|
|
45
|
-
const accounts = {
|
|
46
|
-
distributor: distributorPublicKey,
|
|
47
|
-
clawbackReceiver: senderTokens,
|
|
48
|
-
mint: mintPublicKey,
|
|
49
|
-
tokenVault,
|
|
50
|
-
admin: extParams.invoker.publicKey,
|
|
51
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
52
|
-
associatedTokenProgram: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
53
|
-
tokenProgram: tokenProgramId,
|
|
54
|
-
};
|
|
55
|
-
if (extParams.isNative) {
|
|
56
|
-
ixs.push(...(await (0, solana_1.prepareWrappedAccount)(this.connection, extParams.invoker.publicKey, new bn_js_1.default(data.maxTotalClaim))));
|
|
57
|
-
}
|
|
58
|
-
const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
|
|
59
|
-
ixs.push(newDistributorInstruction);
|
|
60
|
-
if (transferFeeConfig) {
|
|
61
|
-
const { transferAmount, feeCharged } = await (0, utils_1.calculateAmountWithTransferFees)(this.connection, transferFeeConfig, BigInt(data.maxTotalClaim.toString()));
|
|
62
|
-
ixs.push((0, spl_token_1.createTransferCheckedWithFeeInstruction)(senderTokens, mintPublicKey, tokenVault, extParams.invoker.publicKey, transferAmount, mintAccount.decimals, feeCharged, undefined, tokenProgramId));
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
ixs.push((0, spl_token_1.createTransferCheckedInstruction)(senderTokens, mintPublicKey, tokenVault, extParams.invoker.publicKey, BigInt(data.maxTotalClaim.toString()), mintAccount.decimals, undefined, tokenProgramId));
|
|
66
|
-
}
|
|
67
|
-
return { distributorPublicKey, ixs };
|
|
68
|
-
}
|
|
69
|
-
async create(data, extParams) {
|
|
70
|
-
const { ixs, distributorPublicKey } = await this.prepareCreateInstructions(data, extParams);
|
|
71
|
-
const { tx, hash, context } = await (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey);
|
|
72
|
-
const signature = await (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, extParams.invoker, tx, {
|
|
73
|
-
hash,
|
|
74
|
-
context,
|
|
75
|
-
commitment: this.getCommitment(),
|
|
76
|
-
}, { sendThrottler: this.sendThrottler });
|
|
77
|
-
return {
|
|
78
|
-
ixs,
|
|
79
|
-
txId: signature,
|
|
80
|
-
metadataId: distributorPublicKey.toBase58(),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
async claim(data, extParams) {
|
|
84
|
-
const ixs = await this.prepareClaimInstructions(data, extParams);
|
|
85
|
-
const { tx, hash, context } = await (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey);
|
|
86
|
-
const signature = await (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, extParams.invoker, tx, {
|
|
87
|
-
hash,
|
|
88
|
-
context,
|
|
89
|
-
commitment: this.getCommitment(),
|
|
90
|
-
}, { sendThrottler: this.sendThrottler });
|
|
91
|
-
return { ixs, txId: signature };
|
|
92
|
-
}
|
|
93
|
-
async prepareClaimInstructions(data, extParams) {
|
|
94
|
-
if (!extParams.invoker.publicKey) {
|
|
95
|
-
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
96
|
-
}
|
|
97
|
-
const distributorPublicKey = new web3_js_1.PublicKey(data.id);
|
|
98
|
-
const distributor = await accounts_1.MerkleDistributor.fetch(this.connection, distributorPublicKey);
|
|
99
|
-
if (!distributor) {
|
|
100
|
-
throw new Error("Couldn't get account info");
|
|
101
|
-
}
|
|
102
|
-
const { tokenProgramId } = await (0, solana_1.getMintAndProgram)(this.connection, distributor.mint);
|
|
103
|
-
const ixs = (0, solana_1.prepareBaseInstructions)(this.connection, extParams);
|
|
104
|
-
ixs.push(...(await (0, solana_1.checkOrCreateAtaBatch)(this.connection, [extParams.invoker.publicKey], distributor.mint, extParams.invoker, tokenProgramId)));
|
|
105
|
-
const invokerTokens = await (0, solana_1.ata)(distributor.mint, extParams.invoker.publicKey, tokenProgramId);
|
|
106
|
-
const claimStatusPublicKey = (0, utils_1.getClaimantStatusPda)(this.programId, distributorPublicKey, extParams.invoker.publicKey);
|
|
107
|
-
const eventAuthorityPublicKey = (0, utils_1.getEventAuthorityPda)(this.programId);
|
|
108
|
-
const claimStatus = await accounts_1.ClaimStatus.fetch(this.connection, claimStatusPublicKey);
|
|
109
|
-
const accounts = {
|
|
110
|
-
distributor: distributorPublicKey,
|
|
111
|
-
claimStatus: claimStatusPublicKey,
|
|
112
|
-
from: distributor.tokenVault,
|
|
113
|
-
to: invokerTokens,
|
|
114
|
-
claimant: extParams.invoker.publicKey,
|
|
115
|
-
mint: distributor.mint,
|
|
116
|
-
tokenProgram: tokenProgramId,
|
|
117
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
118
|
-
eventAuthority: eventAuthorityPublicKey,
|
|
119
|
-
program: this.programId,
|
|
120
|
-
};
|
|
121
|
-
if (!claimStatus) {
|
|
122
|
-
const args = {
|
|
123
|
-
amountLocked: new bn_js_1.default(data.amountLocked),
|
|
124
|
-
amountUnlocked: new bn_js_1.default(data.amountUnlocked),
|
|
125
|
-
proof: data.proof,
|
|
126
|
-
};
|
|
127
|
-
ixs.push((0, instructions_1.newClaim)(args, accounts, this.programId));
|
|
128
|
-
}
|
|
129
|
-
const nowTs = new bn_js_1.default(Math.floor(Date.now() / 1000));
|
|
130
|
-
if (claimStatus ||
|
|
131
|
-
(new bn_js_1.default(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod))) {
|
|
132
|
-
ixs.push((0, instructions_1.claimLocked)(accounts, this.programId));
|
|
133
|
-
}
|
|
134
|
-
ixs.push(this.prepareClaimFeeInstruction(extParams.invoker.publicKey));
|
|
135
|
-
return ixs;
|
|
136
|
-
}
|
|
137
|
-
async closeClaim(data, extParams) {
|
|
138
|
-
const ixs = await this.prepareCloseClaimInstructions(data, extParams);
|
|
139
|
-
const { tx, hash, context } = await (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey);
|
|
140
|
-
const signature = await (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, extParams.invoker, tx, {
|
|
141
|
-
hash,
|
|
142
|
-
context,
|
|
143
|
-
commitment: this.getCommitment(),
|
|
144
|
-
}, { sendThrottler: this.sendThrottler });
|
|
145
|
-
return { ixs, txId: signature };
|
|
146
|
-
}
|
|
147
|
-
async prepareCloseClaimInstructions(data, extParams) {
|
|
148
|
-
if (!extParams.invoker.publicKey) {
|
|
149
|
-
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
150
|
-
}
|
|
151
|
-
const distributorPublicKey = new web3_js_1.PublicKey(data.id);
|
|
152
|
-
const distributor = await accounts_1.MerkleDistributor.fetch(this.connection, distributorPublicKey);
|
|
153
|
-
const claimantPublicKey = (0, solana_1.pk)(data.claimant);
|
|
154
|
-
if (!distributor) {
|
|
155
|
-
throw new Error("Couldn't get distributor account info");
|
|
156
|
-
}
|
|
157
|
-
const ixs = (0, solana_1.prepareBaseInstructions)(this.connection, extParams);
|
|
158
|
-
const claimStatusPublicKey = (0, utils_1.getClaimantStatusPda)(this.programId, distributorPublicKey, claimantPublicKey);
|
|
159
|
-
const eventAuthorityPublicKey = (0, utils_1.getEventAuthorityPda)(this.programId);
|
|
160
|
-
const closeClaimAccounts = {
|
|
161
|
-
adminOrClaimant: extParams.invoker.publicKey,
|
|
162
|
-
distributor: distributorPublicKey,
|
|
163
|
-
claimStatus: claimStatusPublicKey,
|
|
164
|
-
claimant: claimantPublicKey,
|
|
165
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
166
|
-
eventAuthority: eventAuthorityPublicKey,
|
|
167
|
-
program: this.programId,
|
|
168
|
-
};
|
|
169
|
-
const closeClaimArgs = {
|
|
170
|
-
amountLocked: data.amountLocked ? new bn_js_1.default(data.amountLocked) : undefined,
|
|
171
|
-
amountUnlocked: data.amountUnlocked ? new bn_js_1.default(data.amountUnlocked) : undefined,
|
|
172
|
-
proof: data.proof,
|
|
173
|
-
};
|
|
174
|
-
ixs.push((0, closeClaim_1.closeClaim)(closeClaimArgs, closeClaimAccounts, this.programId));
|
|
175
|
-
return ixs;
|
|
176
|
-
}
|
|
177
|
-
async prepareClawbackInstructions(data, extParams) {
|
|
178
|
-
if (!extParams.invoker.publicKey) {
|
|
179
|
-
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
180
|
-
}
|
|
181
|
-
const distributorPublicKey = new web3_js_1.PublicKey(data.id);
|
|
182
|
-
const distributor = await accounts_1.MerkleDistributor.fetch(this.connection, distributorPublicKey);
|
|
183
|
-
if (!distributor) {
|
|
184
|
-
throw new Error("Couldn't get account info");
|
|
185
|
-
}
|
|
186
|
-
const { tokenProgramId } = await (0, solana_1.getMintAndProgram)(this.connection, distributor.mint);
|
|
187
|
-
const ixs = (0, solana_1.prepareBaseInstructions)(this.connection, extParams);
|
|
188
|
-
ixs.push(...(await (0, solana_1.checkOrCreateAtaBatch)(this.connection, [extParams.invoker.publicKey], distributor.mint, extParams.invoker, tokenProgramId)));
|
|
189
|
-
const accounts = {
|
|
190
|
-
distributor: distributorPublicKey,
|
|
191
|
-
from: distributor.tokenVault,
|
|
192
|
-
to: distributor.clawbackReceiver,
|
|
193
|
-
admin: extParams.invoker.publicKey,
|
|
194
|
-
mint: distributor.mint,
|
|
195
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
196
|
-
tokenProgram: tokenProgramId,
|
|
197
|
-
};
|
|
198
|
-
const clawbackInstruction = await this.getClawbackInstruction(accounts);
|
|
199
|
-
ixs.push(clawbackInstruction);
|
|
200
|
-
return ixs;
|
|
201
|
-
}
|
|
202
|
-
async clawback(data, extParams) {
|
|
203
|
-
const ixs = await this.prepareClawbackInstructions(data, extParams);
|
|
204
|
-
const { tx, hash, context } = await (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey);
|
|
205
|
-
const signature = await (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, extParams.invoker, tx, {
|
|
206
|
-
hash,
|
|
207
|
-
context,
|
|
208
|
-
commitment: this.getCommitment(),
|
|
209
|
-
}, { sendThrottler: this.sendThrottler });
|
|
210
|
-
return { ixs, txId: signature };
|
|
211
|
-
}
|
|
212
|
-
async getClaims(data) {
|
|
213
|
-
const claimStatusPublicKeys = data.map(({ id, recipient }) => {
|
|
214
|
-
return (0, utils_1.getClaimantStatusPda)(this.programId, new web3_js_1.PublicKey(id), new web3_js_1.PublicKey(recipient));
|
|
215
|
-
});
|
|
216
|
-
return accounts_1.ClaimStatus.fetchMultiple(this.connection, claimStatusPublicKeys, this.programId);
|
|
217
|
-
}
|
|
218
|
-
async getDistributors(data) {
|
|
219
|
-
const distributorPublicKeys = data.ids.map((distributorId) => new web3_js_1.PublicKey(distributorId));
|
|
220
|
-
return accounts_1.MerkleDistributor.fetchMultiple(this.connection, distributorPublicKeys, this.programId);
|
|
221
|
-
}
|
|
222
|
-
async searchDistributors(data) {
|
|
223
|
-
const filters = [{ memcmp: { offset: 0, bytes: bs58_1.default.encode(accounts_1.MerkleDistributor.discriminator) } }];
|
|
224
|
-
if (data.mint) {
|
|
225
|
-
filters.push({
|
|
226
|
-
memcmp: {
|
|
227
|
-
offset: constants_1.DISTRIBUTOR_MINT_OFFSET,
|
|
228
|
-
bytes: data.mint,
|
|
229
|
-
},
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
if (data.admin) {
|
|
233
|
-
filters.push({
|
|
234
|
-
memcmp: {
|
|
235
|
-
offset: constants_1.DISTRIBUTOR_ADMIN_OFFSET,
|
|
236
|
-
bytes: data.admin,
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
const accounts = await this.connection.getProgramAccounts(this.programId, { filters });
|
|
241
|
-
return accounts.map(({ pubkey, account }) => ({
|
|
242
|
-
publicKey: pubkey,
|
|
243
|
-
account: accounts_1.MerkleDistributor.decode(account.data),
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
prepareClaimFeeInstruction(payer) {
|
|
247
|
-
return web3_js_1.SystemProgram.transfer({
|
|
248
|
-
fromPubkey: payer,
|
|
249
|
-
toPubkey: constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY,
|
|
250
|
-
lamports: constants_1.AIRDROP_CLAIM_FEE,
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
getNewDistributorArgs(data) {
|
|
254
|
-
const args = {
|
|
255
|
-
version: new bn_js_1.default(data.version),
|
|
256
|
-
root: data.root,
|
|
257
|
-
maxTotalClaim: new bn_js_1.default(data.maxTotalClaim),
|
|
258
|
-
maxNumNodes: new bn_js_1.default(data.maxNumNodes),
|
|
259
|
-
unlockPeriod: new bn_js_1.default(data.unlockPeriod),
|
|
260
|
-
startVestingTs: new bn_js_1.default(data.startVestingTs),
|
|
261
|
-
endVestingTs: new bn_js_1.default(data.endVestingTs),
|
|
262
|
-
clawbackStartTs: new bn_js_1.default(data.clawbackStartTs),
|
|
263
|
-
claimsClosableByAdmin: data.claimsClosableByAdmin,
|
|
264
|
-
claimsClosableByClaimant: data.claimsClosableByClaimant,
|
|
265
|
-
claimsLimit: data.claimsLimit,
|
|
266
|
-
};
|
|
267
|
-
const nowTs = new bn_js_1.default(Math.floor(Date.now() / 1000));
|
|
268
|
-
const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
|
|
269
|
-
const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
|
|
270
|
-
if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
|
|
271
|
-
throw new Error("The unlock period cannot be longer than the total vesting duration!");
|
|
272
|
-
}
|
|
273
|
-
return args;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
exports.default = BaseDistributorClient;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
7
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
8
|
-
const anchor_1 = require("@coral-xyz/anchor");
|
|
9
|
-
const common_1 = require("@streamflow/common");
|
|
10
|
-
const BaseDistributorClient_js_1 = __importDefault(require("./BaseDistributorClient.js"));
|
|
11
|
-
const aligned_distributor_json_1 = __importDefault(require("../descriptor/idl/aligned_distributor.json"));
|
|
12
|
-
const constants_js_1 = require("../constants.js");
|
|
13
|
-
const utils_js_1 = require("../utils.js");
|
|
14
|
-
class SolanaAlignedDistributorClient extends BaseDistributorClient_js_1.default {
|
|
15
|
-
constructor({ clusterUrl, cluster, commitment, programId, sendRate, sendThrottler }) {
|
|
16
|
-
super({ clusterUrl, cluster, commitment, programId, sendRate, sendThrottler });
|
|
17
|
-
const alignedAirdropsProgram = {
|
|
18
|
-
...aligned_distributor_json_1.default,
|
|
19
|
-
};
|
|
20
|
-
this.alignedProxyProgram = new anchor_1.Program(alignedAirdropsProgram, { connection: this.connection });
|
|
21
|
-
}
|
|
22
|
-
getAlignedDistributorProgramId() {
|
|
23
|
-
return this.alignedProxyProgram.programId;
|
|
24
|
-
}
|
|
25
|
-
getAlignedDistributorAddress(distributorAddress) {
|
|
26
|
-
const distributorKey = new web3_js_1.PublicKey(distributorAddress);
|
|
27
|
-
return (0, utils_js_1.getAlignedDistributorPda)(this.alignedProxyProgram.programId, distributorKey);
|
|
28
|
-
}
|
|
29
|
-
async getAlignedDistributorData(distributorAddress) {
|
|
30
|
-
const alignedDistributorKey = this.getAlignedDistributorAddress(distributorAddress);
|
|
31
|
-
const alignedProxy = await this.alignedProxyProgram.account.alignedDistributor.fetch(alignedDistributorKey);
|
|
32
|
-
(0, common_1.invariant)(alignedProxy, "Aligned Distributor proxy account not found");
|
|
33
|
-
const oracleType = Object.keys(alignedProxy.priceOracleType).find((key) => !!key);
|
|
34
|
-
return {
|
|
35
|
-
oracleType,
|
|
36
|
-
minPrice: (0, common_1.getNumberFromBN)(alignedProxy.minPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
37
|
-
maxPrice: (0, common_1.getNumberFromBN)(alignedProxy.maxPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
38
|
-
minPercentage: (0, common_1.getNumberFromBN)(alignedProxy.minPercentage, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
39
|
-
maxPercentage: (0, common_1.getNumberFromBN)(alignedProxy.maxPercentage, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
40
|
-
priceOracle: oracleType === "none" ? undefined : alignedProxy.priceOracle.toBase58(),
|
|
41
|
-
sender: alignedProxy.admin.toBase58(),
|
|
42
|
-
updatePeriod: (0, common_1.getNumberFromBN)(alignedProxy.updatePeriod, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
43
|
-
clawedBack: alignedProxy.distributorClawedBack,
|
|
44
|
-
initialDuration: alignedProxy.initialDuration.toNumber(),
|
|
45
|
-
initialPrice: (0, common_1.getNumberFromBN)(alignedProxy.initialPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
46
|
-
lastPrice: (0, common_1.getNumberFromBN)(alignedProxy.lastPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
47
|
-
lastDurationUpdateTs: alignedProxy.lastDurationUpdateTs.toNumber(),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
async getNewDistributorInstruction(data, accounts) {
|
|
51
|
-
const { distributor, mint, clawbackReceiver, tokenProgram, tokenVault, admin } = accounts;
|
|
52
|
-
const baseArgs = this.getNewDistributorArgs(data);
|
|
53
|
-
const alignedArgs = this.getNewAlignedDistributorArgs(data);
|
|
54
|
-
const oracle = data.oracleAddress
|
|
55
|
-
? new web3_js_1.PublicKey(data.oracleAddress)
|
|
56
|
-
: (0, utils_js_1.getTestOraclePda)(this.alignedProxyProgram.programId, mint, admin);
|
|
57
|
-
const newDistributorIx = await this.alignedProxyProgram.methods
|
|
58
|
-
.newDistributor({
|
|
59
|
-
claimsClosable: baseArgs.claimsClosableByAdmin,
|
|
60
|
-
version: baseArgs.version,
|
|
61
|
-
root: baseArgs.root,
|
|
62
|
-
maxTotalClaim: baseArgs.maxTotalClaim,
|
|
63
|
-
maxNumNodes: baseArgs.maxNumNodes,
|
|
64
|
-
unlockPeriod: baseArgs.unlockPeriod,
|
|
65
|
-
startVestingTs: baseArgs.startVestingTs,
|
|
66
|
-
endVestingTs: baseArgs.endVestingTs,
|
|
67
|
-
clawbackStartTs: baseArgs.clawbackStartTs,
|
|
68
|
-
...alignedArgs,
|
|
69
|
-
})
|
|
70
|
-
.accounts({
|
|
71
|
-
admin,
|
|
72
|
-
tokenVault,
|
|
73
|
-
distributor,
|
|
74
|
-
clawbackReceiver,
|
|
75
|
-
mint,
|
|
76
|
-
tokenProgram,
|
|
77
|
-
priceOracle: oracle,
|
|
78
|
-
})
|
|
79
|
-
.instruction();
|
|
80
|
-
return newDistributorIx;
|
|
81
|
-
}
|
|
82
|
-
async getClawbackInstruction(accounts) {
|
|
83
|
-
const { distributor, from, to, mint, tokenProgram, admin } = accounts;
|
|
84
|
-
const alignedDistributorKey = (0, utils_js_1.getAlignedDistributorPda)(this.alignedProxyProgram.programId, distributor);
|
|
85
|
-
const alignedProxy = await this.alignedProxyProgram.account.alignedDistributor.fetch(alignedDistributorKey);
|
|
86
|
-
(0, common_1.invariant)(alignedProxy, "Aligned Distributor proxy account not found");
|
|
87
|
-
const clawbackInstruction = await this.alignedProxyProgram.methods
|
|
88
|
-
.clawback()
|
|
89
|
-
.accounts({
|
|
90
|
-
admin,
|
|
91
|
-
distributor,
|
|
92
|
-
from,
|
|
93
|
-
to,
|
|
94
|
-
mint,
|
|
95
|
-
tokenProgram,
|
|
96
|
-
})
|
|
97
|
-
.instruction();
|
|
98
|
-
return clawbackInstruction;
|
|
99
|
-
}
|
|
100
|
-
getNewAlignedDistributorArgs(data) {
|
|
101
|
-
const { oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, totalAmountLocked, totalAmountUnlocked, unlockPeriod, } = data;
|
|
102
|
-
return {
|
|
103
|
-
totalAmountLocked: new bn_js_1.default(totalAmountLocked),
|
|
104
|
-
totalAmountUnlocked: new bn_js_1.default(totalAmountUnlocked),
|
|
105
|
-
oracleType: (!!oracleType ? { [oracleType]: {} } : { none: {} }),
|
|
106
|
-
minPrice: (0, common_1.getBN)(minPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
107
|
-
maxPrice: (0, common_1.getBN)(maxPrice, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
108
|
-
minPercentage: (0, common_1.getBN)(minPercentage, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
109
|
-
maxPercentage: (0, common_1.getBN)(maxPercentage, constants_js_1.ALIGNED_PRECISION_FACTOR_POW),
|
|
110
|
-
tickSize: new bn_js_1.default(tickSize || 1),
|
|
111
|
-
skipInitial: skipInitial ?? false,
|
|
112
|
-
updatePeriod: unlockPeriod < 30 ? new bn_js_1.default(30) : new bn_js_1.default(unlockPeriod),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.default = SolanaAlignedDistributorClient;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const instructions_1 = require("../generated/instructions");
|
|
7
|
-
const BaseDistributorClient_js_1 = __importDefault(require("./BaseDistributorClient.js"));
|
|
8
|
-
class SolanaDistributorClient extends BaseDistributorClient_js_1.default {
|
|
9
|
-
async getNewDistributorInstruction(data, accounts) {
|
|
10
|
-
const args = this.getNewDistributorArgs(data);
|
|
11
|
-
return (0, instructions_1.newDistributor)(args, accounts, this.programId);
|
|
12
|
-
}
|
|
13
|
-
async getClawbackInstruction(accounts) {
|
|
14
|
-
return (0, instructions_1.clawback)(accounts, this.programId);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.default = SolanaDistributorClient;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SolanaAlignedDistributorClient = exports.SolanaDistributorClient = void 0;
|
|
7
|
-
var SolanaDistributorClient_js_1 = require("./SolanaDistributorClient.js");
|
|
8
|
-
Object.defineProperty(exports, "SolanaDistributorClient", { enumerable: true, get: function () { return __importDefault(SolanaDistributorClient_js_1).default; } });
|
|
9
|
-
var SolanaAlignedDistributorClient_js_1 = require("./SolanaAlignedDistributorClient.js");
|
|
10
|
-
Object.defineProperty(exports, "SolanaAlignedDistributorClient", { enumerable: true, get: function () { return __importDefault(SolanaAlignedDistributorClient_js_1).default; } });
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DISTRIBUTOR_PROGRAM_ID = exports.ALIGNED_DISTRIBUTOR_PROGRAM_ID = exports.ONE_IN_BASIS_POINTS = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.AIRDROP_CLAIM_FEE = exports.ALIGNED_PRECISION_FACTOR_POW = exports.CLAIM_STATUS_PREFIX = exports.TEST_ORACLE_PREFIX = exports.ALIGNED_DISTRIBUTOR_PREFIX = exports.DISTRIBUTOR_PREFIX = exports.DISTRIBUTOR_ADMIN_OFFSET = exports.DISTRIBUTOR_MINT_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET = void 0;
|
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
-
const common_1 = require("@streamflow/common");
|
|
6
|
-
exports.ANCHOR_DISCRIMINATOR_OFFSET = 8;
|
|
7
|
-
exports.DISTRIBUTOR_MINT_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET + 41;
|
|
8
|
-
exports.DISTRIBUTOR_ADMIN_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET + 201;
|
|
9
|
-
exports.DISTRIBUTOR_PREFIX = Buffer.from("MerkleDistributor", "utf-8");
|
|
10
|
-
exports.ALIGNED_DISTRIBUTOR_PREFIX = Buffer.from("aligned-distributor", "utf-8");
|
|
11
|
-
exports.TEST_ORACLE_PREFIX = Buffer.from("test-oracle", "utf-8");
|
|
12
|
-
exports.CLAIM_STATUS_PREFIX = Buffer.from("ClaimStatus", "utf-8");
|
|
13
|
-
exports.ALIGNED_PRECISION_FACTOR_POW = 9;
|
|
14
|
-
exports.AIRDROP_CLAIM_FEE = BigInt(5200000);
|
|
15
|
-
exports.STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js_1.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
16
|
-
exports.ONE_IN_BASIS_POINTS = BigInt(10000);
|
|
17
|
-
exports.ALIGNED_DISTRIBUTOR_PROGRAM_ID = {
|
|
18
|
-
[common_1.ICluster.Devnet]: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
19
|
-
[common_1.ICluster.Mainnet]: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
20
|
-
[common_1.ICluster.Testnet]: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
21
|
-
[common_1.ICluster.Local]: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
22
|
-
};
|
|
23
|
-
exports.DISTRIBUTOR_PROGRAM_ID = {
|
|
24
|
-
[common_1.ICluster.Devnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
25
|
-
[common_1.ICluster.Mainnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
26
|
-
[common_1.ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
27
|
-
[common_1.ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
28
|
-
};
|