@streamflow/distributor 6.2.0 → 6.3.1

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.
@@ -168,7 +168,7 @@ var SolanaDistributorClient = /** @class */ (function () {
168
168
  SolanaDistributorClient.prototype.claim = function (data, _a) {
169
169
  var invoker = _a.invoker, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
170
170
  return __awaiter(this, void 0, void 0, function () {
171
- var distributorPublicKey, distributor, tokenProgramId, ixs, _b, _c, _d, _e, invokerTokens, claimStatusPublicKey, claimStatus, accounts, args, nowTs, _f, tx, hash, context, signature;
171
+ var distributorPublicKey, distributor, tokenProgramId, ixs, _b, _c, _d, _e, invokerTokens, claimStatusPublicKey, eventAuthorityPublicKey, claimStatus, accounts, args, nowTs, _f, tx, hash, context, signature;
172
172
  return __generator(this, function (_g) {
173
173
  switch (_g.label) {
174
174
  case 0:
@@ -196,6 +196,7 @@ var SolanaDistributorClient = /** @class */ (function () {
196
196
  case 4:
197
197
  invokerTokens = _g.sent();
198
198
  claimStatusPublicKey = (0, utils_1.getClaimantStatusPda)(this.programId, distributorPublicKey, invoker.publicKey);
199
+ eventAuthorityPublicKey = (0, utils_1.getEventAuthorityPda)(this.programId);
199
200
  return [4 /*yield*/, accounts_1.ClaimStatus.fetch(this.connection, claimStatusPublicKey)];
200
201
  case 5:
201
202
  claimStatus = _g.sent();
@@ -208,6 +209,8 @@ var SolanaDistributorClient = /** @class */ (function () {
208
209
  mint: distributor.mint,
209
210
  tokenProgram: tokenProgramId,
210
211
  systemProgram: web3_js_1.SystemProgram.programId,
212
+ eventAuthority: eventAuthorityPublicKey,
213
+ program: this.programId,
211
214
  };
212
215
  if (!claimStatus) {
213
216
  args = {
@@ -17,5 +17,7 @@ export interface ClaimLockedAccounts {
17
17
  mint: PublicKey;
18
18
  /** SPL [Token] program. */
19
19
  tokenProgram: PublicKey;
20
+ eventAuthority: PublicKey;
21
+ program: PublicKey;
20
22
  }
21
23
  export declare function claimLocked(accounts: ClaimLockedAccounts, programId?: PublicKey): TransactionInstruction;
@@ -13,6 +13,8 @@ function claimLocked(accounts, programId) {
13
13
  { pubkey: accounts.claimant, isSigner: true, isWritable: true },
14
14
  { pubkey: accounts.mint, isSigner: false, isWritable: false },
15
15
  { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
16
+ { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
17
+ { pubkey: accounts.program, isSigner: false, isWritable: false },
16
18
  ];
17
19
  var identifier = Buffer.from([34, 206, 181, 23, 11, 207, 147, 90]);
18
20
  var data = identifier;
@@ -9,5 +9,7 @@ export interface CloseClaimAccounts {
9
9
  claimStatus: PublicKey;
10
10
  /** The [System] program. */
11
11
  systemProgram: PublicKey;
12
+ eventAuthority: PublicKey;
13
+ program: PublicKey;
12
14
  }
13
15
  export declare function closeClaim(accounts: CloseClaimAccounts, programId?: PublicKey): TransactionInstruction;
@@ -11,6 +11,8 @@ function closeClaim(accounts, programId) {
11
11
  { pubkey: accounts.claimant, isSigner: false, isWritable: false },
12
12
  { pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
13
13
  { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
14
+ { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
15
+ { pubkey: accounts.program, isSigner: false, isWritable: false },
14
16
  ];
15
17
  var identifier = Buffer.from([42, 177, 165, 35, 213, 179, 211, 19]);
16
18
  var data = identifier;
@@ -22,6 +22,8 @@ export interface NewClaimAccounts {
22
22
  tokenProgram: PublicKey;
23
23
  /** The [System] program. */
24
24
  systemProgram: PublicKey;
25
+ eventAuthority: PublicKey;
26
+ program: PublicKey;
25
27
  }
26
28
  export declare const layout: any;
27
29
  export declare function newClaim(args: NewClaimArgs, accounts: NewClaimAccounts, programId?: PublicKey): TransactionInstruction;
@@ -43,6 +43,8 @@ function newClaim(args, accounts, programId) {
43
43
  { pubkey: accounts.mint, isSigner: false, isWritable: false },
44
44
  { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
45
45
  { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
46
+ { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
47
+ { pubkey: accounts.program, isSigner: false, isWritable: false },
46
48
  ];
47
49
  var identifier = Buffer.from([78, 177, 98, 123, 210, 21, 187, 83]);
48
50
  var buffer = Buffer.alloc(1000);
@@ -3,4 +3,5 @@ import { Connection, Keypair, PublicKey, Transaction, VersionedTransaction } fro
3
3
  import { ConfirmationParams } from "@streamflow/common/solana";
4
4
  export declare function getDistributorPda(programId: PublicKey, mint: PublicKey, version: number): PublicKey;
5
5
  export declare function getClaimantStatusPda(programId: PublicKey, distributor: PublicKey, claimant: PublicKey): PublicKey;
6
+ export declare function getEventAuthorityPda(programId: PublicKey): PublicKey;
6
7
  export declare function wrappedSignAndExecuteTransaction(connection: Connection, invoker: Keypair | SignerWalletAdapter, tx: Transaction | VersionedTransaction, confirmationParams: ConfirmationParams): Promise<string>;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.wrappedSignAndExecuteTransaction = exports.getClaimantStatusPda = exports.getDistributorPda = void 0;
39
+ exports.wrappedSignAndExecuteTransaction = exports.getEventAuthorityPda = exports.getClaimantStatusPda = exports.getDistributorPda = void 0;
40
40
  var web3_js_1 = require("@solana/web3.js");
41
41
  var common_1 = require("@streamflow/common");
42
42
  var solana_1 = require("@streamflow/common/solana");
@@ -59,6 +59,13 @@ function getClaimantStatusPda(programId, distributor, claimant) {
59
59
  return web3_js_1.PublicKey.findProgramAddressSync(seeds, programId)[0];
60
60
  }
61
61
  exports.getClaimantStatusPda = getClaimantStatusPda;
62
+ function getEventAuthorityPda(programId) {
63
+ // Constructing the seed for the PDA
64
+ var seeds = [Buffer.from("__event_authority")];
65
+ // Finding the PDA
66
+ return web3_js_1.PublicKey.findProgramAddressSync(seeds, programId)[0];
67
+ }
68
+ exports.getEventAuthorityPda = getEventAuthorityPda;
62
69
  function wrappedSignAndExecuteTransaction(connection, invoker, tx, confirmationParams) {
63
70
  return __awaiter(this, void 0, void 0, function () {
64
71
  var err_1, parsed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/distributor",
3
- "version": "6.2.0",
3
+ "version": "6.3.1",
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/index.js",
@@ -22,9 +22,9 @@
22
22
  "lint": "eslint --fix .",
23
23
  "prepublishOnly": "npm run lint && npm run build"
24
24
  },
25
- "gitHead": "06f6635b47854013b63db62e9da401b4f004bfdc",
25
+ "gitHead": "dd901627ee3ece821b9be3668b489ab4267a58df",
26
26
  "devDependencies": {
27
- "@streamflow/eslint-config": "6.0.0",
27
+ "@streamflow/eslint-config": "6.3.1",
28
28
  "@types/bn.js": "5.1.1",
29
29
  "@types/jest": "29.2.4",
30
30
  "date-fns": "2.28.0",
@@ -38,7 +38,7 @@
38
38
  "@solana/spl-token": "0.3.6",
39
39
  "@solana/wallet-adapter-base": "0.9.19",
40
40
  "@solana/web3.js": "1.70.1",
41
- "@streamflow/common": "6.2.0",
41
+ "@streamflow/common": "6.3.1",
42
42
  "bn.js": "5.2.1",
43
43
  "borsh": "^2.0.0",
44
44
  "bs58": "5.0.0"