@streamflow/distributor 7.4.1 → 7.4.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/README.md +42 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -67,7 +67,9 @@ const res = await client.create(
|
|
|
67
67
|
startVestingTs: 0, // Timestamp when Airdrop starts
|
|
68
68
|
endVestingTs: now + 3600 * 24 * 7, // Timestamp when Airdrop ends
|
|
69
69
|
clawbackStartTs: now + 5, // Timestamp after which Airdrop can be clawed back to the Sender address
|
|
70
|
-
|
|
70
|
+
claimsClosableByAdmin: false, // Whether individual Claims can be closed by the Sender
|
|
71
|
+
claimsClosableByClaimant: false, // Whether the Recipient can close their own Claim
|
|
72
|
+
claimsLimit: null, // The number of times a Recipient can Claim the Airdrop - 0 or null for no limit on claims
|
|
71
73
|
},
|
|
72
74
|
solanaParams,
|
|
73
75
|
);
|
|
@@ -100,6 +102,45 @@ const claimRes = await client.claim(
|
|
|
100
102
|
);
|
|
101
103
|
```
|
|
102
104
|
|
|
105
|
+
## Close a Claim
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
const solanaParams = {
|
|
109
|
+
invoker: recipient, // SignerWalletAdapter or Keypair of Recipient account
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// By Admin
|
|
113
|
+
const closeRes = await client.closeClaim(
|
|
114
|
+
{
|
|
115
|
+
id: res.metadataId, // address of the Distributor Account
|
|
116
|
+
claimant: "s3pWmY359mDrNRnDBZ3v5TrrqqxvxiW2t4U2WZyxRoA" // address of the Recipient/Claimant
|
|
117
|
+
},
|
|
118
|
+
solanaParams,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// By Claimant
|
|
122
|
+
const closeRes = await client.closeClaim(
|
|
123
|
+
{
|
|
124
|
+
id: res.metadataId, // address of the Distributor Account
|
|
125
|
+
proof: [
|
|
126
|
+
[
|
|
127
|
+
36, 11, 128, 61, 125, 228, 9, 50, 112, 51, 54, 201, 213, 81, 228, 216, 62, 191, 68, 63, 59, 125, 163, 77, 44,
|
|
128
|
+
88, 170, 65, 139, 25, 147, 145,
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
53, 101, 204, 14, 202, 64, 98, 238, 49, 6, 119, 208, 98, 195, 150, 81, 191, 55, 46, 103, 91, 245, 121, 195,
|
|
132
|
+
43, 104, 75, 183, 12, 38, 37, 153,
|
|
133
|
+
],
|
|
134
|
+
], // Merkle Proof used to verify claim
|
|
135
|
+
amountUnlocked: new BN("0"), // Total amount unlocked for a Recipient
|
|
136
|
+
amountLocked: new BN("1000000000"), // Total amount locked for a Recipient
|
|
137
|
+
claimant: "s3pWmY359mDrNRnDBZ3v5TrrqqxvxiW2t4U2WZyxRoA" // address of the Recipient/Claimant
|
|
138
|
+
},
|
|
139
|
+
solanaParams,
|
|
140
|
+
);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
|
|
103
144
|
## Clawback an Airdrop
|
|
104
145
|
|
|
105
146
|
Returns all funds to the original Sender.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/distributor",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.2",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
|
|
5
5
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"lint": "eslint --fix .",
|
|
27
27
|
"prepublishOnly": "npm run lint && npm run build"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "881c66c302f40bbc9810619def25f59cd6777d10",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@streamflow/eslint-config": "7.4.
|
|
31
|
+
"@streamflow/eslint-config": "7.4.2",
|
|
32
32
|
"@types/bn.js": "5.1.1",
|
|
33
33
|
"date-fns": "2.28.0",
|
|
34
34
|
"typescript": "^5.6.3"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@solana/spl-token": "0.4.9",
|
|
41
41
|
"@solana/wallet-adapter-base": "0.9.19",
|
|
42
42
|
"@solana/web3.js": "1.95.4",
|
|
43
|
-
"@streamflow/common": "7.4.
|
|
43
|
+
"@streamflow/common": "7.4.2",
|
|
44
44
|
"bn.js": "5.2.1",
|
|
45
45
|
"borsh": "^2.0.0",
|
|
46
46
|
"bs58": "5.0.0",
|