@streamflow/distributor 7.5.3 → 8.0.0-alpha.p287.39c8818
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 +3101 -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 +3095 -0
- package/dist/cjs/solana/index.cjs.map +1 -0
- package/dist/cjs/solana/index.d.cts +1486 -0
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.js +3075 -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 +1486 -7
- package/dist/esm/solana/index.js +3047 -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
|
@@ -1,135 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ClaimStatus = void 0;
|
|
30
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
31
|
-
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
32
|
-
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
33
|
-
const programId_1 = require("../programId");
|
|
34
|
-
/** Holds whether or not a claimant has claimed tokens. */
|
|
35
|
-
class ClaimStatus {
|
|
36
|
-
constructor(fields) {
|
|
37
|
-
this.claimant = fields.claimant;
|
|
38
|
-
this.lockedAmount = fields.lockedAmount;
|
|
39
|
-
this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
|
|
40
|
-
this.unlockedAmount = fields.unlockedAmount;
|
|
41
|
-
this.lastClaimTs = fields.lastClaimTs;
|
|
42
|
-
this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
|
|
43
|
-
this.closed = fields.closed;
|
|
44
|
-
this.distributor = fields.distributor;
|
|
45
|
-
this.claimsCount = fields.claimsCount;
|
|
46
|
-
this.closedTs = fields.closedTs;
|
|
47
|
-
this.buffer2 = fields.buffer2;
|
|
48
|
-
}
|
|
49
|
-
static async fetch(c, address, programId = programId_1.PROGRAM_ID) {
|
|
50
|
-
const info = await c.getAccountInfo(address);
|
|
51
|
-
if (info === null) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
if (!info.owner.equals(programId)) {
|
|
55
|
-
throw new Error("account doesn't belong to this program");
|
|
56
|
-
}
|
|
57
|
-
return this.decode(info.data);
|
|
58
|
-
}
|
|
59
|
-
static async fetchMultiple(c, addresses, programId = programId_1.PROGRAM_ID) {
|
|
60
|
-
const infos = await c.getMultipleAccountsInfo(addresses);
|
|
61
|
-
return infos.map((info) => {
|
|
62
|
-
if (info === null) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
if (!info.owner.equals(programId)) {
|
|
66
|
-
throw new Error("account doesn't belong to this program");
|
|
67
|
-
}
|
|
68
|
-
return this.decode(info.data);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
static decode(data) {
|
|
72
|
-
if (!data.slice(0, 8).equals(ClaimStatus.discriminator)) {
|
|
73
|
-
throw new Error("invalid account discriminator");
|
|
74
|
-
}
|
|
75
|
-
const dec = ClaimStatus.layout.decode(data.slice(8));
|
|
76
|
-
return new ClaimStatus({
|
|
77
|
-
claimant: dec.claimant,
|
|
78
|
-
lockedAmount: dec.lockedAmount,
|
|
79
|
-
lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
|
|
80
|
-
unlockedAmount: dec.unlockedAmount,
|
|
81
|
-
lastClaimTs: dec.lastClaimTs,
|
|
82
|
-
lastAmountPerUnlock: dec.lastAmountPerUnlock,
|
|
83
|
-
closed: dec.closed,
|
|
84
|
-
distributor: dec.distributor,
|
|
85
|
-
claimsCount: dec.claimsCount,
|
|
86
|
-
closedTs: dec.closedTs,
|
|
87
|
-
buffer2: dec.buffer2,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
toJSON() {
|
|
91
|
-
return {
|
|
92
|
-
claimant: this.claimant.toString(),
|
|
93
|
-
lockedAmount: this.lockedAmount.toString(),
|
|
94
|
-
lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
|
|
95
|
-
unlockedAmount: this.unlockedAmount.toString(),
|
|
96
|
-
lastClaimTs: this.lastClaimTs.toString(),
|
|
97
|
-
lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
|
|
98
|
-
closed: this.closed,
|
|
99
|
-
distributor: this.distributor.toString(),
|
|
100
|
-
claimsCount: this.claimsCount,
|
|
101
|
-
closedTs: this.closedTs.toString(),
|
|
102
|
-
buffer2: this.buffer2,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
static fromJSON(obj) {
|
|
106
|
-
return new ClaimStatus({
|
|
107
|
-
claimant: new web3_js_1.PublicKey(obj.claimant),
|
|
108
|
-
lockedAmount: new bn_js_1.default(obj.lockedAmount),
|
|
109
|
-
lockedAmountWithdrawn: new bn_js_1.default(obj.lockedAmountWithdrawn),
|
|
110
|
-
unlockedAmount: new bn_js_1.default(obj.unlockedAmount),
|
|
111
|
-
lastClaimTs: new bn_js_1.default(obj.lastClaimTs),
|
|
112
|
-
lastAmountPerUnlock: new bn_js_1.default(obj.lastAmountPerUnlock),
|
|
113
|
-
closed: obj.closed,
|
|
114
|
-
distributor: new web3_js_1.PublicKey(obj.distributor),
|
|
115
|
-
claimsCount: obj.claimsCount,
|
|
116
|
-
closedTs: new bn_js_1.default(obj.closedTs),
|
|
117
|
-
buffer2: obj.buffer2,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.ClaimStatus = ClaimStatus;
|
|
122
|
-
ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
|
|
123
|
-
ClaimStatus.layout = borsh.struct([
|
|
124
|
-
borsh.publicKey("claimant"),
|
|
125
|
-
borsh.u64("lockedAmount"),
|
|
126
|
-
borsh.u64("lockedAmountWithdrawn"),
|
|
127
|
-
borsh.u64("unlockedAmount"),
|
|
128
|
-
borsh.u64("lastClaimTs"),
|
|
129
|
-
borsh.u64("lastAmountPerUnlock"),
|
|
130
|
-
borsh.bool("closed"),
|
|
131
|
-
borsh.publicKey("distributor"),
|
|
132
|
-
borsh.u16("claimsCount"),
|
|
133
|
-
borsh.u64("closedTs"),
|
|
134
|
-
borsh.array(borsh.u8(), 22, "buffer2"),
|
|
135
|
-
]);
|
|
@@ -1,215 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.MerkleDistributor = void 0;
|
|
30
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
31
|
-
const bn_js_1 = __importDefault(require("bn.js")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
32
|
-
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
33
|
-
const programId_1 = require("../programId");
|
|
34
|
-
/** State for the account which distributes tokens. */
|
|
35
|
-
class MerkleDistributor {
|
|
36
|
-
constructor(fields) {
|
|
37
|
-
this.bump = fields.bump;
|
|
38
|
-
this.version = fields.version;
|
|
39
|
-
this.root = fields.root;
|
|
40
|
-
this.mint = fields.mint;
|
|
41
|
-
this.tokenVault = fields.tokenVault;
|
|
42
|
-
this.maxTotalClaim = fields.maxTotalClaim;
|
|
43
|
-
this.maxNumNodes = fields.maxNumNodes;
|
|
44
|
-
this.unlockPeriod = fields.unlockPeriod;
|
|
45
|
-
this.totalAmountClaimed = fields.totalAmountClaimed;
|
|
46
|
-
this.numNodesClaimed = fields.numNodesClaimed;
|
|
47
|
-
this.startTs = fields.startTs;
|
|
48
|
-
this.endTs = fields.endTs;
|
|
49
|
-
this.clawbackStartTs = fields.clawbackStartTs;
|
|
50
|
-
this.clawbackReceiver = fields.clawbackReceiver;
|
|
51
|
-
this.admin = fields.admin;
|
|
52
|
-
this.clawedBack = fields.clawedBack;
|
|
53
|
-
this.claimsClosableByAdmin = fields.claimsClosableByAdmin;
|
|
54
|
-
this.canUpdateDuration = fields.canUpdateDuration;
|
|
55
|
-
this.totalAmountUnlocked = fields.totalAmountUnlocked;
|
|
56
|
-
this.totalAmountLocked = fields.totalAmountLocked;
|
|
57
|
-
this.lastDurationUpdateTs = fields.lastDurationUpdateTs;
|
|
58
|
-
this.totalClaimablePreUpdate = fields.totalClaimablePreUpdate;
|
|
59
|
-
this.clawedBackTs = fields.clawedBackTs;
|
|
60
|
-
this.claimsClosableByClaimant = fields.claimsClosableByClaimant;
|
|
61
|
-
this.claimsLimit = fields.claimsLimit;
|
|
62
|
-
this.buffer2 = fields.buffer2;
|
|
63
|
-
this.buffer3 = fields.buffer3;
|
|
64
|
-
}
|
|
65
|
-
static async fetch(c, address, programId = programId_1.PROGRAM_ID) {
|
|
66
|
-
const info = await c.getAccountInfo(address);
|
|
67
|
-
if (info === null) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
if (!info.owner.equals(programId)) {
|
|
71
|
-
throw new Error("account doesn't belong to this program");
|
|
72
|
-
}
|
|
73
|
-
return this.decode(info.data);
|
|
74
|
-
}
|
|
75
|
-
static async fetchMultiple(c, addresses, programId = programId_1.PROGRAM_ID) {
|
|
76
|
-
const infos = await c.getMultipleAccountsInfo(addresses);
|
|
77
|
-
return infos.map((info) => {
|
|
78
|
-
if (info === null) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
if (!info.owner.equals(programId)) {
|
|
82
|
-
throw new Error("account doesn't belong to this program");
|
|
83
|
-
}
|
|
84
|
-
return this.decode(info.data);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
static decode(data) {
|
|
88
|
-
if (!data.slice(0, 8).equals(MerkleDistributor.discriminator)) {
|
|
89
|
-
throw new Error("invalid account discriminator");
|
|
90
|
-
}
|
|
91
|
-
const dec = MerkleDistributor.layout.decode(data.slice(8));
|
|
92
|
-
return new MerkleDistributor({
|
|
93
|
-
bump: dec.bump,
|
|
94
|
-
version: dec.version,
|
|
95
|
-
root: dec.root,
|
|
96
|
-
mint: dec.mint,
|
|
97
|
-
tokenVault: dec.tokenVault,
|
|
98
|
-
maxTotalClaim: dec.maxTotalClaim,
|
|
99
|
-
maxNumNodes: dec.maxNumNodes,
|
|
100
|
-
unlockPeriod: dec.unlockPeriod,
|
|
101
|
-
totalAmountClaimed: dec.totalAmountClaimed,
|
|
102
|
-
numNodesClaimed: dec.numNodesClaimed,
|
|
103
|
-
startTs: dec.startTs,
|
|
104
|
-
endTs: dec.endTs,
|
|
105
|
-
clawbackStartTs: dec.clawbackStartTs,
|
|
106
|
-
clawbackReceiver: dec.clawbackReceiver,
|
|
107
|
-
admin: dec.admin,
|
|
108
|
-
clawedBack: dec.clawedBack,
|
|
109
|
-
claimsClosableByAdmin: dec.claimsClosableByAdmin,
|
|
110
|
-
canUpdateDuration: dec.canUpdateDuration,
|
|
111
|
-
totalAmountUnlocked: dec.totalAmountUnlocked,
|
|
112
|
-
totalAmountLocked: dec.totalAmountLocked,
|
|
113
|
-
lastDurationUpdateTs: dec.lastDurationUpdateTs,
|
|
114
|
-
totalClaimablePreUpdate: dec.totalClaimablePreUpdate,
|
|
115
|
-
clawedBackTs: dec.clawedBackTs,
|
|
116
|
-
claimsClosableByClaimant: dec.claimsClosableByClaimant,
|
|
117
|
-
claimsLimit: dec.claimsLimit,
|
|
118
|
-
buffer2: dec.buffer2,
|
|
119
|
-
buffer3: dec.buffer3,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
toJSON() {
|
|
123
|
-
return {
|
|
124
|
-
bump: this.bump,
|
|
125
|
-
version: this.version.toString(),
|
|
126
|
-
root: this.root,
|
|
127
|
-
mint: this.mint.toString(),
|
|
128
|
-
tokenVault: this.tokenVault.toString(),
|
|
129
|
-
maxTotalClaim: this.maxTotalClaim.toString(),
|
|
130
|
-
maxNumNodes: this.maxNumNodes.toString(),
|
|
131
|
-
unlockPeriod: this.unlockPeriod.toString(),
|
|
132
|
-
totalAmountClaimed: this.totalAmountClaimed.toString(),
|
|
133
|
-
numNodesClaimed: this.numNodesClaimed.toString(),
|
|
134
|
-
startTs: this.startTs.toString(),
|
|
135
|
-
endTs: this.endTs.toString(),
|
|
136
|
-
clawbackStartTs: this.clawbackStartTs.toString(),
|
|
137
|
-
clawbackReceiver: this.clawbackReceiver.toString(),
|
|
138
|
-
admin: this.admin.toString(),
|
|
139
|
-
clawedBack: this.clawedBack,
|
|
140
|
-
claimsClosableByAdmin: this.claimsClosableByAdmin,
|
|
141
|
-
canUpdateDuration: this.canUpdateDuration,
|
|
142
|
-
totalAmountUnlocked: this.totalAmountUnlocked.toString(),
|
|
143
|
-
totalAmountLocked: this.totalAmountLocked.toString(),
|
|
144
|
-
lastDurationUpdateTs: this.lastDurationUpdateTs.toString(),
|
|
145
|
-
totalClaimablePreUpdate: this.totalClaimablePreUpdate.toString(),
|
|
146
|
-
clawedBackTs: this.clawedBackTs.toString(),
|
|
147
|
-
claimsClosableByClaimant: this.claimsClosableByClaimant,
|
|
148
|
-
claimsLimit: this.claimsLimit,
|
|
149
|
-
buffer2: this.buffer2,
|
|
150
|
-
buffer3: this.buffer3,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
static fromJSON(obj) {
|
|
154
|
-
return new MerkleDistributor({
|
|
155
|
-
bump: obj.bump,
|
|
156
|
-
version: new bn_js_1.default(obj.version),
|
|
157
|
-
root: obj.root,
|
|
158
|
-
mint: new web3_js_1.PublicKey(obj.mint),
|
|
159
|
-
tokenVault: new web3_js_1.PublicKey(obj.tokenVault),
|
|
160
|
-
maxTotalClaim: new bn_js_1.default(obj.maxTotalClaim),
|
|
161
|
-
maxNumNodes: new bn_js_1.default(obj.maxNumNodes),
|
|
162
|
-
unlockPeriod: new bn_js_1.default(obj.unlockPeriod),
|
|
163
|
-
totalAmountClaimed: new bn_js_1.default(obj.totalAmountClaimed),
|
|
164
|
-
numNodesClaimed: new bn_js_1.default(obj.numNodesClaimed),
|
|
165
|
-
startTs: new bn_js_1.default(obj.startTs),
|
|
166
|
-
endTs: new bn_js_1.default(obj.endTs),
|
|
167
|
-
clawbackStartTs: new bn_js_1.default(obj.clawbackStartTs),
|
|
168
|
-
clawbackReceiver: new web3_js_1.PublicKey(obj.clawbackReceiver),
|
|
169
|
-
admin: new web3_js_1.PublicKey(obj.admin),
|
|
170
|
-
clawedBack: obj.clawedBack,
|
|
171
|
-
claimsClosableByAdmin: obj.claimsClosableByAdmin,
|
|
172
|
-
canUpdateDuration: obj.canUpdateDuration,
|
|
173
|
-
totalAmountUnlocked: new bn_js_1.default(obj.totalAmountUnlocked),
|
|
174
|
-
totalAmountLocked: new bn_js_1.default(obj.totalAmountLocked),
|
|
175
|
-
lastDurationUpdateTs: new bn_js_1.default(obj.lastDurationUpdateTs),
|
|
176
|
-
totalClaimablePreUpdate: new bn_js_1.default(obj.totalClaimablePreUpdate),
|
|
177
|
-
clawedBackTs: new bn_js_1.default(obj.clawedBackTs),
|
|
178
|
-
claimsClosableByClaimant: obj.claimsClosableByClaimant,
|
|
179
|
-
claimsLimit: obj.claimsLimit,
|
|
180
|
-
buffer2: obj.buffer2,
|
|
181
|
-
buffer3: obj.buffer3,
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
exports.MerkleDistributor = MerkleDistributor;
|
|
186
|
-
MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
|
|
187
|
-
MerkleDistributor.layout = borsh.struct([
|
|
188
|
-
borsh.u8("bump"),
|
|
189
|
-
borsh.u64("version"),
|
|
190
|
-
borsh.array(borsh.u8(), 32, "root"),
|
|
191
|
-
borsh.publicKey("mint"),
|
|
192
|
-
borsh.publicKey("tokenVault"),
|
|
193
|
-
borsh.u64("maxTotalClaim"),
|
|
194
|
-
borsh.u64("maxNumNodes"),
|
|
195
|
-
borsh.u64("unlockPeriod"),
|
|
196
|
-
borsh.u64("totalAmountClaimed"),
|
|
197
|
-
borsh.u64("numNodesClaimed"),
|
|
198
|
-
borsh.u64("startTs"),
|
|
199
|
-
borsh.u64("endTs"),
|
|
200
|
-
borsh.u64("clawbackStartTs"),
|
|
201
|
-
borsh.publicKey("clawbackReceiver"),
|
|
202
|
-
borsh.publicKey("admin"),
|
|
203
|
-
borsh.bool("clawedBack"),
|
|
204
|
-
borsh.bool("claimsClosableByAdmin"),
|
|
205
|
-
borsh.bool("canUpdateDuration"),
|
|
206
|
-
borsh.u64("totalAmountUnlocked"),
|
|
207
|
-
borsh.u64("totalAmountLocked"),
|
|
208
|
-
borsh.u64("lastDurationUpdateTs"),
|
|
209
|
-
borsh.u64("totalClaimablePreUpdate"),
|
|
210
|
-
borsh.u64("clawedBackTs"),
|
|
211
|
-
borsh.bool("claimsClosableByClaimant"),
|
|
212
|
-
borsh.u16("claimsLimit"),
|
|
213
|
-
borsh.array(borsh.u8(), 20, "buffer2"),
|
|
214
|
-
borsh.array(borsh.u8(), 32, "buffer3"),
|
|
215
|
-
]);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MerkleDistributor = exports.ClaimStatus = void 0;
|
|
4
|
-
var ClaimStatus_1 = require("./ClaimStatus");
|
|
5
|
-
Object.defineProperty(exports, "ClaimStatus", { enumerable: true, get: function () { return ClaimStatus_1.ClaimStatus; } });
|
|
6
|
-
var MerkleDistributor_1 = require("./MerkleDistributor");
|
|
7
|
-
Object.defineProperty(exports, "MerkleDistributor", { enumerable: true, get: function () { return MerkleDistributor_1.MerkleDistributor; } });
|