@streamflow/stream 7.0.0-alpha.2 → 7.0.0-alpha.20

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.
Files changed (78) hide show
  1. package/README.md +70 -67
  2. package/dist/cjs/__tests__/aptos/streamClient.spec.js +83 -134
  3. package/dist/cjs/__tests__/common/GenericStreamClient.spec.js +9 -9
  4. package/dist/cjs/aptos/StreamClient.js +162 -367
  5. package/dist/cjs/aptos/constants.js +7 -8
  6. package/dist/cjs/aptos/index.js +3 -3
  7. package/dist/cjs/aptos/types.js +28 -37
  8. package/dist/cjs/aptos/utils.js +4 -4
  9. package/dist/cjs/aptos/wallet.js +20 -75
  10. package/dist/cjs/common/BaseStreamClient.js +11 -59
  11. package/dist/cjs/common/GenericStreamClient.js +46 -72
  12. package/dist/cjs/common/constants.js +4 -3
  13. package/dist/cjs/common/contractUtils.js +33 -18
  14. package/dist/cjs/common/types.js +30 -1
  15. package/dist/cjs/common/utils.js +38 -80
  16. package/dist/cjs/evm/StreamClient.js +198 -456
  17. package/dist/cjs/evm/constants.js +19 -20
  18. package/dist/cjs/evm/types.js +25 -34
  19. package/dist/cjs/evm/utils.js +2 -2
  20. package/dist/cjs/index.js +10 -10
  21. package/dist/cjs/solana/StreamClient.js +759 -1090
  22. package/dist/cjs/solana/constants.js +44 -11
  23. package/dist/cjs/solana/descriptor/idl/streamflow_aligned_unlocks.json +1471 -0
  24. package/dist/cjs/solana/descriptor/streamflow_aligned_unlocks.js +2 -0
  25. package/dist/cjs/solana/index.js +2 -1
  26. package/dist/cjs/solana/instructions.js +75 -81
  27. package/dist/cjs/solana/layout.js +7 -8
  28. package/dist/cjs/solana/lib/derive-accounts.js +17 -0
  29. package/dist/cjs/solana/lib/utils.js +127 -0
  30. package/dist/cjs/solana/types.js +40 -27
  31. package/dist/cjs/sui/StreamClient.js +325 -571
  32. package/dist/cjs/sui/constants.js +19 -20
  33. package/dist/cjs/sui/types.js +28 -62
  34. package/dist/cjs/sui/utils.js +7 -7
  35. package/dist/cjs/sui/wallet.js +13 -63
  36. package/dist/esm/__tests__/aptos/streamClient.spec.js +4 -4
  37. package/dist/esm/aptos/index.d.ts +3 -3
  38. package/dist/esm/aptos/index.js +3 -3
  39. package/dist/esm/aptos/types.d.ts +14 -14
  40. package/dist/esm/aptos/types.js +13 -13
  41. package/dist/esm/common/GenericStreamClient.d.ts +4 -4
  42. package/dist/esm/common/GenericStreamClient.js +4 -4
  43. package/dist/esm/common/constants.d.ts +3 -2
  44. package/dist/esm/common/constants.js +3 -2
  45. package/dist/esm/common/contractUtils.d.ts +18 -15
  46. package/dist/esm/common/contractUtils.js +19 -6
  47. package/dist/esm/common/types.d.ts +112 -57
  48. package/dist/esm/common/types.js +29 -0
  49. package/dist/esm/common/utils.d.ts +11 -11
  50. package/dist/esm/common/utils.js +19 -16
  51. package/dist/esm/evm/StreamClient.d.ts +2 -2
  52. package/dist/esm/evm/StreamClient.js +7 -7
  53. package/dist/esm/evm/types.d.ts +14 -14
  54. package/dist/esm/evm/types.js +13 -13
  55. package/dist/esm/index.d.ts +9 -9
  56. package/dist/esm/index.js +9 -9
  57. package/dist/esm/solana/StreamClient.d.ts +24 -16
  58. package/dist/esm/solana/StreamClient.js +324 -156
  59. package/dist/esm/solana/constants.d.ts +17 -0
  60. package/dist/esm/solana/constants.js +35 -1
  61. package/dist/esm/solana/descriptor/idl/streamflow_aligned_unlocks.json +1471 -0
  62. package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.d.ts +1272 -0
  63. package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.js +1 -0
  64. package/dist/esm/solana/index.d.ts +2 -1
  65. package/dist/esm/solana/index.js +2 -1
  66. package/dist/esm/solana/instructions.d.ts +17 -17
  67. package/dist/esm/solana/instructions.js +18 -19
  68. package/dist/esm/solana/lib/derive-accounts.d.ts +4 -0
  69. package/dist/esm/solana/lib/derive-accounts.js +11 -0
  70. package/dist/esm/solana/{utils.d.ts → lib/utils.d.ts} +1 -3
  71. package/dist/esm/solana/{utils.js → lib/utils.js} +28 -34
  72. package/dist/esm/solana/types.d.ts +72 -39
  73. package/dist/esm/solana/types.js +32 -4
  74. package/dist/esm/sui/StreamClient.js +1 -1
  75. package/dist/esm/sui/types.d.ts +14 -14
  76. package/dist/esm/sui/types.js +13 -13
  77. package/package.json +12 -10
  78. package/dist/cjs/solana/utils.js +0 -222
@@ -1,6 +1,6 @@
1
- import BigNumber from "bignumber.js";
1
+ import BN from "bn.js";
2
2
  import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
3
- import { getNumberFromBigNumber } from "../common/utils.js";
3
+ import { getNumberFromBN } from "../common/utils.js";
4
4
  export class Contract {
5
5
  magic;
6
6
  version;
@@ -51,7 +51,7 @@ export class Contract {
51
51
  this.magic = 0;
52
52
  this.version = parseInt(stream.version);
53
53
  this.createdAt = parseInt(stream.created);
54
- this.withdrawnAmount = BigNumber(stream.withdrawn);
54
+ this.withdrawnAmount = new BN(stream.withdrawn);
55
55
  this.canceledAt = parseInt(stream.canceled_at);
56
56
  this.end = parseInt(stream.end);
57
57
  this.lastWithdrawnAt = parseInt(stream.last_withdrawn_at);
@@ -63,20 +63,20 @@ export class Contract {
63
63
  this.escrowTokens = "";
64
64
  this.streamflowTreasury = "";
65
65
  this.streamflowTreasuryTokens = "";
66
- this.streamflowFeeTotal = BigNumber(0);
67
- this.streamflowFeeWithdrawn = BigNumber(0);
66
+ this.streamflowFeeTotal = new BN(0);
67
+ this.streamflowFeeWithdrawn = new BN(0);
68
68
  this.streamflowFeePercent = parseInt(fees.streamflow_fee_percentage) / 10000;
69
- this.partnerFeeTotal = BigNumber(0);
70
- this.partnerFeeWithdrawn = BigNumber(0);
69
+ this.partnerFeeTotal = new BN(0);
70
+ this.partnerFeeWithdrawn = new BN(0);
71
71
  this.partnerFeePercent = parseInt(fees.partner_fee_percentage) / 10000;
72
72
  this.partner = stream.partner;
73
73
  this.partnerTokens = "";
74
74
  this.start = parseInt(stream.start);
75
- this.depositedAmount = BigNumber(stream.amount);
75
+ this.depositedAmount = new BN(stream.amount);
76
76
  this.period = parseInt(stream.period);
77
- this.amountPerPeriod = BigNumber(stream.amount_per_period);
77
+ this.amountPerPeriod = new BN(stream.amount_per_period);
78
78
  this.cliff = parseInt(stream.start);
79
- this.cliffAmount = BigNumber(stream.cliff_amount);
79
+ this.cliffAmount = new BN(stream.cliff_amount);
80
80
  this.cancelableBySender = meta.cancelable_by_sender;
81
81
  this.cancelableByRecipient = meta.cancelable_by_recipient;
82
82
  this.automaticWithdrawal = meta.automatic_withdrawal;
@@ -87,9 +87,9 @@ export class Contract {
87
87
  this.withdrawalFrequency = parseInt(meta.withdrawal_frequency);
88
88
  this.closed = stream.closed;
89
89
  this.currentPauseStart = parseInt(stream.current_pause_start);
90
- this.pauseCumulative = BigNumber(stream.pause_cumulative);
90
+ this.pauseCumulative = new BN(stream.pause_cumulative);
91
91
  this.lastRateChangeTime = parseInt(stream.last_rate_change_time);
92
- this.fundsUnlockedAtLastRateChange = BigNumber(stream.funds_unlocked_at_last_rate_change);
92
+ this.fundsUnlockedAtLastRateChange = new BN(stream.funds_unlocked_at_last_rate_change);
93
93
  this.type = buildStreamType(this);
94
94
  }
95
95
  unlocked(currentTimestamp) {
@@ -99,6 +99,6 @@ export class Contract {
99
99
  });
100
100
  }
101
101
  remaining(decimals) {
102
- return getNumberFromBigNumber(this.depositedAmount.minus(this.withdrawnAmount), decimals);
102
+ return getNumberFromBN(this.depositedAmount.sub(this.withdrawnAmount), decimals);
103
103
  }
104
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.0-alpha.20",
4
4
  "description": "JavaScript SDK to interact with Streamflow protocol.",
5
5
  "homepage": "https://github.com/streamflow-finance/js-sdk/",
6
6
  "main": "./dist/esm/index.js",
@@ -42,25 +42,27 @@
42
42
  "lint": "eslint --fix .",
43
43
  "prepublishOnly": "npm run lint && npm test && npm run build"
44
44
  },
45
- "gitHead": "64926e169007ef5a65c5342a57d8e37047831015",
45
+ "gitHead": "415bf87d86dbf18d3ac40db20e378cd1df90531e",
46
46
  "devDependencies": {
47
- "@streamflow/eslint-config": "7.0.0-alpha.2",
47
+ "@streamflow/eslint-config": "7.0.0-alpha.20",
48
+ "@types/bn.js": "5.1.1",
48
49
  "@types/ethereum-checksum-address": "^0.0.0",
49
50
  "date-fns": "2.28.0",
50
51
  "typescript": "^5.3.3"
51
52
  },
52
53
  "dependencies": {
53
- "@coral-xyz/borsh": "^0.29.0",
54
- "@manahippo/aptos-wallet-adapter": "1.0.6",
55
- "@mysten/sui.js": "^0.45.1",
54
+ "@coral-xyz/anchor": "^0.30.0",
55
+ "@coral-xyz/borsh": "0.30.1",
56
+ "@manahippo/aptos-wallet-adapter": "1.0.10",
57
+ "@mysten/sui.js": "0.54.1",
56
58
  "@solana/buffer-layout": "4.0.1 ",
57
59
  "@solana/spl-token": "0.3.6",
58
60
  "@solana/wallet-adapter-base": "0.9.19",
59
- "@solana/web3.js": "1.70.1",
60
- "@streamflow/common": "7.0.0-alpha.2",
61
+ "@solana/web3.js": "1.90.2",
62
+ "@streamflow/common": "7.0.0-alpha.20",
61
63
  "@suiet/wallet-kit": "0.2.22",
62
- "aptos": "1.4.0",
63
- "bignumber.js": "^9.1.2",
64
+ "aptos": "1.21.0",
65
+ "bn.js": "5.2.1",
64
66
  "borsh": "^2.0.0",
65
67
  "bs58": "5.0.0",
66
68
  "ethereum-checksum-address": "0.0.8",
@@ -1,222 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __values = (this && this.__values) || function(o) {
50
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
51
- if (m) return m.call(o);
52
- if (o && typeof o.length === "number") return {
53
- next: function () {
54
- if (o && i >= o.length) o = void 0;
55
- return { value: o && o[i++], done: !o };
56
- }
57
- };
58
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
59
- };
60
- var __importDefault = (this && this.__importDefault) || function (mod) {
61
- return (mod && mod.__esModule) ? mod : { "default": mod };
62
- };
63
- Object.defineProperty(exports, "__esModule", { value: true });
64
- exports.extractSolanaErrorCode = exports.sendAndConfirmStreamRawTransaction = exports.signAllTransactionWithRecipients = exports.decodeStream = exports.toBuffer = void 0;
65
- var web3_js_1 = require("@solana/web3.js");
66
- var solana_1 = require("@streamflow/common/solana");
67
- var bignumber_js_1 = __importDefault(require("bignumber.js"));
68
- var layout_js_1 = require("./layout.js");
69
- var constants_js_1 = require("./constants.js");
70
- var decoder = new TextDecoder("utf-8");
71
- var toUInt64String = function (uintArr) {
72
- return new DataView(uintArr.buffer, uintArr.byteOffset, uintArr.byteLength).getBigUint64(0, true).toString();
73
- };
74
- var toUInt8 = function (uintArr) {
75
- return new DataView(uintArr.buffer, uintArr.byteOffset, uintArr.byteLength).getUint8(0);
76
- };
77
- var toBuffer = function (bigNumber) {
78
- var dv = new DataView(new ArrayBuffer(8), 0);
79
- dv.setBigUint64(0, BigInt(bigNumber.integerValue().toString()), true);
80
- return Buffer.from(dv.buffer);
81
- };
82
- exports.toBuffer = toBuffer;
83
- var decodeStream = function (buf) {
84
- var raw = layout_js_1.streamLayout.decode(buf);
85
- return {
86
- magic: (0, bignumber_js_1.default)(toUInt64String(raw.magic)),
87
- version: (0, bignumber_js_1.default)(toUInt8(raw.version)),
88
- createdAt: (0, bignumber_js_1.default)(toUInt64String(raw.created_at)),
89
- withdrawnAmount: (0, bignumber_js_1.default)(toUInt64String(raw.withdrawn_amount)),
90
- canceledAt: (0, bignumber_js_1.default)(toUInt64String(raw.canceled_at)),
91
- end: (0, bignumber_js_1.default)(toUInt64String(raw.end_time)),
92
- lastWithdrawnAt: (0, bignumber_js_1.default)(toUInt64String(raw.last_withdrawn_at)),
93
- sender: new web3_js_1.PublicKey(raw.sender),
94
- senderTokens: new web3_js_1.PublicKey(raw.sender_tokens),
95
- recipient: new web3_js_1.PublicKey(raw.recipient),
96
- recipientTokens: new web3_js_1.PublicKey(raw.recipient_tokens),
97
- mint: new web3_js_1.PublicKey(raw.mint),
98
- escrowTokens: new web3_js_1.PublicKey(raw.escrow_tokens),
99
- streamflowTreasury: new web3_js_1.PublicKey(raw.streamflow_treasury),
100
- streamflowTreasuryTokens: new web3_js_1.PublicKey(raw.streamflow_treasury_tokens),
101
- streamflowFeeTotal: (0, bignumber_js_1.default)(toUInt64String(raw.streamflow_fee_total)),
102
- streamflowFeeWithdrawn: (0, bignumber_js_1.default)(toUInt64String(raw.streamflow_fee_withdrawn)),
103
- streamflowFeePercent: (0, bignumber_js_1.default)(raw.streamflow_fee_percent),
104
- partnerFeeTotal: (0, bignumber_js_1.default)(toUInt64String(raw.partner_fee_total)),
105
- partnerFeeWithdrawn: (0, bignumber_js_1.default)(toUInt64String(raw.partner_fee_withdrawn)),
106
- partnerFeePercent: (0, bignumber_js_1.default)(raw.partner_fee_percent),
107
- partner: new web3_js_1.PublicKey(raw.partner),
108
- partnerTokens: new web3_js_1.PublicKey(raw.partner_tokens),
109
- start: (0, bignumber_js_1.default)(toUInt64String(raw.start_time)),
110
- depositedAmount: (0, bignumber_js_1.default)(toUInt64String(raw.net_amount_deposited)),
111
- period: (0, bignumber_js_1.default)(toUInt64String(raw.period)),
112
- amountPerPeriod: (0, bignumber_js_1.default)(toUInt64String(raw.amount_per_period)),
113
- cliff: (0, bignumber_js_1.default)(toUInt64String(raw.cliff)),
114
- cliffAmount: (0, bignumber_js_1.default)(toUInt64String(raw.cliff_amount)),
115
- cancelableBySender: Boolean(raw.cancelable_by_sender),
116
- cancelableByRecipient: Boolean(raw.cancelable_by_recipient),
117
- automaticWithdrawal: Boolean(raw.automatic_withdrawal),
118
- transferableBySender: Boolean(raw.transferable_by_sender),
119
- transferableByRecipient: Boolean(raw.transferable_by_recipient),
120
- canTopup: Boolean(raw.can_topup),
121
- name: decoder.decode(raw.stream_name),
122
- withdrawFrequency: (0, bignumber_js_1.default)(toUInt64String(raw.withdraw_frequency)),
123
- closed: Boolean(raw.closed),
124
- currentPauseStart: (0, bignumber_js_1.default)(toUInt64String(raw.current_pause_start)),
125
- pauseCumulative: (0, bignumber_js_1.default)(toUInt64String(raw.pause_cumulative)),
126
- lastRateChangeTime: (0, bignumber_js_1.default)(toUInt64String(raw.last_rate_change_time)),
127
- fundsUnlockedAtLastRateChange: (0, bignumber_js_1.default)(toUInt64String(raw.funds_unlocked_at_last_rate_change)),
128
- };
129
- };
130
- exports.decodeStream = decodeStream;
131
- /**
132
- * Sign passed BatchItems with wallet request or KeyPair
133
- * @param {Keypair | SignerWalletAdapter} sender - Wallet or Keypair of sendin account
134
- * @param {BatchItem[]} items - Multiple recipient contracts split into separate items
135
- * @return {BatchItem[]} - Returns items with signatures.
136
- */
137
- function signAllTransactionWithRecipients(sender, items) {
138
- return __awaiter(this, void 0, void 0, function () {
139
- var isKeypair, isWallet, signedTxs_1;
140
- return __generator(this, function (_a) {
141
- switch (_a.label) {
142
- case 0:
143
- isKeypair = (0, solana_1.isSignerKeypair)(sender);
144
- isWallet = (0, solana_1.isSignerWallet)(sender);
145
- if (!isKeypair) return [3 /*break*/, 1];
146
- return [2 /*return*/, items.map(function (t) {
147
- t.tx.sign([sender]);
148
- return { tx: t.tx, recipient: t.recipient };
149
- })];
150
- case 1:
151
- if (!isWallet) return [3 /*break*/, 3];
152
- return [4 /*yield*/, sender.signAllTransactions(items.map(function (t) { return t.tx; }))];
153
- case 2:
154
- signedTxs_1 = _a.sent();
155
- return [2 /*return*/, items.map(function (item, index) { return (__assign(__assign({}, item), { tx: signedTxs_1[index] })); })];
156
- case 3:
157
- // If signer is not passed
158
- return [2 /*return*/, []];
159
- }
160
- });
161
- });
162
- }
163
- exports.signAllTransactionWithRecipients = signAllTransactionWithRecipients;
164
- /**
165
- * Sign passed BatchItems with wallet request or KeyPair
166
- * @param {Connection} connection - Solana web3 connection object.
167
- * @param {BatchItem} batchItem - Signed transaction ready to be send.
168
- * @param confirmationParams - Confirmation Params that will be used for execution
169
- * @param throttleParams - rate or throttler instance to throttle TX sending - to not spam the blockchain too much
170
- * @return {Promise<BatchItemResult>} - Returns settled transaction item
171
- */
172
- function sendAndConfirmStreamRawTransaction(connection, batchItem, confirmationParams, throttleParams) {
173
- return __awaiter(this, void 0, void 0, function () {
174
- var completedTxSignature, error_1;
175
- return __generator(this, function (_a) {
176
- switch (_a.label) {
177
- case 0:
178
- _a.trys.push([0, 2, , 3]);
179
- return [4 /*yield*/, (0, solana_1.executeTransaction)(connection, batchItem.tx, confirmationParams, throttleParams)];
180
- case 1:
181
- completedTxSignature = _a.sent();
182
- return [2 /*return*/, __assign(__assign({}, batchItem), { signature: completedTxSignature })];
183
- case 2:
184
- error_1 = _a.sent();
185
- throw {
186
- recipient: batchItem.recipient,
187
- error: error_1,
188
- };
189
- case 3: return [2 /*return*/];
190
- }
191
- });
192
- });
193
- }
194
- exports.sendAndConfirmStreamRawTransaction = sendAndConfirmStreamRawTransaction;
195
- function extractSolanaErrorCode(errorText, logs) {
196
- var e_1, _a;
197
- var match = constants_js_1.SOLANA_ERROR_MATCH_REGEX.exec(errorText);
198
- if (!match && logs) {
199
- try {
200
- for (var logs_1 = __values(logs), logs_1_1 = logs_1.next(); !logs_1_1.done; logs_1_1 = logs_1.next()) {
201
- var logLine = logs_1_1.value;
202
- match = constants_js_1.SOLANA_ERROR_MATCH_REGEX.exec(logLine);
203
- if (match !== null) {
204
- break;
205
- }
206
- }
207
- }
208
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
209
- finally {
210
- try {
211
- if (logs_1_1 && !logs_1_1.done && (_a = logs_1.return)) _a.call(logs_1);
212
- }
213
- finally { if (e_1) throw e_1.error; }
214
- }
215
- }
216
- if (!match) {
217
- return null;
218
- }
219
- var errorCode = Number(match[1]);
220
- return constants_js_1.SOLANA_ERROR_MAP[errorCode] || null;
221
- }
222
- exports.extractSolanaErrorCode = extractSolanaErrorCode;