Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for CloseClaim and update create docs #257

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "7.4.1",
"version": "7.4.2",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/common",
"version": "7.4.1",
"version": "7.4.2",
"description": "Common utilities and types used by streamflow packages.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "./dist/esm/index.js",
Expand Down
43 changes: 42 additions & 1 deletion packages/distributor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const res = await client.create(
startVestingTs: 0, // Timestamp when Airdrop starts
endVestingTs: now + 3600 * 24 * 7, // Timestamp when Airdrop ends
clawbackStartTs: now + 5, // Timestamp after which Airdrop can be clawed back to the Sender address
claimsClosable: false, // Whether individual Claims can be closed by the Sender
claimsClosableByAdmin: false, // Whether individual Claims can be closed by the Sender
claimsClosableByClaimant: false, // Whether the Recipient can close their own Claim
claimsLimit: null, // The number of times a Recipient can Claim the Airdrop - 0 or null for no limit on claims
},
solanaParams,
);
Expand Down Expand Up @@ -100,6 +102,45 @@ const claimRes = await client.claim(
);
```

## Close a Claim

```javascript
const solanaParams = {
invoker: recipient, // SignerWalletAdapter or Keypair of Recipient account
};

// By Admin
const closeRes = await client.closeClaim(
{
id: res.metadataId, // address of the Distributor Account
claimant: "s3pWmY359mDrNRnDBZ3v5TrrqqxvxiW2t4U2WZyxRoA" // address of the Recipient/Claimant
},
solanaParams,
);

// By Claimant
const closeRes = await client.closeClaim(
{
id: res.metadataId, // address of the Distributor Account
proof: [
[
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,
88, 170, 65, 139, 25, 147, 145,
],
[
53, 101, 204, 14, 202, 64, 98, 238, 49, 6, 119, 208, 98, 195, 150, 81, 191, 55, 46, 103, 91, 245, 121, 195,
43, 104, 75, 183, 12, 38, 37, 153,
],
], // Merkle Proof used to verify claim
amountUnlocked: new BN("0"), // Total amount unlocked for a Recipient
amountLocked: new BN("1000000000"), // Total amount locked for a Recipient
claimant: "s3pWmY359mDrNRnDBZ3v5TrrqqxvxiW2t4U2WZyxRoA" // address of the Recipient/Claimant
},
solanaParams,
);
```


## Clawback an Airdrop

Returns all funds to the original Sender.
Expand Down
2 changes: 1 addition & 1 deletion packages/distributor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/distributor",
"version": "7.4.1",
"version": "7.4.2",
"description": "JavaScript SDK to interact with Streamflow Airdrop protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/eslint-config",
"version": "7.4.1",
"version": "7.4.2",
"license": "ISC",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/launchpad/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/launchpad",
"version": "7.4.1",
"version": "7.4.2",
"description": "JavaScript SDK to interact with Streamflow Launchpad protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/staking/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/staking",
"version": "7.4.1",
"version": "7.4.2",
"description": "JavaScript SDK to interact with Streamflow Staking protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@streamflow/stream",
"version": "7.4.1",
"version": "7.4.2",
"description": "JavaScript SDK to interact with Streamflow protocol.",
"homepage": "https://github.com/streamflow-finance/js-sdk/",
"main": "./dist/esm/index.js",
Expand Down
Loading