@streamflow/stream 5.7.0 → 5.8.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/aptos/StreamClient.d.ts +3 -1
- package/dist/aptos/StreamClient.js +38 -0
- package/dist/aptos/types.d.ts +12 -0
- package/dist/common/BaseStreamClient.d.ts +3 -1
- package/dist/common/GenericStreamClient.d.ts +9 -1
- package/dist/common/GenericStreamClient.js +12 -0
- package/dist/common/types.d.ts +7 -0
- package/dist/evm/StreamClient.d.ts +3 -1
- package/dist/evm/StreamClient.js +33 -0
- package/dist/evm/types.d.ts +5 -0
- package/dist/solana/StreamClient.d.ts +7 -1
- package/dist/solana/StreamClient.js +188 -85
- package/dist/solana/constants.d.ts +32 -0
- package/dist/solana/constants.js +8 -1
- package/dist/solana/instructionTypes.d.ts +5 -0
- package/dist/solana/layout.d.ts +2 -1
- package/dist/solana/layout.js +6 -1
- package/dist/sui/StreamClient.d.ts +3 -1
- package/dist/sui/StreamClient.js +72 -0
- package/dist/sui/types.d.ts +26 -0
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseStreamClient } from "../common/BaseStreamClient";
|
|
2
|
-
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetOneData, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData } from "../common/types";
|
|
2
|
+
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData } from "../common/types";
|
|
3
3
|
import { Contract, ICreateStreamAptosExt, ITransactionAptosExt } from "./types";
|
|
4
4
|
export default class AptosStreamClient extends BaseStreamClient {
|
|
5
5
|
private programId;
|
|
@@ -39,6 +39,8 @@ export default class AptosStreamClient extends BaseStreamClient {
|
|
|
39
39
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
40
40
|
*/
|
|
41
41
|
update(updateData: IUpdateData, { senderWallet, tokenId }: ITransactionAptosExt): Promise<ITransactionResult>;
|
|
42
|
+
getFees({ address }: IGetFeesData): Promise<IFees | null>;
|
|
43
|
+
getDefaultStreamflowFee(): Promise<number>;
|
|
42
44
|
extractErrorCode(err: Error): string | null;
|
|
43
45
|
/**
|
|
44
46
|
* Returns StreamClient protocol program ID.
|
|
@@ -333,6 +333,44 @@ var AptosStreamClient = /** @class */ (function (_super) {
|
|
|
333
333
|
});
|
|
334
334
|
});
|
|
335
335
|
};
|
|
336
|
+
AptosStreamClient.prototype.getFees = function (_a) {
|
|
337
|
+
var address = _a.address;
|
|
338
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
339
|
+
var resource, data, value;
|
|
340
|
+
return __generator(this, function (_b) {
|
|
341
|
+
switch (_b.label) {
|
|
342
|
+
case 0: return [4 /*yield*/, this.client.getAccountResource(this.programId, "".concat(this.programId, "::fees::FeeTable"))];
|
|
343
|
+
case 1:
|
|
344
|
+
resource = _b.sent();
|
|
345
|
+
data = resource.data;
|
|
346
|
+
return [4 /*yield*/, this.client.getTableItem(data.values.handle, {
|
|
347
|
+
key_type: "address",
|
|
348
|
+
key: address,
|
|
349
|
+
value_type: "u64",
|
|
350
|
+
})];
|
|
351
|
+
case 2:
|
|
352
|
+
value = _b.sent();
|
|
353
|
+
if (!value) {
|
|
354
|
+
return [2 /*return*/, null];
|
|
355
|
+
}
|
|
356
|
+
return [2 /*return*/, { streamflowFee: Number(value) / 100, partnerFee: 0 }];
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
AptosStreamClient.prototype.getDefaultStreamflowFee = function () {
|
|
362
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
363
|
+
var resource;
|
|
364
|
+
return __generator(this, function (_a) {
|
|
365
|
+
switch (_a.label) {
|
|
366
|
+
case 0: return [4 /*yield*/, this.client.getAccountResource(this.programId, "".concat(this.programId, "::admin::ConfigV2"))];
|
|
367
|
+
case 1:
|
|
368
|
+
resource = _a.sent();
|
|
369
|
+
return [2 /*return*/, Number(resource.data.streamflow_fees) / 100];
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
};
|
|
336
374
|
AptosStreamClient.prototype.extractErrorCode = function (err) {
|
|
337
375
|
var _a;
|
|
338
376
|
return (0, utils_1.extractAptosErrorCode)((_a = err.toString()) !== null && _a !== void 0 ? _a : "Unknown error!");
|
package/dist/aptos/types.d.ts
CHANGED
|
@@ -47,6 +47,18 @@ export interface StreamResource {
|
|
|
47
47
|
start: string;
|
|
48
48
|
withdrawn: string;
|
|
49
49
|
}
|
|
50
|
+
export interface FeeTableResource {
|
|
51
|
+
values: {
|
|
52
|
+
handle: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface ConfigResource {
|
|
56
|
+
admin: string;
|
|
57
|
+
streamflow_fees: string;
|
|
58
|
+
treasury: string;
|
|
59
|
+
tx_fee: string;
|
|
60
|
+
withdrawor: string;
|
|
61
|
+
}
|
|
50
62
|
export declare class Contract implements Stream {
|
|
51
63
|
magic: number;
|
|
52
64
|
version: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICreateStreamData, ICreateMultipleStreamData, IWithdrawData, ICancelData, ITransferData, ITopUpData, IGetOneData, IUpdateData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream } from "./types";
|
|
1
|
+
import { ICreateStreamData, ICreateMultipleStreamData, IFees, IWithdrawData, ICancelData, ITransferData, ITopUpData, IGetFeesData, IGetOneData, IUpdateData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream } from "./types";
|
|
2
2
|
export declare abstract class BaseStreamClient {
|
|
3
3
|
abstract create(streamData: ICreateStreamData, chainSpecificParams: any): Promise<ICreateResult>;
|
|
4
4
|
abstract createMultiple(multipleStreamData: ICreateMultipleStreamData, chainSpecificParams: any): Promise<IMultiTransactionResult>;
|
|
@@ -9,5 +9,7 @@ export declare abstract class BaseStreamClient {
|
|
|
9
9
|
abstract getOne(getOneData: IGetOneData, chainSpecificParams: any): Promise<Stream>;
|
|
10
10
|
abstract get(getAllData: IGetAllData, chainSpecificParams: any): Promise<[string, Stream][]>;
|
|
11
11
|
abstract update(updateData: IUpdateData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
12
|
+
abstract getFees(getFeesData: IGetFeesData, chainSpecificParams: any): Promise<IFees | null>;
|
|
13
|
+
abstract getDefaultStreamflowFee(chainSpecificParams: any): Promise<number>;
|
|
12
14
|
extractErrorCode(err: Error): string | null;
|
|
13
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Commitment, ConnectionConfig } from "@solana/web3.js";
|
|
2
2
|
import { Signer } from "ethers";
|
|
3
3
|
import { BaseStreamClient } from "./BaseStreamClient";
|
|
4
|
-
import { ICancelData, IChain, ICluster, ICreateMultipleStreamData, ICreateStreamData, IGetOneData, ITopUpData, ITransferData, IUpdateData, IWithdrawData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream } from "./types";
|
|
4
|
+
import { ICancelData, IChain, ICluster, ICreateMultipleStreamData, ICreateStreamData, IGetOneData, ITopUpData, ITransferData, IUpdateData, IWithdrawData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream, IFees, IGetFeesData } from "./types";
|
|
5
5
|
import { AptosStreamClient, ICreateStreamAptosExt, ITransactionAptosExt } from "../aptos";
|
|
6
6
|
import { EvmStreamClient } from "../evm";
|
|
7
7
|
import { SolanaStreamClient, ICreateStreamSolanaExt, IInteractStreamSolanaExt, ITopUpStreamSolanaExt } from "../solana";
|
|
@@ -89,5 +89,13 @@ export default class GenericStreamClient<T extends IChain> extends BaseStreamCli
|
|
|
89
89
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
90
90
|
*/
|
|
91
91
|
update(updateData: IUpdateData, chainSpecificParams?: InteractSpecificParams<T>): Promise<ITransactionResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns streamflow and partner fees for the specific wallet in %
|
|
94
|
+
*/
|
|
95
|
+
getFees(getFeesData: IGetFeesData): Promise<IFees | null>;
|
|
96
|
+
/**
|
|
97
|
+
* Returns default Streamflow Fee in %
|
|
98
|
+
*/
|
|
99
|
+
getDefaultStreamflowFee(): Promise<number>;
|
|
92
100
|
}
|
|
93
101
|
export {};
|
|
@@ -109,6 +109,18 @@ var GenericStreamClient = /** @class */ (function (_super) {
|
|
|
109
109
|
var _this = this;
|
|
110
110
|
return (0, utils_1.handleContractError)(function () { return _this.nativeStreamClient.update(updateData, chainSpecificParams); }, this.nativeStreamClient.extractErrorCode);
|
|
111
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Returns streamflow and partner fees for the specific wallet in %
|
|
114
|
+
*/
|
|
115
|
+
GenericStreamClient.prototype.getFees = function (getFeesData) {
|
|
116
|
+
return this.nativeStreamClient.getFees(getFeesData);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Returns default Streamflow Fee in %
|
|
120
|
+
*/
|
|
121
|
+
GenericStreamClient.prototype.getDefaultStreamflowFee = function () {
|
|
122
|
+
return this.nativeStreamClient.getDefaultStreamflowFee();
|
|
123
|
+
};
|
|
112
124
|
return GenericStreamClient;
|
|
113
125
|
}(BaseStreamClient_1.BaseStreamClient));
|
|
114
126
|
exports.default = GenericStreamClient;
|
package/dist/common/types.d.ts
CHANGED
|
@@ -52,6 +52,9 @@ export interface ITopUpData {
|
|
|
52
52
|
export interface IGetOneData {
|
|
53
53
|
id: string;
|
|
54
54
|
}
|
|
55
|
+
export interface IGetFeesData {
|
|
56
|
+
address: string;
|
|
57
|
+
}
|
|
55
58
|
export interface IGetAllData {
|
|
56
59
|
address: string;
|
|
57
60
|
type?: StreamType;
|
|
@@ -67,6 +70,10 @@ export interface ITransactionResult {
|
|
|
67
70
|
ixs: (TransactionInstruction | Types.TransactionPayload)[];
|
|
68
71
|
txId: string;
|
|
69
72
|
}
|
|
73
|
+
export interface IFees {
|
|
74
|
+
streamflowFee: number;
|
|
75
|
+
partnerFee: number;
|
|
76
|
+
}
|
|
70
77
|
export interface ICreateResult extends ITransactionResult {
|
|
71
78
|
metadataId: MetadataId;
|
|
72
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
2
|
import BN from "bn.js";
|
|
3
3
|
import { BaseStreamClient } from "../common/BaseStreamClient";
|
|
4
|
-
import { ICancelData, IChain, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetOneData, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
|
|
4
|
+
import { ICancelData, IChain, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetFeesData, IGetAllData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
|
|
5
5
|
export default class EvmStreamClient extends BaseStreamClient {
|
|
6
6
|
private programId;
|
|
7
7
|
private provider;
|
|
@@ -19,6 +19,8 @@ export default class EvmStreamClient extends BaseStreamClient {
|
|
|
19
19
|
getOne({ id }: IGetOneData): Promise<Stream>;
|
|
20
20
|
get({ address, direction, }: IGetAllData): Promise<[string, Stream][]>;
|
|
21
21
|
extractErrorCode(err: Error): string | null;
|
|
22
|
+
getFees({ address }: IGetFeesData): Promise<IFees | null>;
|
|
23
|
+
getDefaultStreamflowFee(): Promise<number>;
|
|
22
24
|
/**
|
|
23
25
|
* Returns StreamClient protocol program ID.
|
|
24
26
|
*/
|
package/dist/evm/StreamClient.js
CHANGED
|
@@ -371,6 +371,39 @@ var EvmStreamClient = /** @class */ (function (_super) {
|
|
|
371
371
|
var _a;
|
|
372
372
|
return (0, utils_1.extractEvmErrorCode)((_a = err.toString()) !== null && _a !== void 0 ? _a : "Unknown error!");
|
|
373
373
|
};
|
|
374
|
+
EvmStreamClient.prototype.getFees = function (_a) {
|
|
375
|
+
var address = _a.address;
|
|
376
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
+
var fees;
|
|
378
|
+
return __generator(this, function (_b) {
|
|
379
|
+
switch (_b.label) {
|
|
380
|
+
case 0: return [4 /*yield*/, this.readContract.getFees(address)];
|
|
381
|
+
case 1:
|
|
382
|
+
fees = _b.sent();
|
|
383
|
+
if (!fees.exists) {
|
|
384
|
+
return [2 /*return*/, null];
|
|
385
|
+
}
|
|
386
|
+
return [2 /*return*/, {
|
|
387
|
+
streamflowFee: fees.streamflow_fee.toNumber() / 100,
|
|
388
|
+
partnerFee: fees.partner_fee.toNumber() / 100,
|
|
389
|
+
}];
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
EvmStreamClient.prototype.getDefaultStreamflowFee = function () {
|
|
395
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
396
|
+
var fee;
|
|
397
|
+
return __generator(this, function (_a) {
|
|
398
|
+
switch (_a.label) {
|
|
399
|
+
case 0: return [4 /*yield*/, this.readContract.getStreamflowFees()];
|
|
400
|
+
case 1:
|
|
401
|
+
fee = _a.sent();
|
|
402
|
+
return [2 /*return*/, fee.toNumber() / 100];
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
};
|
|
374
407
|
/**
|
|
375
408
|
* Returns StreamClient protocol program ID.
|
|
376
409
|
*/
|
package/dist/evm/types.d.ts
CHANGED
|
@@ -43,6 +43,11 @@ export interface StreamAbiResult {
|
|
|
43
43
|
token: string;
|
|
44
44
|
withdrawn: BigNumber;
|
|
45
45
|
}
|
|
46
|
+
export interface FeesAbiResult {
|
|
47
|
+
exists: boolean;
|
|
48
|
+
streamflow_fee: BigNumber;
|
|
49
|
+
partner_fee: BigNumber;
|
|
50
|
+
}
|
|
46
51
|
export declare class EvmContract implements Stream {
|
|
47
52
|
magic: number;
|
|
48
53
|
version: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, Commitment, ConnectionConfig } from "@solana/web3.js";
|
|
2
2
|
import { ICreateStreamSolanaExt, IInteractStreamSolanaExt, ITopUpStreamSolanaExt } from "./types";
|
|
3
|
-
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetOneData, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
|
|
3
|
+
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetAllData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData, Stream } from "../common/types";
|
|
4
4
|
import { BaseStreamClient } from "../common/BaseStreamClient";
|
|
5
5
|
export default class SolanaStreamClient extends BaseStreamClient {
|
|
6
6
|
private connection;
|
|
@@ -64,9 +64,15 @@ export default class SolanaStreamClient extends BaseStreamClient {
|
|
|
64
64
|
* Attempts updating the stream auto withdrawal params and amount per period
|
|
65
65
|
*/
|
|
66
66
|
update(data: IUpdateData, { invoker }: IInteractStreamSolanaExt): Promise<ITransactionResult>;
|
|
67
|
+
getFees({ address }: IGetFeesData): Promise<IFees | null>;
|
|
68
|
+
getDefaultStreamflowFee(): Promise<number>;
|
|
67
69
|
extractErrorCode(err: Error): string | null;
|
|
68
70
|
/**
|
|
69
71
|
* Forms instructions from params, creates a raw transaction and fetch recent blockhash.
|
|
70
72
|
*/
|
|
71
73
|
private prepareStreamTransaction;
|
|
74
|
+
/**
|
|
75
|
+
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
76
|
+
*/
|
|
77
|
+
private getOrCreateStreamMetadata;
|
|
72
78
|
}
|
|
@@ -26,6 +26,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
26
26
|
};
|
|
27
27
|
return __assign.apply(this, arguments);
|
|
28
28
|
};
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
41
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
42
|
+
}) : function(o, v) {
|
|
43
|
+
o["default"] = v;
|
|
44
|
+
});
|
|
45
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
49
|
+
__setModuleDefault(result, mod);
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
29
52
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
30
53
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
31
54
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -87,6 +110,17 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
87
110
|
}
|
|
88
111
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
89
112
|
};
|
|
113
|
+
var __values = (this && this.__values) || function(o) {
|
|
114
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
115
|
+
if (m) return m.call(o);
|
|
116
|
+
if (o && typeof o.length === "number") return {
|
|
117
|
+
next: function () {
|
|
118
|
+
if (o && i >= o.length) o = void 0;
|
|
119
|
+
return { value: o && o[i++], done: !o };
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
123
|
+
};
|
|
90
124
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
91
125
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
92
126
|
};
|
|
@@ -96,6 +130,7 @@ var buffer_1 = require("buffer");
|
|
|
96
130
|
var bs58_1 = __importDefault(require("bs58"));
|
|
97
131
|
var spl_token_1 = require("@solana/spl-token");
|
|
98
132
|
var web3_js_1 = require("@solana/web3.js");
|
|
133
|
+
var borsh = __importStar(require("borsh"));
|
|
99
134
|
var types_1 = require("./types");
|
|
100
135
|
var utils_1 = require("./utils");
|
|
101
136
|
var constants_1 = require("./constants");
|
|
@@ -133,10 +168,10 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
133
168
|
var recipient = _a.recipient, mint = _a.tokenId, start = _a.start, depositedAmount = _a.amount, period = _a.period, cliff = _a.cliff, cliffAmount = _a.cliffAmount, amountPerPeriod = _a.amountPerPeriod, name = _a.name, canTopup = _a.canTopup, cancelableBySender = _a.cancelableBySender, cancelableByRecipient = _a.cancelableByRecipient, transferableBySender = _a.transferableBySender, transferableByRecipient = _a.transferableByRecipient, _c = _a.automaticWithdrawal, automaticWithdrawal = _c === void 0 ? false : _c, _d = _a.withdrawalFrequency, withdrawalFrequency = _d === void 0 ? 0 : _d, partner = _a.partner;
|
|
134
169
|
var sender = _b.sender, metadataPubKeys = _b.metadataPubKeys, _e = _b.isNative, isNative = _e === void 0 ? false : _e;
|
|
135
170
|
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
-
var ixs, mintPublicKey, recipientPublicKey, metadata, metadataPubKey,
|
|
137
|
-
var
|
|
138
|
-
return __generator(this, function (
|
|
139
|
-
switch (
|
|
171
|
+
var ixs, mintPublicKey, recipientPublicKey, _f, metadata, metadataPubKey, _g, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, nativeInstructions, _h, commitment, hash, tx, signature;
|
|
172
|
+
var _j;
|
|
173
|
+
return __generator(this, function (_k) {
|
|
174
|
+
switch (_k.label) {
|
|
140
175
|
case 0:
|
|
141
176
|
if (!sender.publicKey) {
|
|
142
177
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
@@ -144,38 +179,31 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
144
179
|
ixs = [];
|
|
145
180
|
mintPublicKey = isNative ? spl_token_1.NATIVE_MINT : new web3_js_1.PublicKey(mint);
|
|
146
181
|
recipientPublicKey = new web3_js_1.PublicKey(recipient);
|
|
147
|
-
metadata =
|
|
148
|
-
|
|
149
|
-
metadata = web3_js_1.Keypair.generate();
|
|
150
|
-
metadataPubKey = metadata.publicKey;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
metadataPubKey = metadataPubKeys[0];
|
|
154
|
-
}
|
|
155
|
-
_f = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from("strm"), metadataPubKey.toBuffer()], this.programId), 1), escrowTokens = _f[0];
|
|
182
|
+
_f = this.getOrCreateStreamMetadata(metadataPubKeys), metadata = _f.metadata, metadataPubKey = _f.metadataPubKey;
|
|
183
|
+
_g = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from("strm"), metadataPubKey.toBuffer()], this.programId), 1), escrowTokens = _g[0];
|
|
156
184
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, sender.publicKey)];
|
|
157
185
|
case 1:
|
|
158
|
-
senderTokens =
|
|
186
|
+
senderTokens = _k.sent();
|
|
159
187
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, recipientPublicKey)];
|
|
160
188
|
case 2:
|
|
161
|
-
recipientTokens =
|
|
189
|
+
recipientTokens = _k.sent();
|
|
162
190
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY)];
|
|
163
191
|
case 3:
|
|
164
|
-
streamflowTreasuryTokens =
|
|
192
|
+
streamflowTreasuryTokens = _k.sent();
|
|
165
193
|
partnerPublicKey = partner ? new web3_js_1.PublicKey(partner) : constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY;
|
|
166
194
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, partnerPublicKey)];
|
|
167
195
|
case 4:
|
|
168
|
-
partnerTokens =
|
|
196
|
+
partnerTokens = _k.sent();
|
|
169
197
|
if (!isNative) return [3 /*break*/, 6];
|
|
170
198
|
return [4 /*yield*/, (0, instructions_1.prepareWrappedAccount)(this.connection, sender.publicKey, depositedAmount)];
|
|
171
199
|
case 5:
|
|
172
|
-
|
|
200
|
+
_h = _k.sent();
|
|
173
201
|
return [3 /*break*/, 7];
|
|
174
202
|
case 6:
|
|
175
|
-
|
|
176
|
-
|
|
203
|
+
_h = [];
|
|
204
|
+
_k.label = 7;
|
|
177
205
|
case 7:
|
|
178
|
-
nativeInstructions =
|
|
206
|
+
nativeInstructions = _h;
|
|
179
207
|
ixs.push((0, instructions_1.createStreamInstruction)({
|
|
180
208
|
start: new bn_js_1.default(start),
|
|
181
209
|
depositedAmount: depositedAmount,
|
|
@@ -214,18 +242,18 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
214
242
|
commitment = typeof this.commitment == "string" ? this.commitment : this.commitment.commitment;
|
|
215
243
|
return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
|
|
216
244
|
case 8:
|
|
217
|
-
hash =
|
|
218
|
-
tx = (
|
|
245
|
+
hash = _k.sent();
|
|
246
|
+
tx = (_j = new web3_js_1.Transaction({
|
|
219
247
|
feePayer: sender.publicKey,
|
|
220
248
|
blockhash: hash.blockhash,
|
|
221
249
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
222
|
-
})).add.apply(
|
|
250
|
+
})).add.apply(_j, __spreadArray(__spreadArray([], __read(nativeInstructions), false), __read(ixs), false));
|
|
223
251
|
if (metadata) {
|
|
224
252
|
tx.partialSign(metadata);
|
|
225
253
|
}
|
|
226
254
|
return [4 /*yield*/, this.sign(sender, tx, hash)];
|
|
227
255
|
case 9:
|
|
228
|
-
signature =
|
|
256
|
+
signature = _k.sent();
|
|
229
257
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
230
258
|
}
|
|
231
259
|
});
|
|
@@ -245,27 +273,20 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
245
273
|
var recipient = _a.recipient, mint = _a.tokenId, start = _a.start, depositedAmount = _a.amount, period = _a.period, cliff = _a.cliff, cliffAmount = _a.cliffAmount, amountPerPeriod = _a.amountPerPeriod, name = _a.name, canTopup = _a.canTopup, cancelableBySender = _a.cancelableBySender, cancelableByRecipient = _a.cancelableByRecipient, transferableBySender = _a.transferableBySender, transferableByRecipient = _a.transferableByRecipient, _c = _a.automaticWithdrawal, automaticWithdrawal = _c === void 0 ? false : _c, _d = _a.withdrawalFrequency, withdrawalFrequency = _d === void 0 ? 0 : _d, partner = _a.partner;
|
|
246
274
|
var sender = _b.sender, metadataPubKeys = _b.metadataPubKeys, _e = _b.isNative, isNative = _e === void 0 ? false : _e;
|
|
247
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
|
-
var mintPublicKey, recipientPublicKey, metadata, metadataPubKey, rentToExempt, createMetadataInstruction,
|
|
249
|
-
var
|
|
250
|
-
return __generator(this, function (
|
|
251
|
-
switch (
|
|
276
|
+
var mintPublicKey, recipientPublicKey, _f, metadata, metadataPubKey, rentToExempt, createMetadataInstruction, _g, escrowTokens, senderTokens, partnerPublicKey, nativeInstructions, _h, createInstruction, commitment, ixs, hash, tx, signature;
|
|
277
|
+
var _j;
|
|
278
|
+
return __generator(this, function (_k) {
|
|
279
|
+
switch (_k.label) {
|
|
252
280
|
case 0:
|
|
253
281
|
if (!sender.publicKey) {
|
|
254
282
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
255
283
|
}
|
|
256
284
|
mintPublicKey = new web3_js_1.PublicKey(mint);
|
|
257
285
|
recipientPublicKey = new web3_js_1.PublicKey(recipient);
|
|
258
|
-
metadata =
|
|
259
|
-
if (!metadataPubKeys) {
|
|
260
|
-
metadata = web3_js_1.Keypair.generate();
|
|
261
|
-
metadataPubKey = metadata.publicKey;
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
metadataPubKey = metadataPubKeys[0];
|
|
265
|
-
}
|
|
286
|
+
_f = this.getOrCreateStreamMetadata(metadataPubKeys), metadata = _f.metadata, metadataPubKey = _f.metadataPubKey;
|
|
266
287
|
return [4 /*yield*/, this.connection.getMinimumBalanceForRentExemption(METADATA_ACC_SIZE)];
|
|
267
288
|
case 1:
|
|
268
|
-
rentToExempt =
|
|
289
|
+
rentToExempt = _k.sent();
|
|
269
290
|
createMetadataInstruction = web3_js_1.SystemProgram.createAccount({
|
|
270
291
|
programId: this.programId,
|
|
271
292
|
space: METADATA_ACC_SIZE,
|
|
@@ -273,21 +294,21 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
273
294
|
fromPubkey: sender === null || sender === void 0 ? void 0 : sender.publicKey,
|
|
274
295
|
newAccountPubkey: metadataPubKey,
|
|
275
296
|
});
|
|
276
|
-
|
|
297
|
+
_g = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from("strm"), metadataPubKey.toBuffer()], this.programId), 1), escrowTokens = _g[0];
|
|
277
298
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, sender.publicKey)];
|
|
278
299
|
case 2:
|
|
279
|
-
senderTokens =
|
|
300
|
+
senderTokens = _k.sent();
|
|
280
301
|
partnerPublicKey = partner ? new web3_js_1.PublicKey(partner) : constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY;
|
|
281
302
|
if (!isNative) return [3 /*break*/, 4];
|
|
282
303
|
return [4 /*yield*/, (0, instructions_1.prepareWrappedAccount)(this.connection, sender.publicKey, depositedAmount)];
|
|
283
304
|
case 3:
|
|
284
|
-
|
|
305
|
+
_h = _k.sent();
|
|
285
306
|
return [3 /*break*/, 5];
|
|
286
307
|
case 4:
|
|
287
|
-
|
|
288
|
-
|
|
308
|
+
_h = [];
|
|
309
|
+
_k.label = 5;
|
|
289
310
|
case 5:
|
|
290
|
-
nativeInstructions =
|
|
311
|
+
nativeInstructions = _h;
|
|
291
312
|
createInstruction = (0, instructions_1.createUncheckedStreamInstruction)({
|
|
292
313
|
start: new bn_js_1.default(start),
|
|
293
314
|
depositedAmount: depositedAmount,
|
|
@@ -322,18 +343,18 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
322
343
|
ixs = [createMetadataInstruction, createInstruction];
|
|
323
344
|
return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
|
|
324
345
|
case 6:
|
|
325
|
-
hash =
|
|
326
|
-
tx = (
|
|
346
|
+
hash = _k.sent();
|
|
347
|
+
tx = (_j = new web3_js_1.Transaction({
|
|
327
348
|
feePayer: sender.publicKey,
|
|
328
349
|
blockhash: hash.blockhash,
|
|
329
350
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
330
|
-
})).add.apply(
|
|
351
|
+
})).add.apply(_j, __spreadArray(__spreadArray([], __read(nativeInstructions), false), __read(ixs), false));
|
|
331
352
|
if (metadata) {
|
|
332
353
|
tx.partialSign(metadata);
|
|
333
354
|
}
|
|
334
355
|
return [4 /*yield*/, this.sign(sender, tx, hash)];
|
|
335
356
|
case 7:
|
|
336
|
-
signature =
|
|
357
|
+
signature = _k.sent();
|
|
337
358
|
return [2 /*return*/, { ixs: ixs, txId: signature, metadataId: metadataPubKey.toBase58() }];
|
|
338
359
|
}
|
|
339
360
|
});
|
|
@@ -346,11 +367,11 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
346
367
|
SolanaStreamClient.prototype.createMultiple = function (data, _a) {
|
|
347
368
|
var sender = _a.sender, metadataPubKeys = _a.metadataPubKeys, _b = _a.isNative, isNative = _b === void 0 ? false : _b;
|
|
348
369
|
return __awaiter(this, void 0, void 0, function () {
|
|
349
|
-
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, i, recipientData, _c, tx, metadataPubKey, totalDepositedAmount, nativeInstructions, commitment, hash, prepareTransaction, signedBatch, prepareTx, batchTransactionsCalls,
|
|
350
|
-
var
|
|
370
|
+
var recipients, metadatas, metadataToRecipient, errors, signatures, batch, i, recipientData, _c, tx, metadataPubKey, totalDepositedAmount, nativeInstructions, commitment, hash, prepareTransaction, signedBatch, prepareTx, responses, signedBatch_1, signedBatch_1_1, batchTx, _d, _e, _f, _g, e_1_1, batchTransactionsCalls, _h, _j, _k, _l, successes, failures;
|
|
371
|
+
var _m, e_1, _o;
|
|
351
372
|
var _this = this;
|
|
352
|
-
return __generator(this, function (
|
|
353
|
-
switch (
|
|
373
|
+
return __generator(this, function (_p) {
|
|
374
|
+
switch (_p.label) {
|
|
354
375
|
case 0:
|
|
355
376
|
recipients = data.recipients;
|
|
356
377
|
if (!sender.publicKey) {
|
|
@@ -363,7 +384,7 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
363
384
|
batch = [];
|
|
364
385
|
metadataPubKeys = metadataPubKeys || [];
|
|
365
386
|
i = 0;
|
|
366
|
-
|
|
387
|
+
_p.label = 1;
|
|
367
388
|
case 1:
|
|
368
389
|
if (!(i < recipients.length)) return [3 /*break*/, 4];
|
|
369
390
|
recipientData = recipients[i];
|
|
@@ -372,11 +393,11 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
372
393
|
metadataPubKeys: metadataPubKeys[i] ? [metadataPubKeys[i]] : undefined,
|
|
373
394
|
})];
|
|
374
395
|
case 2:
|
|
375
|
-
_c =
|
|
396
|
+
_c = _p.sent(), tx = _c.tx, metadataPubKey = _c.metadataPubKey;
|
|
376
397
|
metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
|
|
377
398
|
metadatas.push(metadataPubKey.toBase58());
|
|
378
399
|
batch.push({ tx: tx, recipient: recipientData.recipient });
|
|
379
|
-
|
|
400
|
+
_p.label = 3;
|
|
380
401
|
case 3:
|
|
381
402
|
i++;
|
|
382
403
|
return [3 /*break*/, 1];
|
|
@@ -385,21 +406,21 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
385
406
|
totalDepositedAmount = recipients.reduce(function (acc, recipient) { return recipient.amount.add(acc); }, new bn_js_1.default(0));
|
|
386
407
|
return [4 /*yield*/, (0, instructions_1.prepareWrappedAccount)(this.connection, sender.publicKey, totalDepositedAmount)];
|
|
387
408
|
case 5:
|
|
388
|
-
nativeInstructions =
|
|
409
|
+
nativeInstructions = _p.sent();
|
|
389
410
|
commitment = typeof this.commitment == "string" ? this.commitment : this.commitment.commitment;
|
|
390
411
|
return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
|
|
391
412
|
case 6:
|
|
392
|
-
hash =
|
|
393
|
-
prepareTransaction = (
|
|
413
|
+
hash = _p.sent();
|
|
414
|
+
prepareTransaction = (_m = new web3_js_1.Transaction({
|
|
394
415
|
feePayer: sender.publicKey,
|
|
395
416
|
blockhash: hash.blockhash,
|
|
396
417
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
397
|
-
})).add.apply(
|
|
418
|
+
})).add.apply(_m, __spreadArray([], __read(nativeInstructions), false));
|
|
398
419
|
batch.push({ tx: prepareTransaction, recipient: sender.publicKey.toBase58() });
|
|
399
|
-
|
|
420
|
+
_p.label = 7;
|
|
400
421
|
case 7: return [4 /*yield*/, (0, utils_1.signAllTransactionWithRecipients)(sender, batch)];
|
|
401
422
|
case 8:
|
|
402
|
-
signedBatch =
|
|
423
|
+
signedBatch = _p.sent();
|
|
403
424
|
signedBatch.forEach(function (item, index) {
|
|
404
425
|
item.tx.lastValidBlockHeight = batch[index].tx.lastValidBlockHeight;
|
|
405
426
|
});
|
|
@@ -407,15 +428,55 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
407
428
|
prepareTx = signedBatch.pop();
|
|
408
429
|
return [4 /*yield*/, (0, utils_1.sendAndConfirmStreamRawTransaction)(this.connection, prepareTx)];
|
|
409
430
|
case 9:
|
|
410
|
-
|
|
411
|
-
|
|
431
|
+
_p.sent();
|
|
432
|
+
_p.label = 10;
|
|
412
433
|
case 10:
|
|
434
|
+
responses = [];
|
|
435
|
+
if (!(metadataPubKeys.length > 0)) return [3 /*break*/, 19];
|
|
436
|
+
_p.label = 11;
|
|
437
|
+
case 11:
|
|
438
|
+
_p.trys.push([11, 16, 17, 18]);
|
|
439
|
+
signedBatch_1 = __values(signedBatch), signedBatch_1_1 = signedBatch_1.next();
|
|
440
|
+
_p.label = 12;
|
|
441
|
+
case 12:
|
|
442
|
+
if (!!signedBatch_1_1.done) return [3 /*break*/, 15];
|
|
443
|
+
batchTx = signedBatch_1_1.value;
|
|
444
|
+
_e = (_d = responses.push).apply;
|
|
445
|
+
_f = [responses];
|
|
446
|
+
_g = [[]];
|
|
447
|
+
return [4 /*yield*/, Promise.allSettled([
|
|
448
|
+
(0, utils_1.sendAndConfirmStreamRawTransaction)(this.connection, batchTx),
|
|
449
|
+
])];
|
|
450
|
+
case 13:
|
|
451
|
+
_e.apply(_d, _f.concat([__spreadArray.apply(void 0, _g.concat([__read.apply(void 0, [(_p.sent())]), false]))]));
|
|
452
|
+
_p.label = 14;
|
|
453
|
+
case 14:
|
|
454
|
+
signedBatch_1_1 = signedBatch_1.next();
|
|
455
|
+
return [3 /*break*/, 12];
|
|
456
|
+
case 15: return [3 /*break*/, 18];
|
|
457
|
+
case 16:
|
|
458
|
+
e_1_1 = _p.sent();
|
|
459
|
+
e_1 = { error: e_1_1 };
|
|
460
|
+
return [3 /*break*/, 18];
|
|
461
|
+
case 17:
|
|
462
|
+
try {
|
|
463
|
+
if (signedBatch_1_1 && !signedBatch_1_1.done && (_o = signedBatch_1.return)) _o.call(signedBatch_1);
|
|
464
|
+
}
|
|
465
|
+
finally { if (e_1) throw e_1.error; }
|
|
466
|
+
return [7 /*endfinally*/];
|
|
467
|
+
case 18: return [3 /*break*/, 21];
|
|
468
|
+
case 19:
|
|
413
469
|
batchTransactionsCalls = signedBatch.map(function (el) {
|
|
414
470
|
return (0, utils_1.sendAndConfirmStreamRawTransaction)(_this.connection, el);
|
|
415
471
|
});
|
|
472
|
+
_j = (_h = responses.push).apply;
|
|
473
|
+
_k = [responses];
|
|
474
|
+
_l = [[]];
|
|
416
475
|
return [4 /*yield*/, Promise.allSettled(batchTransactionsCalls)];
|
|
417
|
-
case
|
|
418
|
-
|
|
476
|
+
case 20:
|
|
477
|
+
_j.apply(_h, _k.concat([__spreadArray.apply(void 0, _l.concat([__read.apply(void 0, [(_p.sent())]), false]))]));
|
|
478
|
+
_p.label = 21;
|
|
479
|
+
case 21:
|
|
419
480
|
successes = responses
|
|
420
481
|
.filter(function (el) { return el.status === "fulfilled"; })
|
|
421
482
|
.map(function (el) { return el.value; });
|
|
@@ -824,6 +885,40 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
824
885
|
});
|
|
825
886
|
});
|
|
826
887
|
};
|
|
888
|
+
SolanaStreamClient.prototype.getFees = function (_a) {
|
|
889
|
+
var address = _a.address;
|
|
890
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
891
|
+
var _b, metadataPubKey, data, partners, filteredPartners;
|
|
892
|
+
return __generator(this, function (_c) {
|
|
893
|
+
switch (_c.label) {
|
|
894
|
+
case 0:
|
|
895
|
+
_b = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from(constants_1.FEES_METADATA_SEED)], new web3_js_1.PublicKey(constants_1.PARTNER_ORACLE_PROGRAM_ID)), 1), metadataPubKey = _b[0];
|
|
896
|
+
return [4 /*yield*/, this.connection.getAccountInfo(metadataPubKey)];
|
|
897
|
+
case 1:
|
|
898
|
+
data = _c.sent();
|
|
899
|
+
if (!data) {
|
|
900
|
+
return [2 /*return*/, null];
|
|
901
|
+
}
|
|
902
|
+
partners = borsh.deserialize(constants_1.PARTNERS_SCHEMA, data.data);
|
|
903
|
+
filteredPartners = partners.filter(function (item) { return new web3_js_1.PublicKey(item.pubkey).toString() === address; });
|
|
904
|
+
if (filteredPartners.length === 0) {
|
|
905
|
+
return [2 /*return*/, null];
|
|
906
|
+
}
|
|
907
|
+
return [2 /*return*/, {
|
|
908
|
+
streamflowFee: Number(filteredPartners[0].strm_fee.toFixed(4)),
|
|
909
|
+
partnerFee: Number(filteredPartners[0].partner_fee.toFixed(4)),
|
|
910
|
+
}];
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
SolanaStreamClient.prototype.getDefaultStreamflowFee = function () {
|
|
916
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
917
|
+
return __generator(this, function (_a) {
|
|
918
|
+
return [2 /*return*/, constants_1.DEFAULT_STREAMFLOW_FEE];
|
|
919
|
+
});
|
|
920
|
+
});
|
|
921
|
+
};
|
|
827
922
|
SolanaStreamClient.prototype.extractErrorCode = function (err) {
|
|
828
923
|
var _a;
|
|
829
924
|
return (0, utils_1.extractSolanaErrorCode)((_a = err.toString()) !== null && _a !== void 0 ? _a : "Unknown error!");
|
|
@@ -833,10 +928,10 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
833
928
|
*/
|
|
834
929
|
SolanaStreamClient.prototype.prepareStreamTransaction = function (recipient, streamParams, solanaExtendedConfig) {
|
|
835
930
|
return __awaiter(this, void 0, void 0, function () {
|
|
836
|
-
var mint, start, period, cliff, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, _a, automaticWithdrawal, _b, withdrawalFrequency, partner, sender, metadataPubKeys, ixs, commitment, recipientPublicKey, mintPublicKey, metadata, metadataPubKey,
|
|
837
|
-
var
|
|
838
|
-
return __generator(this, function (
|
|
839
|
-
switch (
|
|
931
|
+
var mint, start, period, cliff, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, _a, automaticWithdrawal, _b, withdrawalFrequency, partner, sender, metadataPubKeys, ixs, commitment, recipientPublicKey, mintPublicKey, _c, metadata, metadataPubKey, _d, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, hash, tx;
|
|
932
|
+
var _e;
|
|
933
|
+
return __generator(this, function (_f) {
|
|
934
|
+
switch (_f.label) {
|
|
840
935
|
case 0:
|
|
841
936
|
mint = streamParams.tokenId, start = streamParams.start, period = streamParams.period, cliff = streamParams.cliff, canTopup = streamParams.canTopup, cancelableBySender = streamParams.cancelableBySender, cancelableByRecipient = streamParams.cancelableByRecipient, transferableBySender = streamParams.transferableBySender, transferableByRecipient = streamParams.transferableByRecipient, _a = streamParams.automaticWithdrawal, automaticWithdrawal = _a === void 0 ? false : _a, _b = streamParams.withdrawalFrequency, withdrawalFrequency = _b === void 0 ? 0 : _b, partner = streamParams.partner;
|
|
842
937
|
sender = solanaExtendedConfig.sender, metadataPubKeys = solanaExtendedConfig.metadataPubKeys;
|
|
@@ -847,28 +942,21 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
847
942
|
commitment = typeof this.commitment == "string" ? this.commitment : this.commitment.commitment;
|
|
848
943
|
recipientPublicKey = new web3_js_1.PublicKey(recipient.recipient);
|
|
849
944
|
mintPublicKey = new web3_js_1.PublicKey(mint);
|
|
850
|
-
metadata =
|
|
851
|
-
|
|
852
|
-
metadata = web3_js_1.Keypair.generate();
|
|
853
|
-
metadataPubKey = metadata.publicKey;
|
|
854
|
-
}
|
|
855
|
-
else {
|
|
856
|
-
metadataPubKey = metadataPubKeys[0];
|
|
857
|
-
}
|
|
858
|
-
_c = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from("strm"), metadataPubKey.toBuffer()], this.programId), 1), escrowTokens = _c[0];
|
|
945
|
+
_c = this.getOrCreateStreamMetadata(metadataPubKeys), metadata = _c.metadata, metadataPubKey = _c.metadataPubKey;
|
|
946
|
+
_d = __read(web3_js_1.PublicKey.findProgramAddressSync([buffer_1.Buffer.from("strm"), metadataPubKey.toBuffer()], this.programId), 1), escrowTokens = _d[0];
|
|
859
947
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, sender.publicKey)];
|
|
860
948
|
case 1:
|
|
861
|
-
senderTokens =
|
|
949
|
+
senderTokens = _f.sent();
|
|
862
950
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, recipientPublicKey)];
|
|
863
951
|
case 2:
|
|
864
|
-
recipientTokens =
|
|
952
|
+
recipientTokens = _f.sent();
|
|
865
953
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY)];
|
|
866
954
|
case 3:
|
|
867
|
-
streamflowTreasuryTokens =
|
|
955
|
+
streamflowTreasuryTokens = _f.sent();
|
|
868
956
|
partnerPublicKey = partner ? new web3_js_1.PublicKey(partner) : constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY;
|
|
869
957
|
return [4 /*yield*/, (0, utils_1.ata)(mintPublicKey, partnerPublicKey)];
|
|
870
958
|
case 4:
|
|
871
|
-
partnerTokens =
|
|
959
|
+
partnerTokens = _f.sent();
|
|
872
960
|
ixs.push((0, instructions_1.createStreamInstruction)({
|
|
873
961
|
start: new bn_js_1.default(start),
|
|
874
962
|
depositedAmount: recipient.amount,
|
|
@@ -906,12 +994,12 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
906
994
|
}));
|
|
907
995
|
return [4 /*yield*/, this.connection.getLatestBlockhash(commitment)];
|
|
908
996
|
case 5:
|
|
909
|
-
hash =
|
|
910
|
-
tx = (
|
|
997
|
+
hash = _f.sent();
|
|
998
|
+
tx = (_e = new web3_js_1.Transaction({
|
|
911
999
|
feePayer: sender.publicKey,
|
|
912
1000
|
blockhash: hash.blockhash,
|
|
913
1001
|
lastValidBlockHeight: hash.lastValidBlockHeight,
|
|
914
|
-
})).add.apply(
|
|
1002
|
+
})).add.apply(_e, __spreadArray([], __read(ixs), false));
|
|
915
1003
|
if (metadata) {
|
|
916
1004
|
tx.partialSign(metadata);
|
|
917
1005
|
}
|
|
@@ -920,6 +1008,21 @@ var SolanaStreamClient = /** @class */ (function (_super) {
|
|
|
920
1008
|
});
|
|
921
1009
|
});
|
|
922
1010
|
};
|
|
1011
|
+
/**
|
|
1012
|
+
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
1013
|
+
*/
|
|
1014
|
+
SolanaStreamClient.prototype.getOrCreateStreamMetadata = function (metadataPubKeys) {
|
|
1015
|
+
var metadata;
|
|
1016
|
+
var metadataPubKey;
|
|
1017
|
+
if (!metadataPubKeys) {
|
|
1018
|
+
metadata = web3_js_1.Keypair.generate();
|
|
1019
|
+
metadataPubKey = metadata.publicKey;
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
metadataPubKey = metadataPubKeys[0];
|
|
1023
|
+
}
|
|
1024
|
+
return { metadata: metadata, metadataPubKey: metadataPubKey };
|
|
1025
|
+
};
|
|
923
1026
|
return SolanaStreamClient;
|
|
924
1027
|
}(BaseStreamClient_1.BaseStreamClient));
|
|
925
1028
|
exports.default = SolanaStreamClient;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { PublicKey } from "@solana/web3.js";
|
|
2
3
|
export declare const TX_FINALITY_CONFIRMED = "confirmed";
|
|
3
4
|
export declare const STREAM_STRUCT_OFFSET_SENDER = 49;
|
|
@@ -11,11 +12,42 @@ export declare const PROGRAM_ID: {
|
|
|
11
12
|
};
|
|
12
13
|
export declare const STREAMFLOW_PROGRAM_ID = "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m";
|
|
13
14
|
export declare const STREAMFLOW_DEVNET_PROGRAM_ID = "FGjLaVo5zLGdzCxMo9gu9tXr1kzTToKd8C8K7YS5hNM1";
|
|
15
|
+
export declare const PARTNER_ORACLE_PROGRAM_ID = "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
|
|
14
16
|
export declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
|
|
15
17
|
export declare const WITHDRAWOR_PUBLIC_KEY: PublicKey;
|
|
16
18
|
export declare const FEE_ORACLE_PUBLIC_KEY: PublicKey;
|
|
17
19
|
export declare const AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
20
|
+
export declare const FEES_METADATA_SEED: Buffer;
|
|
21
|
+
export declare const DEFAULT_STREAMFLOW_FEE = 0.99;
|
|
18
22
|
export declare const AIRDROP_AMOUNT = 1;
|
|
23
|
+
export declare const PARTNER_SCHEMA: {
|
|
24
|
+
struct: {
|
|
25
|
+
pubkey: {
|
|
26
|
+
array: {
|
|
27
|
+
type: string;
|
|
28
|
+
len: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
partner_fee: string;
|
|
32
|
+
strm_fee: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const PARTNERS_SCHEMA: {
|
|
36
|
+
array: {
|
|
37
|
+
type: {
|
|
38
|
+
struct: {
|
|
39
|
+
pubkey: {
|
|
40
|
+
array: {
|
|
41
|
+
type: string;
|
|
42
|
+
len: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
partner_fee: string;
|
|
46
|
+
strm_fee: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
19
51
|
export declare const SOLANA_ERROR_MATCH_REGEX: RegExp;
|
|
20
52
|
export declare const SOLANA_ERROR_MAP: {
|
|
21
53
|
[key: number]: string;
|
package/dist/solana/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SOLANA_ERROR_MAP = exports.SOLANA_ERROR_MATCH_REGEX = exports.AIRDROP_AMOUNT = exports.AIRDROP_TEST_TOKEN = exports.FEE_ORACLE_PUBLIC_KEY = exports.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.STREAMFLOW_DEVNET_PROGRAM_ID = exports.STREAMFLOW_PROGRAM_ID = exports.PROGRAM_ID = exports.CREATE_PARAMS_PADDING = exports.STREAM_STRUCT_OFFSET_RECIPIENT = exports.STREAM_STRUCT_OFFSET_SENDER = exports.TX_FINALITY_CONFIRMED = void 0;
|
|
4
|
+
exports.SOLANA_ERROR_MAP = exports.SOLANA_ERROR_MATCH_REGEX = exports.PARTNERS_SCHEMA = exports.PARTNER_SCHEMA = exports.AIRDROP_AMOUNT = exports.DEFAULT_STREAMFLOW_FEE = exports.FEES_METADATA_SEED = exports.AIRDROP_TEST_TOKEN = exports.FEE_ORACLE_PUBLIC_KEY = exports.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.PARTNER_ORACLE_PROGRAM_ID = exports.STREAMFLOW_DEVNET_PROGRAM_ID = exports.STREAMFLOW_PROGRAM_ID = exports.PROGRAM_ID = exports.CREATE_PARAMS_PADDING = exports.STREAM_STRUCT_OFFSET_RECIPIENT = exports.STREAM_STRUCT_OFFSET_SENDER = exports.TX_FINALITY_CONFIRMED = void 0;
|
|
5
5
|
var web3_js_1 = require("@solana/web3.js");
|
|
6
6
|
var types_1 = require("../common/types");
|
|
7
7
|
exports.TX_FINALITY_CONFIRMED = "confirmed";
|
|
@@ -17,11 +17,18 @@ exports.PROGRAM_ID = (_a = {},
|
|
|
17
17
|
_a);
|
|
18
18
|
exports.STREAMFLOW_PROGRAM_ID = "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m";
|
|
19
19
|
exports.STREAMFLOW_DEVNET_PROGRAM_ID = "FGjLaVo5zLGdzCxMo9gu9tXr1kzTToKd8C8K7YS5hNM1";
|
|
20
|
+
exports.PARTNER_ORACLE_PROGRAM_ID = "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa";
|
|
20
21
|
exports.STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js_1.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
21
22
|
exports.WITHDRAWOR_PUBLIC_KEY = new web3_js_1.PublicKey("wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u");
|
|
22
23
|
exports.FEE_ORACLE_PUBLIC_KEY = new web3_js_1.PublicKey("B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT");
|
|
23
24
|
exports.AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
25
|
+
exports.FEES_METADATA_SEED = Buffer.from("strm_fees");
|
|
26
|
+
exports.DEFAULT_STREAMFLOW_FEE = 0.99;
|
|
24
27
|
exports.AIRDROP_AMOUNT = 1; // 1 SOL is the cap on the testnet
|
|
28
|
+
exports.PARTNER_SCHEMA = {
|
|
29
|
+
struct: { pubkey: { array: { type: "u8", len: 32 } }, partner_fee: "f32", strm_fee: "f32" },
|
|
30
|
+
};
|
|
31
|
+
exports.PARTNERS_SCHEMA = { array: { type: exports.PARTNER_SCHEMA } };
|
|
25
32
|
exports.SOLANA_ERROR_MATCH_REGEX = /custom program error: (0x\d{2})/;
|
|
26
33
|
exports.SOLANA_ERROR_MAP = {
|
|
27
34
|
0x60: types_1.SolanaContractErrorCode.AccountsNotWritable,
|
package/dist/solana/layout.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as BufferLayout from "@solana/buffer-layout";
|
|
3
|
-
import { ICreateStreamLayout, ICreateUncheckedStreamLayout, IStreamLayout, ITopupStreamLayout, IUpdateStreamLayout, IWithdrawStreamLayout } from "./instructionTypes";
|
|
3
|
+
import { ICreateStreamLayout, ICreateUncheckedStreamLayout, IPartnerLayout, IStreamLayout, ITopupStreamLayout, IUpdateStreamLayout, IWithdrawStreamLayout } from "./instructionTypes";
|
|
4
4
|
/**
|
|
5
5
|
* Stream layout
|
|
6
6
|
*/
|
|
7
7
|
export declare const streamLayout: BufferLayout.Structure<IStreamLayout>;
|
|
8
|
+
export declare const partnerLayout: BufferLayout.Structure<IPartnerLayout>;
|
|
8
9
|
/**
|
|
9
10
|
* Create stream instruction layout
|
|
10
11
|
*/
|
package/dist/solana/layout.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.topupStreamLayout = exports.encodeUpdateStream = exports.withdrawStreamLayout = exports.createUncheckedStreamLayout = exports.createStreamLayout = exports.streamLayout = void 0;
|
|
26
|
+
exports.topupStreamLayout = exports.encodeUpdateStream = exports.withdrawStreamLayout = exports.createUncheckedStreamLayout = exports.createStreamLayout = exports.partnerLayout = exports.streamLayout = void 0;
|
|
27
27
|
var BufferLayout = __importStar(require("@solana/buffer-layout"));
|
|
28
28
|
var constants_1 = require("./constants");
|
|
29
29
|
/**
|
|
@@ -79,6 +79,11 @@ exports.streamLayout = BufferLayout.struct([
|
|
|
79
79
|
BufferLayout.blob(8, "last_rate_change_time"),
|
|
80
80
|
BufferLayout.blob(8, "funds_unlocked_at_last_rate_change"),
|
|
81
81
|
]);
|
|
82
|
+
exports.partnerLayout = BufferLayout.struct([
|
|
83
|
+
BufferLayout.blob(32, "pubkey"),
|
|
84
|
+
BufferLayout.f32("partner_fee"),
|
|
85
|
+
BufferLayout.f32("strm_fee"),
|
|
86
|
+
]);
|
|
82
87
|
/**
|
|
83
88
|
* Create stream instruction layout
|
|
84
89
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseStreamClient } from "../common/BaseStreamClient";
|
|
2
|
-
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetOneData, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData } from "../common/types";
|
|
2
|
+
import { ICancelData, ICluster, ICreateMultipleStreamData, ICreateResult, ICreateStreamData, IGetFeesData, IGetOneData, IFees, IMultiTransactionResult, ITopUpData, ITransactionResult, ITransferData, IUpdateData, IWithdrawData } from "../common/types";
|
|
3
3
|
import { Contract, ICreateStreamSuiExt, ITransactionSuiExt, ISuiIdParameters } from "./types";
|
|
4
4
|
export default class SuiStreamClient extends BaseStreamClient {
|
|
5
5
|
private programId;
|
|
@@ -42,6 +42,8 @@ export default class SuiStreamClient extends BaseStreamClient {
|
|
|
42
42
|
*/
|
|
43
43
|
update(updateData: IUpdateData, { senderWallet, tokenId }: ITransactionSuiExt): Promise<ITransactionResult>;
|
|
44
44
|
extractErrorCode(err: Error): string | null;
|
|
45
|
+
getFees({ address }: IGetFeesData): Promise<IFees | null>;
|
|
46
|
+
getDefaultStreamflowFee(): Promise<number>;
|
|
45
47
|
/**
|
|
46
48
|
* Returns StreamClient protocol program ID.
|
|
47
49
|
*/
|
package/dist/sui/StreamClient.js
CHANGED
|
@@ -438,6 +438,78 @@ var SuiStreamClient = /** @class */ (function (_super) {
|
|
|
438
438
|
var errorInfo = (0, utils_2.extractSuiErrorInfo)((_a = err.toString()) !== null && _a !== void 0 ? _a : "Unknown error!");
|
|
439
439
|
return ((_b = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.parsed) === null || _b === void 0 ? void 0 : _b.name) || null;
|
|
440
440
|
};
|
|
441
|
+
SuiStreamClient.prototype.getFees = function (_a) {
|
|
442
|
+
var address = _a.address;
|
|
443
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
444
|
+
var response, content, fields, fieldsResponse, partnerDynamicField, valueResponse, valueContent, valueFields;
|
|
445
|
+
return __generator(this, function (_b) {
|
|
446
|
+
switch (_b.label) {
|
|
447
|
+
case 0: return [4 /*yield*/, this.client.getObject({
|
|
448
|
+
id: this.feeTableId,
|
|
449
|
+
options: {
|
|
450
|
+
showContent: true,
|
|
451
|
+
},
|
|
452
|
+
})];
|
|
453
|
+
case 1:
|
|
454
|
+
response = _b.sent();
|
|
455
|
+
content = response.data.content;
|
|
456
|
+
if (content.dataType !== "moveObject") {
|
|
457
|
+
throw new Error("Not a Move Object!");
|
|
458
|
+
}
|
|
459
|
+
fields = content.fields;
|
|
460
|
+
return [4 /*yield*/, this.client.getDynamicFields({
|
|
461
|
+
parentId: fields.values.fields.id.id,
|
|
462
|
+
})];
|
|
463
|
+
case 2:
|
|
464
|
+
fieldsResponse = _b.sent();
|
|
465
|
+
partnerDynamicField = fieldsResponse.data.filter(function (item) { return item.name.value === address; })[0];
|
|
466
|
+
if (!partnerDynamicField) {
|
|
467
|
+
return [2 /*return*/, null];
|
|
468
|
+
}
|
|
469
|
+
return [4 /*yield*/, this.client.getObject({
|
|
470
|
+
id: partnerDynamicField.objectId,
|
|
471
|
+
options: {
|
|
472
|
+
showContent: true,
|
|
473
|
+
},
|
|
474
|
+
})];
|
|
475
|
+
case 3:
|
|
476
|
+
valueResponse = _b.sent();
|
|
477
|
+
valueContent = valueResponse.data.content;
|
|
478
|
+
if (valueContent.dataType !== "moveObject") {
|
|
479
|
+
throw new Error("Not a Move Object!");
|
|
480
|
+
}
|
|
481
|
+
valueFields = valueContent.fields.value.fields;
|
|
482
|
+
return [2 /*return*/, {
|
|
483
|
+
streamflowFee: Number(valueFields.streamflow_fee) / 100,
|
|
484
|
+
partnerFee: Number(valueFields.partner_fee) / 100,
|
|
485
|
+
}];
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
SuiStreamClient.prototype.getDefaultStreamflowFee = function () {
|
|
491
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
492
|
+
var response, content, fields;
|
|
493
|
+
return __generator(this, function (_a) {
|
|
494
|
+
switch (_a.label) {
|
|
495
|
+
case 0: return [4 /*yield*/, this.client.getObject({
|
|
496
|
+
id: this.configId,
|
|
497
|
+
options: {
|
|
498
|
+
showContent: true,
|
|
499
|
+
},
|
|
500
|
+
})];
|
|
501
|
+
case 1:
|
|
502
|
+
response = _a.sent();
|
|
503
|
+
content = response.data.content;
|
|
504
|
+
if (content.dataType !== "moveObject") {
|
|
505
|
+
throw new Error("Not a Move Object!");
|
|
506
|
+
}
|
|
507
|
+
fields = content.fields;
|
|
508
|
+
return [2 /*return*/, Number(fields.streamflow_fee) / 100];
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
};
|
|
441
513
|
/**
|
|
442
514
|
* Returns StreamClient protocol program ID.
|
|
443
515
|
*/
|
package/dist/sui/types.d.ts
CHANGED
|
@@ -76,6 +76,32 @@ export interface StreamResource {
|
|
|
76
76
|
version: string;
|
|
77
77
|
withdrawn: string;
|
|
78
78
|
}
|
|
79
|
+
export interface ClassResource {
|
|
80
|
+
streamflow_fee: string;
|
|
81
|
+
treasury: string;
|
|
82
|
+
tx_fee: string;
|
|
83
|
+
withdrawor: string;
|
|
84
|
+
}
|
|
85
|
+
export interface FeeTableResource {
|
|
86
|
+
values: {
|
|
87
|
+
type: string;
|
|
88
|
+
fields: {
|
|
89
|
+
id: {
|
|
90
|
+
id: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface FeeValueResource {
|
|
96
|
+
name: string;
|
|
97
|
+
value: {
|
|
98
|
+
type: string;
|
|
99
|
+
fields: {
|
|
100
|
+
partner_fee: string;
|
|
101
|
+
streamflow_fee: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
79
105
|
export declare class Contract implements Stream {
|
|
80
106
|
magic: number;
|
|
81
107
|
version: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.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/",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "ecf966f368ec55343cb346827a8e26b8b5237db7",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/bn.js": "5.1.1",
|
|
17
17
|
"@types/ethereum-checksum-address": "^0.0.0",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@suiet/wallet-kit": "0.2.18",
|
|
39
39
|
"aptos": "1.4.0",
|
|
40
40
|
"bn.js": "5.2.1",
|
|
41
|
+
"borsh": "^2.0.0",
|
|
41
42
|
"bs58": "5.0.0",
|
|
42
43
|
"ethereum-checksum-address": "0.0.8",
|
|
43
44
|
"ethers": "5.7.2",
|