@streamflow/stream 5.6.4 → 5.6.6
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/common/BaseStreamClient.d.ts +9 -9
- package/dist/common/constants.d.ts +1 -1
- package/dist/common/constants.js +1 -1
- package/dist/common/types.d.ts +1 -0
- package/dist/solana/utils.d.ts +0 -2
- package/dist/solana/utils.js +1 -60
- package/dist/sui/constants.js +1 -1
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ICreateStreamData, ICreateMultipleStreamData, IWithdrawData, ICancelData, ITransferData, ITopUpData, IGetOneData, IUpdateData, ITransactionResult, IMultiTransactionResult, ICreateResult, IGetAllData, Stream } from "./types";
|
|
2
2
|
export declare abstract class BaseStreamClient {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
abstract create(streamData: ICreateStreamData, chainSpecificParams: any): Promise<ICreateResult>;
|
|
4
|
+
abstract createMultiple(multipleStreamData: ICreateMultipleStreamData, chainSpecificParams: any): Promise<IMultiTransactionResult>;
|
|
5
|
+
abstract withdraw(withdrawData: IWithdrawData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
6
|
+
abstract cancel(cancelData: ICancelData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
7
|
+
abstract transfer(transferData: ITransferData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
8
|
+
abstract topup(topupData: ITopUpData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
9
|
+
abstract getOne(getOneData: IGetOneData, chainSpecificParams: any): Promise<Stream>;
|
|
10
|
+
abstract get(getAllData: IGetAllData, chainSpecificParams: any): Promise<[string, Stream][]>;
|
|
11
|
+
abstract update(updateData: IUpdateData, chainSpecificParams: any): Promise<ITransactionResult>;
|
|
12
12
|
extractErrorCode(err: Error): string | null;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const BASE_FEE =
|
|
1
|
+
export declare const BASE_FEE = 1009900;
|
package/dist/common/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BASE_FEE = void 0;
|
|
4
|
-
exports.BASE_FEE =
|
|
4
|
+
exports.BASE_FEE = 1009900; // Buffer to include usual fees when calculating stream amount
|
package/dist/common/types.d.ts
CHANGED
package/dist/solana/utils.d.ts
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import { SignerWalletAdapter } from "@solana/wallet-adapter-base";
|
|
3
3
|
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
4
4
|
import { DecodedStream, Account, BatchItem, BatchItemResult } from "./types";
|
|
5
|
-
import { Stream } from "../common/types";
|
|
6
5
|
export declare const decodeStream: (buf: Buffer) => DecodedStream;
|
|
7
|
-
export declare const formatDecodedStream: (stream: DecodedStream) => Stream;
|
|
8
6
|
/**
|
|
9
7
|
* Wrapper function for Solana web3 getProgramAccounts with slightly better call interface
|
|
10
8
|
* @param {Connection} connection - Solana web3 connection object.
|
package/dist/solana/utils.js
CHANGED
|
@@ -50,13 +50,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.extractSolanaErrorCode = exports.ata = exports.sendAndConfirmStreamRawTransaction = exports.signAllTransactionWithRecipients = exports.isSignerWallet = exports.getProgramAccounts = exports.
|
|
53
|
+
exports.extractSolanaErrorCode = exports.ata = exports.sendAndConfirmStreamRawTransaction = exports.signAllTransactionWithRecipients = exports.isSignerWallet = exports.getProgramAccounts = exports.decodeStream = void 0;
|
|
54
54
|
var spl_token_1 = require("@solana/spl-token");
|
|
55
55
|
var web3_js_1 = require("@solana/web3.js");
|
|
56
56
|
var bn_js_1 = __importDefault(require("bn.js"));
|
|
57
57
|
var bs58_1 = __importDefault(require("bs58"));
|
|
58
58
|
var layout_1 = require("./layout");
|
|
59
|
-
var contractUtils_1 = require("../common/contractUtils");
|
|
60
59
|
var constants_1 = require("./constants");
|
|
61
60
|
var decoder = new TextDecoder("utf-8");
|
|
62
61
|
var LE = "le"; //little endian
|
|
@@ -108,64 +107,6 @@ var decodeStream = function (buf) {
|
|
|
108
107
|
};
|
|
109
108
|
};
|
|
110
109
|
exports.decodeStream = decodeStream;
|
|
111
|
-
// DeprecationWarning: This object will be deprecated starting from the version 4.0.0. Use
|
|
112
|
-
// types/Contract instead
|
|
113
|
-
var formatDecodedStream = function (stream) {
|
|
114
|
-
var _a;
|
|
115
|
-
var resp = {
|
|
116
|
-
magic: stream.magic.toNumber(),
|
|
117
|
-
version: stream.version.toNumber(),
|
|
118
|
-
createdAt: stream.createdAt.toNumber(),
|
|
119
|
-
withdrawnAmount: stream.withdrawnAmount,
|
|
120
|
-
canceledAt: stream.canceledAt.toNumber(),
|
|
121
|
-
end: stream.end.toNumber(),
|
|
122
|
-
lastWithdrawnAt: stream.lastWithdrawnAt.toNumber(),
|
|
123
|
-
sender: stream.sender.toBase58(),
|
|
124
|
-
senderTokens: stream.senderTokens.toBase58(),
|
|
125
|
-
recipient: stream.recipient.toBase58(),
|
|
126
|
-
recipientTokens: stream.recipientTokens.toBase58(),
|
|
127
|
-
mint: stream.mint.toBase58(),
|
|
128
|
-
escrowTokens: stream.escrowTokens.toBase58(),
|
|
129
|
-
streamflowTreasury: stream.streamflowTreasury.toBase58(),
|
|
130
|
-
streamflowTreasuryTokens: stream.streamflowTreasuryTokens.toBase58(),
|
|
131
|
-
streamflowFeeTotal: stream.streamflowFeeTotal,
|
|
132
|
-
streamflowFeeWithdrawn: stream.streamflowFeeWithdrawn,
|
|
133
|
-
streamflowFeePercent: stream.streamflowFeePercent.toNumber(),
|
|
134
|
-
partnerFeeTotal: stream.partnerFeeTotal,
|
|
135
|
-
partnerFeeWithdrawn: stream.partnerFeeWithdrawn,
|
|
136
|
-
partnerFeePercent: stream.partnerFeePercent.toNumber(),
|
|
137
|
-
partner: stream.partner.toBase58(),
|
|
138
|
-
partnerTokens: (_a = stream.partnerTokens) === null || _a === void 0 ? void 0 : _a.toBase58(),
|
|
139
|
-
start: stream.start.toNumber(),
|
|
140
|
-
depositedAmount: stream.depositedAmount,
|
|
141
|
-
period: stream.period.toNumber(),
|
|
142
|
-
amountPerPeriod: stream.amountPerPeriod,
|
|
143
|
-
cliff: stream.cliff.toNumber(),
|
|
144
|
-
cliffAmount: stream.cliffAmount,
|
|
145
|
-
cancelableBySender: stream.cancelableBySender,
|
|
146
|
-
cancelableByRecipient: stream.cancelableByRecipient,
|
|
147
|
-
automaticWithdrawal: stream.automaticWithdrawal,
|
|
148
|
-
transferableBySender: stream.transferableBySender,
|
|
149
|
-
transferableByRecipient: stream.transferableByRecipient,
|
|
150
|
-
canTopup: stream.canTopup,
|
|
151
|
-
name: stream.name,
|
|
152
|
-
withdrawalFrequency: stream.withdrawFrequency.toNumber(),
|
|
153
|
-
closed: stream.closed,
|
|
154
|
-
currentPauseStart: stream.currentPauseStart.toNumber(),
|
|
155
|
-
pauseCumulative: stream.pauseCumulative,
|
|
156
|
-
lastRateChangeTime: stream.lastRateChangeTime.toNumber(),
|
|
157
|
-
fundsUnlockedAtLastRateChange: stream.fundsUnlockedAtLastRateChange,
|
|
158
|
-
type: (0, contractUtils_1.buildStreamType)(stream),
|
|
159
|
-
unlocked: function () {
|
|
160
|
-
return new bn_js_1.default(0);
|
|
161
|
-
},
|
|
162
|
-
withdrawn: function () {
|
|
163
|
-
return new bn_js_1.default(0);
|
|
164
|
-
}, //phantom method to preserve partial support of this object
|
|
165
|
-
};
|
|
166
|
-
return resp;
|
|
167
|
-
};
|
|
168
|
-
exports.formatDecodedStream = formatDecodedStream;
|
|
169
110
|
/**
|
|
170
111
|
* Wrapper function for Solana web3 getProgramAccounts with slightly better call interface
|
|
171
112
|
* @param {Connection} connection - Solana web3 connection object.
|
package/dist/sui/constants.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.SUI_MODULE_ERROR_MAP = exports.SUI_ERROR_MATCH_REGEX = exports.SUI_FEE_T
|
|
|
5
5
|
var types_1 = require("../common/types");
|
|
6
6
|
// TODO: remove Devnet and Local addresses as they are not deployed, they are just a copy Testnet values
|
|
7
7
|
exports.SUI_PROGRAM_IDS = (_a = {},
|
|
8
|
-
_a[types_1.ICluster.Mainnet] = "
|
|
8
|
+
_a[types_1.ICluster.Mainnet] = "0x527b334ab7216f01a5f0521ffb3dfff0cc4df06b65b2cd0d0864e05b13cf911a",
|
|
9
9
|
_a[types_1.ICluster.Devnet] = "0xf1916c119a6c917d4b36f96ffc0443930745789f3126a716e05a62223c48993a",
|
|
10
10
|
_a[types_1.ICluster.Testnet] = "0xf1916c119a6c917d4b36f96ffc0443930745789f3126a716e05a62223c48993a",
|
|
11
11
|
_a[types_1.ICluster.Local] = "0xf1916c119a6c917d4b36f96ffc0443930745789f3126a716e05a62223c48993a",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.6",
|
|
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": "6497aa20fc011f9a1f145a4daf4e5c5d8792aec2",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/bn.js": "5.1.1",
|
|
17
17
|
"@types/ethereum-checksum-address": "^0.0.0",
|