@streamflow/stream 3.0.16-dev → 4.0.0-Alpha.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.
- package/dist/StreamClient.d.ts +3 -4
- package/dist/StreamClient.js +35 -21
- package/dist/__tests__/aptos/streamClient.spec.d.ts +1 -0
- package/dist/__tests__/aptos/streamClient.spec.js +160 -0
- package/dist/__tests__/test_dependencies/airdrop/airdrop-request.d.ts +0 -1
- package/dist/aptos/StreamClient.d.ts +19 -0
- package/dist/aptos/StreamClient.js +296 -0
- package/dist/aptos/constants.d.ts +2 -0
- package/dist/aptos/constants.js +12 -0
- package/dist/aptos/index.d.ts +2 -0
- package/dist/aptos/index.js +23 -0
- package/dist/aptos/types.d.ts +10 -0
- package/dist/aptos/types.js +2 -0
- package/dist/common/types.d.ts +70 -0
- package/dist/common/types.js +29 -0
- package/dist/common/utils.d.ts +15 -0
- package/dist/common/utils.js +31 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +17 -13
- package/dist/instructionTypes.d.ts +81 -0
- package/dist/instructionTypes.js +2 -0
- package/dist/instructions.d.ts +0 -2
- package/dist/instructions.js +18 -29
- package/dist/layout.d.ts +7 -7
- package/dist/layout.js +78 -75
- package/dist/solana/StreamClient.d.ts +145 -0
- package/dist/solana/StreamClient.js +952 -0
- package/dist/solana/constants.d.ts +18 -0
- package/dist/solana/constants.js +23 -0
- package/dist/solana/index.d.ts +5 -0
- package/dist/solana/index.js +27 -0
- package/dist/solana/instructionTypes.d.ts +81 -0
- package/dist/solana/instructionTypes.js +2 -0
- package/dist/solana/instructions.d.ts +131 -0
- package/dist/solana/instructions.js +375 -0
- package/dist/solana/layout.d.ts +22 -0
- package/dist/solana/layout.js +96 -0
- package/dist/solana/timelockIDL.d.ts +22 -0
- package/dist/solana/timelockIDL.js +422 -0
- package/dist/solana/types.d.ts +321 -0
- package/dist/solana/types.js +74 -0
- package/dist/solana/utils.d.ts +42 -0
- package/dist/solana/utils.js +269 -0
- package/dist/types.d.ts +12 -13
- package/package.json +23 -10
|
@@ -0,0 +1,269 @@
|
|
|
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 (_) 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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.ata = exports.sendAndConfirmStreamRawTransaction = exports.signAllTransactionWithRecipients = exports.isSignerWallet = exports.getProgramAccounts = exports.formatDecodedStream = exports.decodeStream = void 0;
|
|
54
|
+
var spl_token_1 = require("@solana/spl-token");
|
|
55
|
+
var web3_js_1 = require("@solana/web3.js");
|
|
56
|
+
var bn_js_1 = __importDefault(require("bn.js"));
|
|
57
|
+
var bs58_1 = __importDefault(require("bs58"));
|
|
58
|
+
var layout_1 = require("./layout");
|
|
59
|
+
var decoder = new TextDecoder("utf-8");
|
|
60
|
+
var LE = "le"; //little endian
|
|
61
|
+
var decodeStream = function (buf) {
|
|
62
|
+
var raw = layout_1.streamLayout.decode(buf);
|
|
63
|
+
return {
|
|
64
|
+
magic: new bn_js_1.default(raw.magic, LE),
|
|
65
|
+
version: new bn_js_1.default(raw.version, LE),
|
|
66
|
+
createdAt: new bn_js_1.default(raw.created_at, LE),
|
|
67
|
+
withdrawnAmount: new bn_js_1.default(raw.withdrawn_amount, LE),
|
|
68
|
+
canceledAt: new bn_js_1.default(raw.canceled_at, LE),
|
|
69
|
+
end: new bn_js_1.default(raw.end_time, LE),
|
|
70
|
+
lastWithdrawnAt: new bn_js_1.default(raw.last_withdrawn_at, LE),
|
|
71
|
+
sender: new web3_js_1.PublicKey(raw.sender),
|
|
72
|
+
senderTokens: new web3_js_1.PublicKey(raw.sender_tokens),
|
|
73
|
+
recipient: new web3_js_1.PublicKey(raw.recipient),
|
|
74
|
+
recipientTokens: new web3_js_1.PublicKey(raw.recipient_tokens),
|
|
75
|
+
mint: new web3_js_1.PublicKey(raw.mint),
|
|
76
|
+
escrowTokens: new web3_js_1.PublicKey(raw.escrow_tokens),
|
|
77
|
+
streamflowTreasury: new web3_js_1.PublicKey(raw.streamflow_treasury),
|
|
78
|
+
streamflowTreasuryTokens: new web3_js_1.PublicKey(raw.streamflow_treasury_tokens),
|
|
79
|
+
streamflowFeeTotal: new bn_js_1.default(raw.streamflow_fee_total, LE),
|
|
80
|
+
streamflowFeeWithdrawn: new bn_js_1.default(raw.streamflow_fee_withdrawn, LE),
|
|
81
|
+
streamflowFeePercent: new bn_js_1.default(raw.streamflow_fee_percent, LE),
|
|
82
|
+
partnerFeeTotal: new bn_js_1.default(raw.partner_fee_total, LE),
|
|
83
|
+
partnerFeeWithdrawn: new bn_js_1.default(raw.partner_fee_withdrawn, LE),
|
|
84
|
+
partnerFeePercent: new bn_js_1.default(raw.partner_fee_percent, LE),
|
|
85
|
+
partner: new web3_js_1.PublicKey(raw.partner),
|
|
86
|
+
partnerTokens: new web3_js_1.PublicKey(raw.partner_tokens),
|
|
87
|
+
start: new bn_js_1.default(raw.start_time, LE),
|
|
88
|
+
depositedAmount: new bn_js_1.default(raw.net_amount_deposited, LE),
|
|
89
|
+
period: new bn_js_1.default(raw.period, LE),
|
|
90
|
+
amountPerPeriod: new bn_js_1.default(raw.amount_per_period, LE),
|
|
91
|
+
cliff: new bn_js_1.default(raw.cliff, LE),
|
|
92
|
+
cliffAmount: new bn_js_1.default(raw.cliff_amount, LE),
|
|
93
|
+
cancelableBySender: Boolean(raw.cancelable_by_sender),
|
|
94
|
+
cancelableByRecipient: Boolean(raw.cancelable_by_recipient),
|
|
95
|
+
automaticWithdrawal: Boolean(raw.automatic_withdrawal),
|
|
96
|
+
transferableBySender: Boolean(raw.transferable_by_sender),
|
|
97
|
+
transferableByRecipient: Boolean(raw.transferable_by_recipient),
|
|
98
|
+
canTopup: Boolean(raw.can_topup),
|
|
99
|
+
name: decoder.decode(raw.stream_name),
|
|
100
|
+
withdrawFrequency: new bn_js_1.default(raw.withdraw_frequency, LE),
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
exports.decodeStream = decodeStream;
|
|
104
|
+
// DeprecationWarning: This object will be deprecated starting from the version 4.0.0. Use
|
|
105
|
+
// types/Contract instead
|
|
106
|
+
var formatDecodedStream = function (stream) {
|
|
107
|
+
var _a;
|
|
108
|
+
var resp = {
|
|
109
|
+
magic: stream.magic.toNumber(),
|
|
110
|
+
version: stream.version.toNumber(),
|
|
111
|
+
createdAt: stream.createdAt.toNumber(),
|
|
112
|
+
withdrawnAmount: stream.withdrawnAmount,
|
|
113
|
+
canceledAt: stream.canceledAt.toNumber(),
|
|
114
|
+
end: stream.end.toNumber(),
|
|
115
|
+
lastWithdrawnAt: stream.lastWithdrawnAt.toNumber(),
|
|
116
|
+
sender: stream.sender.toBase58(),
|
|
117
|
+
senderTokens: stream.senderTokens.toBase58(),
|
|
118
|
+
recipient: stream.recipient.toBase58(),
|
|
119
|
+
recipientTokens: stream.recipientTokens.toBase58(),
|
|
120
|
+
mint: stream.mint.toBase58(),
|
|
121
|
+
escrowTokens: stream.escrowTokens.toBase58(),
|
|
122
|
+
streamflowTreasury: stream.streamflowTreasury.toBase58(),
|
|
123
|
+
streamflowTreasuryTokens: stream.streamflowTreasuryTokens.toBase58(),
|
|
124
|
+
streamflowFeeTotal: stream.streamflowFeeTotal,
|
|
125
|
+
streamflowFeeWithdrawn: stream.streamflowFeeWithdrawn,
|
|
126
|
+
streamflowFeePercent: stream.streamflowFeePercent.toNumber(),
|
|
127
|
+
partnerFeeTotal: stream.partnerFeeTotal,
|
|
128
|
+
partnerFeeWithdrawn: stream.partnerFeeWithdrawn,
|
|
129
|
+
partnerFeePercent: stream.partnerFeePercent.toNumber(),
|
|
130
|
+
partner: stream.partner.toBase58(),
|
|
131
|
+
partnerTokens: (_a = stream.partnerTokens) === null || _a === void 0 ? void 0 : _a.toBase58(),
|
|
132
|
+
start: stream.start.toNumber(),
|
|
133
|
+
depositedAmount: stream.depositedAmount,
|
|
134
|
+
period: stream.period.toNumber(),
|
|
135
|
+
amountPerPeriod: stream.amountPerPeriod,
|
|
136
|
+
cliff: stream.cliff.toNumber(),
|
|
137
|
+
cliffAmount: stream.cliffAmount,
|
|
138
|
+
cancelableBySender: stream.cancelableBySender,
|
|
139
|
+
cancelableByRecipient: stream.cancelableByRecipient,
|
|
140
|
+
automaticWithdrawal: stream.automaticWithdrawal,
|
|
141
|
+
transferableBySender: stream.transferableBySender,
|
|
142
|
+
transferableByRecipient: stream.transferableByRecipient,
|
|
143
|
+
canTopup: stream.canTopup,
|
|
144
|
+
name: stream.name,
|
|
145
|
+
withdrawalFrequency: stream.withdrawFrequency.toNumber(),
|
|
146
|
+
unlocked: function () {
|
|
147
|
+
return 0;
|
|
148
|
+
},
|
|
149
|
+
withdrawn: function () {
|
|
150
|
+
return new bn_js_1.default(0);
|
|
151
|
+
}, //phantom method to preserve partial support of this object
|
|
152
|
+
};
|
|
153
|
+
return resp;
|
|
154
|
+
};
|
|
155
|
+
exports.formatDecodedStream = formatDecodedStream;
|
|
156
|
+
/**
|
|
157
|
+
* Wrapper function for Solana web3 getProgramAccounts with slightly better call interface
|
|
158
|
+
* @param {Connection} connection - Solana web3 connection object.
|
|
159
|
+
* @param {PublicKey} wallet - PublicKey to compare against.
|
|
160
|
+
* @param {number} offset - Offset of bits of the PublicKey in the account binary.
|
|
161
|
+
* @param {PublicKey} programId - Solana program ID.
|
|
162
|
+
* @return {Promise<Account[]>} - Array of resulting accounts.
|
|
163
|
+
*/
|
|
164
|
+
function getProgramAccounts(connection, wallet, offset, programId) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
return [2 /*return*/, connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(programId, {
|
|
168
|
+
filters: [
|
|
169
|
+
{
|
|
170
|
+
memcmp: {
|
|
171
|
+
offset: offset,
|
|
172
|
+
bytes: wallet.toBase58(),
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
})];
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
exports.getProgramAccounts = getProgramAccounts;
|
|
181
|
+
/**
|
|
182
|
+
* Utility function to check if the transaction initiator is a KeyPair or a Wallet object
|
|
183
|
+
* @param {Keypair | SignerWalletAdapter} walletOrKeypair - Wallet or Keypair in question
|
|
184
|
+
* @return {boolean} - Returns true if parameter is a Wallet.
|
|
185
|
+
*/
|
|
186
|
+
function isSignerWallet(walletOrKeypair) {
|
|
187
|
+
return walletOrKeypair.signTransaction !== undefined;
|
|
188
|
+
}
|
|
189
|
+
exports.isSignerWallet = isSignerWallet;
|
|
190
|
+
/**
|
|
191
|
+
* Sign passed BatchItems with wallet request or KeyPair
|
|
192
|
+
* @param {Keypair | SignerWalletAdapter} sender - Wallet or Keypair of sendin account
|
|
193
|
+
* @param {BatchItem[]} items - Multiple recipient contracts split into separate items
|
|
194
|
+
* @return {BatchItem[]} - Returns items with signatures.
|
|
195
|
+
*/
|
|
196
|
+
function signAllTransactionWithRecipients(sender, items) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
+
var signed_batch, isKeypair, isWallet;
|
|
199
|
+
return __generator(this, function (_a) {
|
|
200
|
+
switch (_a.label) {
|
|
201
|
+
case 0:
|
|
202
|
+
signed_batch = [];
|
|
203
|
+
isKeypair = sender instanceof web3_js_1.Keypair;
|
|
204
|
+
isWallet = isSignerWallet(sender);
|
|
205
|
+
if (!isKeypair && !isWallet)
|
|
206
|
+
return [2 /*return*/, signed_batch];
|
|
207
|
+
if (!isKeypair) return [3 /*break*/, 1];
|
|
208
|
+
items.map(function (t) {
|
|
209
|
+
t.tx.partialSign(sender);
|
|
210
|
+
return { tx: t.tx, recipient: t.recipient };
|
|
211
|
+
});
|
|
212
|
+
return [3 /*break*/, 3];
|
|
213
|
+
case 1:
|
|
214
|
+
if (!isWallet) return [3 /*break*/, 3];
|
|
215
|
+
return [4 /*yield*/, sender.signAllTransactions(items.map(function (t) { return t.tx; }))];
|
|
216
|
+
case 2:
|
|
217
|
+
_a.sent();
|
|
218
|
+
_a.label = 3;
|
|
219
|
+
case 3: return [2 /*return*/, items];
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
exports.signAllTransactionWithRecipients = signAllTransactionWithRecipients;
|
|
225
|
+
/**
|
|
226
|
+
* Sign passed BatchItems with wallet request or KeyPair
|
|
227
|
+
* @param {Connection} connection - Solana web3 connection object.
|
|
228
|
+
* @param {BatchItem} batchItem - Signed transaction ready to be send.
|
|
229
|
+
* @return {Promise<BatchItemResult>} - Returns settled transaction item
|
|
230
|
+
*/
|
|
231
|
+
function sendAndConfirmStreamRawTransaction(connection, batchItem) {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
233
|
+
var rawTx, _a, lastValidBlockHeight, signature, recentBlockhash, confirmationStrategy, completedTxSignature, error_1;
|
|
234
|
+
return __generator(this, function (_b) {
|
|
235
|
+
switch (_b.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
_b.trys.push([0, 2, , 3]);
|
|
238
|
+
rawTx = batchItem.tx.serialize();
|
|
239
|
+
_a = batchItem.tx, lastValidBlockHeight = _a.lastValidBlockHeight, signature = _a.signature, recentBlockhash = _a.recentBlockhash;
|
|
240
|
+
if (!lastValidBlockHeight || !signature || !recentBlockhash)
|
|
241
|
+
throw { recipient: batchItem.recipient, error: "no recent blockhash" };
|
|
242
|
+
confirmationStrategy = {
|
|
243
|
+
lastValidBlockHeight: lastValidBlockHeight,
|
|
244
|
+
signature: bs58_1.default.encode(signature),
|
|
245
|
+
blockhash: recentBlockhash,
|
|
246
|
+
};
|
|
247
|
+
return [4 /*yield*/, (0, web3_js_1.sendAndConfirmRawTransaction)(connection, rawTx, confirmationStrategy)];
|
|
248
|
+
case 1:
|
|
249
|
+
completedTxSignature = _b.sent();
|
|
250
|
+
return [2 /*return*/, __assign(__assign({}, batchItem), { signature: completedTxSignature })];
|
|
251
|
+
case 2:
|
|
252
|
+
error_1 = _b.sent();
|
|
253
|
+
throw { recipient: batchItem.recipient, error: error_1 };
|
|
254
|
+
case 3: return [2 /*return*/];
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
exports.sendAndConfirmStreamRawTransaction = sendAndConfirmStreamRawTransaction;
|
|
260
|
+
/**
|
|
261
|
+
* Shorthand call signature for getAssociatedTokenAddress, with allowance for address to be offCurve
|
|
262
|
+
* @param {PublicKey} mint - SPL token Mint address.
|
|
263
|
+
* @param {PublicKey} owner - Owner of the Associated Token Address
|
|
264
|
+
* @return {Promise<PublicKey>} - Associated Token Address
|
|
265
|
+
*/
|
|
266
|
+
function ata(mint, owner) {
|
|
267
|
+
return (0, spl_token_1.getAssociatedTokenAddress)(mint, owner, true);
|
|
268
|
+
}
|
|
269
|
+
exports.ata = ata;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
|
|
2
|
+
import { WalletAdapterNetwork, SignerWalletAdapter } from "@solana/wallet-adapter-base";
|
|
4
3
|
import { AccountInfo, Connection, PublicKey, Keypair, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
5
4
|
import BN from "bn.js";
|
|
6
5
|
export { WalletAdapterNetwork as Cluster } from "@solana/wallet-adapter-base";
|
|
@@ -63,17 +62,17 @@ export interface CreateMultiData {
|
|
|
63
62
|
}
|
|
64
63
|
export interface CreateStreamParams extends CreateStreamData {
|
|
65
64
|
connection: Connection;
|
|
66
|
-
sender:
|
|
65
|
+
sender: SignerWalletAdapter;
|
|
67
66
|
partner?: string;
|
|
68
67
|
cluster?: ClusterExtended;
|
|
69
68
|
}
|
|
70
69
|
export interface CreateParams extends CreateStreamData {
|
|
71
|
-
sender:
|
|
70
|
+
sender: SignerWalletAdapter | Keypair;
|
|
72
71
|
partner?: string | null;
|
|
73
72
|
isNative?: boolean;
|
|
74
73
|
}
|
|
75
74
|
export interface CreateMultiParams extends CreateMultiData {
|
|
76
|
-
sender:
|
|
75
|
+
sender: SignerWalletAdapter | Keypair;
|
|
77
76
|
partner?: string | null;
|
|
78
77
|
isNative?: boolean;
|
|
79
78
|
}
|
|
@@ -83,11 +82,11 @@ export interface WithdrawStreamData {
|
|
|
83
82
|
}
|
|
84
83
|
export interface WithdrawStreamParams extends WithdrawStreamData {
|
|
85
84
|
connection: Connection;
|
|
86
|
-
invoker:
|
|
85
|
+
invoker: SignerWalletAdapter;
|
|
87
86
|
cluster?: ClusterExtended;
|
|
88
87
|
}
|
|
89
88
|
export interface WithdrawParams extends WithdrawStreamData {
|
|
90
|
-
invoker:
|
|
89
|
+
invoker: SignerWalletAdapter | Keypair;
|
|
91
90
|
}
|
|
92
91
|
export interface TopupStreamData {
|
|
93
92
|
id: string;
|
|
@@ -95,11 +94,11 @@ export interface TopupStreamData {
|
|
|
95
94
|
}
|
|
96
95
|
export interface TopupStreamParams extends TopupStreamData {
|
|
97
96
|
connection: Connection;
|
|
98
|
-
invoker:
|
|
97
|
+
invoker: SignerWalletAdapter;
|
|
99
98
|
cluster?: ClusterExtended;
|
|
100
99
|
}
|
|
101
100
|
export interface TopupParams extends TopupStreamData {
|
|
102
|
-
invoker:
|
|
101
|
+
invoker: SignerWalletAdapter | Keypair;
|
|
103
102
|
isNative?: boolean;
|
|
104
103
|
}
|
|
105
104
|
export interface CancelStreamData {
|
|
@@ -107,11 +106,11 @@ export interface CancelStreamData {
|
|
|
107
106
|
}
|
|
108
107
|
export interface CancelStreamParams extends CancelStreamData {
|
|
109
108
|
connection: Connection;
|
|
110
|
-
invoker:
|
|
109
|
+
invoker: SignerWalletAdapter;
|
|
111
110
|
cluster?: ClusterExtended;
|
|
112
111
|
}
|
|
113
112
|
export interface CancelParams extends CancelStreamData {
|
|
114
|
-
invoker:
|
|
113
|
+
invoker: SignerWalletAdapter | Keypair;
|
|
115
114
|
}
|
|
116
115
|
export interface TransferStreamData {
|
|
117
116
|
id: string;
|
|
@@ -119,11 +118,11 @@ export interface TransferStreamData {
|
|
|
119
118
|
}
|
|
120
119
|
export interface TransferStreamParams extends TransferStreamData {
|
|
121
120
|
connection: Connection;
|
|
122
|
-
invoker:
|
|
121
|
+
invoker: SignerWalletAdapter;
|
|
123
122
|
cluster?: ClusterExtended;
|
|
124
123
|
}
|
|
125
124
|
export interface TransferParams extends TransferStreamData {
|
|
126
|
-
invoker:
|
|
125
|
+
invoker: SignerWalletAdapter | Keypair;
|
|
127
126
|
}
|
|
128
127
|
export interface GetStreamParams {
|
|
129
128
|
connection: Connection;
|
package/package.json
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-Alpha.0",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow protocol.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsc --outDir ./dist",
|
|
10
|
-
"test": "
|
|
10
|
+
"test": "jest .",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"publish": "npm run lint && npm test && npm run build && npm publish"
|
|
11
13
|
},
|
|
12
14
|
"gitHead": "a37306eba0e762af096db642fa22f07194014cfd",
|
|
13
15
|
"devDependencies": {
|
|
14
|
-
"@types/bn.js": "5.1.
|
|
16
|
+
"@types/bn.js": "5.1.1",
|
|
17
|
+
"@types/jest": "29.2.4",
|
|
15
18
|
"date-fns": "2.28.0",
|
|
19
|
+
"eslint": "8.29.0",
|
|
20
|
+
"eslint-config-airbnb-typescript": "17.0.0",
|
|
21
|
+
"eslint-config-prettier": "8.5.0",
|
|
22
|
+
"eslint-plugin-jest": "27.1.6",
|
|
23
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
24
|
+
"jest": "29.3.1",
|
|
25
|
+
"prettier": "2.8.1",
|
|
26
|
+
"ts-jest": "29.0.3",
|
|
16
27
|
"typescript": "4.6.4"
|
|
17
28
|
},
|
|
18
29
|
"dependencies": {
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@solana/spl-token": "0.
|
|
22
|
-
"@solana/wallet-adapter-base": "0.9.
|
|
23
|
-
"@solana/web3.js": "1.
|
|
24
|
-
"
|
|
25
|
-
"
|
|
30
|
+
"@manahippo/aptos-wallet-adapter": "1.0.6",
|
|
31
|
+
"@solana/buffer-layout": "4.0.1 ",
|
|
32
|
+
"@solana/spl-token": "0.3.6",
|
|
33
|
+
"@solana/wallet-adapter-base": "0.9.19",
|
|
34
|
+
"@solana/web3.js": "1.70.1",
|
|
35
|
+
"aptos": "1.4.0",
|
|
36
|
+
"bn.js": "5.2.1",
|
|
37
|
+
"bs58": "5.0.0",
|
|
38
|
+
"js-sha256": "0.9.0"
|
|
26
39
|
}
|
|
27
40
|
}
|