@streamflow/distributor 6.0.3 → 6.1.0

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.
@@ -89,7 +89,7 @@ var SolanaDistributorClient = /** @class */ (function () {
89
89
  SolanaDistributorClient.prototype.create = function (data, _a) {
90
90
  var invoker = _a.invoker, _b = _a.isNative, isNative = _b === void 0 ? false : _b, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
91
91
  return __awaiter(this, void 0, void 0, function () {
92
- var ixs, mint, _c, mintAccount, programId, distributorPublicKey, tokenVault, senderTokens, args, accounts, _d, _e, _f, _g, nowTs, endVestingTs, startVestingTs, _h, tx, hash, signature;
92
+ var ixs, mint, _c, mintAccount, programId, distributorPublicKey, tokenVault, senderTokens, args, accounts, _d, _e, _f, _g, nowTs, endVestingTs, startVestingTs, _h, tx, hash, context, signature;
93
93
  return __generator(this, function (_j) {
94
94
  switch (_j.label) {
95
95
  case 0:
@@ -148,8 +148,12 @@ var SolanaDistributorClient = /** @class */ (function () {
148
148
  ixs.push((0, spl_token_1.createTransferCheckedInstruction)(senderTokens, mint, tokenVault, invoker.publicKey, BigInt(data.maxTotalClaim.toString()), mintAccount.decimals, undefined, programId));
149
149
  return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, invoker.publicKey)];
150
150
  case 6:
151
- _h = _j.sent(), tx = _h.tx, hash = _h.hash;
152
- return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, hash)];
151
+ _h = _j.sent(), tx = _h.tx, hash = _h.hash, context = _h.context;
152
+ return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, {
153
+ hash: hash,
154
+ context: context,
155
+ commitment: this.getCommitment(),
156
+ })];
153
157
  case 7:
154
158
  signature = _j.sent();
155
159
  return [2 /*return*/, {
@@ -164,7 +168,7 @@ var SolanaDistributorClient = /** @class */ (function () {
164
168
  SolanaDistributorClient.prototype.claim = function (data, _a) {
165
169
  var invoker = _a.invoker, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
166
170
  return __awaiter(this, void 0, void 0, function () {
167
- var distributorPublicKey, distributor, programId, ixs, _b, _c, _d, _e, invokerTokens, claimStatusPublicKey, claimStatus, accounts, args, nowTs, _f, tx, hash, signature;
171
+ var distributorPublicKey, distributor, programId, ixs, _b, _c, _d, _e, invokerTokens, claimStatusPublicKey, claimStatus, accounts, args, nowTs, _f, tx, hash, context, signature;
168
172
  return __generator(this, function (_g) {
169
173
  switch (_g.label) {
170
174
  case 0:
@@ -219,8 +223,12 @@ var SolanaDistributorClient = /** @class */ (function () {
219
223
  }
220
224
  return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, invoker.publicKey)];
221
225
  case 6:
222
- _f = _g.sent(), tx = _f.tx, hash = _f.hash;
223
- return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, hash)];
226
+ _f = _g.sent(), tx = _f.tx, hash = _f.hash, context = _f.context;
227
+ return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, {
228
+ hash: hash,
229
+ context: context,
230
+ commitment: this.getCommitment(),
231
+ })];
224
232
  case 7:
225
233
  signature = _g.sent();
226
234
  return [2 /*return*/, { ixs: ixs, txId: signature }];
@@ -231,7 +239,7 @@ var SolanaDistributorClient = /** @class */ (function () {
231
239
  SolanaDistributorClient.prototype.clawback = function (data, _a) {
232
240
  var invoker = _a.invoker, computePrice = _a.computePrice, computeLimit = _a.computeLimit;
233
241
  return __awaiter(this, void 0, void 0, function () {
234
- var distributorPublicKey, distributor, programId, ixs, _b, _c, _d, _e, accounts, _f, tx, hash, signature;
242
+ var distributorPublicKey, distributor, programId, ixs, _b, _c, _d, _e, accounts, _f, tx, hash, context, signature;
235
243
  return __generator(this, function (_g) {
236
244
  switch (_g.label) {
237
245
  case 0:
@@ -267,8 +275,12 @@ var SolanaDistributorClient = /** @class */ (function () {
267
275
  ixs.push((0, instructions_1.clawback)(accounts, this.programId));
268
276
  return [4 /*yield*/, (0, solana_1.prepareTransaction)(this.connection, ixs, invoker.publicKey)];
269
277
  case 4:
270
- _f = _g.sent(), tx = _f.tx, hash = _f.hash;
271
- return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, hash)];
278
+ _f = _g.sent(), tx = _f.tx, hash = _f.hash, context = _f.context;
279
+ return [4 /*yield*/, (0, utils_1.wrappedSignAndExecuteTransaction)(this.connection, invoker, tx, {
280
+ hash: hash,
281
+ context: context,
282
+ commitment: this.getCommitment(),
283
+ })];
272
284
  case 5:
273
285
  signature = _g.sent();
274
286
  return [2 /*return*/, { ixs: ixs, txId: signature }];
@@ -1,5 +1,6 @@
1
1
  import { SignerWalletAdapter } from "@solana/wallet-adapter-base";
2
- import { BlockhashWithExpiryBlockHeight, Connection, Keypair, PublicKey, Transaction } from "@solana/web3.js";
2
+ import { Connection, Keypair, PublicKey, Transaction, VersionedTransaction } from "@solana/web3.js";
3
+ import { ConfirmationParams } from "@streamflow/common/solana";
3
4
  export declare function getDistributorPda(programId: PublicKey, mint: PublicKey, version: number): PublicKey;
4
5
  export declare function getClaimantStatusPda(programId: PublicKey, distributor: PublicKey, claimant: PublicKey): PublicKey;
5
- export declare function wrappedSignAndExecuteTransaction(connection: Connection, invoker: Keypair | SignerWalletAdapter, tx: Transaction, hash: BlockhashWithExpiryBlockHeight): Promise<string>;
6
+ export declare function wrappedSignAndExecuteTransaction(connection: Connection, invoker: Keypair | SignerWalletAdapter, tx: Transaction | VersionedTransaction, confirmationParams: ConfirmationParams): Promise<string>;
@@ -59,14 +59,14 @@ 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 wrappedSignAndExecuteTransaction(connection, invoker, tx, hash) {
62
+ function wrappedSignAndExecuteTransaction(connection, invoker, tx, confirmationParams) {
63
63
  return __awaiter(this, void 0, void 0, function () {
64
64
  var err_1, parsed;
65
65
  return __generator(this, function (_a) {
66
66
  switch (_a.label) {
67
67
  case 0:
68
68
  _a.trys.push([0, 2, , 3]);
69
- return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(connection, invoker, tx, hash)];
69
+ return [4 /*yield*/, (0, solana_1.signAndExecuteTransaction)(connection, invoker, tx, confirmationParams)];
70
70
  case 1: return [2 /*return*/, _a.sent()];
71
71
  case 2:
72
72
  err_1 = _a.sent();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/distributor",
3
- "version": "6.0.3",
3
+ "version": "6.1.0",
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,7 +22,7 @@
22
22
  "lint": "eslint --fix .",
23
23
  "prepublishOnly": "npm run lint && npm run build"
24
24
  },
25
- "gitHead": "d8f882dcb32394efb4ca997fff05e8c30128f14f",
25
+ "gitHead": "170947ffbd1de885ac95c4b809b0e889d938eaaf",
26
26
  "devDependencies": {
27
27
  "@streamflow/eslint-config": "6.0.0",
28
28
  "@types/bn.js": "5.1.1",
@@ -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.0.3",
41
+ "@streamflow/common": "6.1.0",
42
42
  "bn.js": "5.2.1",
43
43
  "borsh": "^2.0.0",
44
44
  "bs58": "5.0.0"