@streamflow/stream 2.1.1 → 2.2.1

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.
@@ -10,3 +10,4 @@ export declare const PROGRAM_ID: {
10
10
  };
11
11
  export declare const STREAMFLOW_TREASURY_PUBLIC_KEY: PublicKey;
12
12
  export declare const WITHDRAWOR_PUBLIC_KEY: PublicKey;
13
+ export declare const FEE_ORACLE_PUBLIC_KEY: PublicKey;
package/dist/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.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.PROGRAM_ID = exports.STREAM_STRUCT_OFFSET_RECIPIENT = exports.STREAM_STRUCT_OFFSET_SENDER = exports.TX_FINALITY_CONFIRMED = void 0;
4
+ exports.FEE_ORACLE_PUBLIC_KEY = exports.WITHDRAWOR_PUBLIC_KEY = exports.STREAMFLOW_TREASURY_PUBLIC_KEY = exports.PROGRAM_ID = 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("./types");
7
7
  exports.TX_FINALITY_CONFIRMED = "confirmed";
@@ -15,3 +15,4 @@ exports.PROGRAM_ID = (_a = {},
15
15
  _a);
16
16
  exports.STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js_1.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
17
17
  exports.WITHDRAWOR_PUBLIC_KEY = new web3_js_1.PublicKey("wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u");
18
+ exports.FEE_ORACLE_PUBLIC_KEY = new web3_js_1.PublicKey("B743wFVk2pCYhV91cn287e1xY7f1vt4gdY48hhNiuQmT");
package/dist/sdk.d.ts CHANGED
@@ -22,7 +22,7 @@ export default class Stream {
22
22
  * @param {boolean} data.transferableByRecipient - Whether or not recipient can transfer the stream.
23
23
  * @param {boolean} [data.automaticWithdrawal = false] - Whether or not a 3rd party can initiate withdraw in the name of recipient.
24
24
  * @param {number} [data.withdrawalFrequency = 0] - Relevant when automatic withdrawal is enabled. If greater than 0 our withdrawor will take care of withdrawals. If equal to 0 our withdrawor will skip, but everyone else can initiate withdrawals.
25
- * @param {string} [data.partner = STREAMFLOW_TREASURY] - Partner's wallet address (optional).
25
+ * @param {string} [data.partner = ""] - Partner's wallet address (optional).
26
26
  * @param {ClusterExtended} [data.cluster = Cluster.Mainnet] - Cluster: devnet, mainnet-beta, testnet or local (optional).
27
27
  */
28
28
  static create({ connection, sender, recipient, mint, start, depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, cluster, }: CreateStreamParams): Promise<CreateStreamResponse>;
package/dist/sdk.js CHANGED
@@ -112,11 +112,11 @@ var Stream = /** @class */ (function () {
112
112
  * @param {boolean} data.transferableByRecipient - Whether or not recipient can transfer the stream.
113
113
  * @param {boolean} [data.automaticWithdrawal = false] - Whether or not a 3rd party can initiate withdraw in the name of recipient.
114
114
  * @param {number} [data.withdrawalFrequency = 0] - Relevant when automatic withdrawal is enabled. If greater than 0 our withdrawor will take care of withdrawals. If equal to 0 our withdrawor will skip, but everyone else can initiate withdrawals.
115
- * @param {string} [data.partner = STREAMFLOW_TREASURY] - Partner's wallet address (optional).
115
+ * @param {string} [data.partner = ""] - Partner's wallet address (optional).
116
116
  * @param {ClusterExtended} [data.cluster = Cluster.Mainnet] - Cluster: devnet, mainnet-beta, testnet or local (optional).
117
117
  */
118
118
  Stream.create = function (_a) {
119
- var connection = _a.connection, sender = _a.sender, recipient = _a.recipient, mint = _a.mint, start = _a.start, depositedAmount = _a.depositedAmount, 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, _b = _a.automaticWithdrawal, automaticWithdrawal = _b === void 0 ? false : _b, _c = _a.withdrawalFrequency, withdrawalFrequency = _c === void 0 ? 0 : _c, _d = _a.partner, partner = _d === void 0 ? constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY.toString() : _d, _e = _a.cluster, cluster = _e === void 0 ? types_1.Cluster.Mainnet : _e;
119
+ var connection = _a.connection, sender = _a.sender, recipient = _a.recipient, mint = _a.mint, start = _a.start, depositedAmount = _a.depositedAmount, 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, _b = _a.automaticWithdrawal, automaticWithdrawal = _b === void 0 ? false : _b, _c = _a.withdrawalFrequency, withdrawalFrequency = _c === void 0 ? 0 : _c, _d = _a.partner, partner = _d === void 0 ? "" : _d, _e = _a.cluster, cluster = _e === void 0 ? types_1.Cluster.Mainnet : _e;
120
120
  return __awaiter(this, void 0, void 0, function () {
121
121
  var program, mintPublicKey, recipientPublicKey, metadata, _f, escrowTokens, senderTokens, recipientTokens, streamflowTreasuryTokens, partnerPublicKey, partnerTokens, signers, nameUtf8EncodedBytes, tx;
122
122
  return __generator(this, function (_g) {
@@ -138,7 +138,9 @@ var Stream = /** @class */ (function () {
138
138
  return [4 /*yield*/, ata(mintPublicKey, constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY)];
139
139
  case 4:
140
140
  streamflowTreasuryTokens = _g.sent();
141
- partnerPublicKey = new web3_js_1.PublicKey(partner);
141
+ partnerPublicKey = partner
142
+ ? new web3_js_1.PublicKey(partner)
143
+ : sender.publicKey;
142
144
  return [4 /*yield*/, ata(mintPublicKey, partnerPublicKey)];
143
145
  case 5:
144
146
  partnerTokens = _g.sent();
@@ -159,7 +161,7 @@ var Stream = /** @class */ (function () {
159
161
  partner: partnerPublicKey,
160
162
  partnerTokens: partnerTokens,
161
163
  mint: mint,
162
- feeOracle: constants_1.STREAMFLOW_TREASURY_PUBLIC_KEY,
164
+ feeOracle: constants_1.FEE_ORACLE_PUBLIC_KEY,
163
165
  rent: web3_js_1.SYSVAR_RENT_PUBKEY,
164
166
  timelockProgram: program.programId,
165
167
  tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamflow/stream",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
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/",