@streamflow/stream 3.0.16 → 3.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/__tests__/aptos/streamClient.spec.d.ts +1 -0
  2. package/dist/__tests__/aptos/streamClient.spec.js +160 -0
  3. package/dist/aptos/StreamClient.d.ts +49 -0
  4. package/dist/aptos/StreamClient.js +362 -0
  5. package/dist/aptos/constants.d.ts +2 -0
  6. package/dist/aptos/constants.js +12 -0
  7. package/dist/aptos/index.d.ts +2 -0
  8. package/dist/aptos/index.js +24 -0
  9. package/dist/aptos/types.d.ts +145 -0
  10. package/dist/aptos/types.js +65 -0
  11. package/dist/common/BaseStreamClient.d.ts +11 -0
  12. package/dist/common/BaseStreamClient.js +9 -0
  13. package/dist/common/GenericStreamClient.d.ts +60 -0
  14. package/dist/common/GenericStreamClient.js +137 -0
  15. package/dist/common/types.d.ts +71 -0
  16. package/dist/common/types.js +28 -0
  17. package/dist/{utils.d.ts → common/utils.d.ts} +0 -4
  18. package/dist/common/utils.js +31 -0
  19. package/dist/index.d.ts +5 -6
  20. package/dist/index.js +19 -10
  21. package/dist/solana/StreamClient.d.ts +71 -0
  22. package/dist/{StreamClient.js → solana/StreamClient.js} +304 -397
  23. package/dist/{constants.d.ts → solana/constants.d.ts} +1 -1
  24. package/dist/{constants.js → solana/constants.js} +5 -5
  25. package/dist/solana/index.d.ts +7 -0
  26. package/dist/solana/index.js +43 -0
  27. package/dist/solana/instructionTypes.d.ts +86 -0
  28. package/dist/solana/instructionTypes.js +2 -0
  29. package/dist/{instructions.d.ts → solana/instructions.d.ts} +8 -2
  30. package/dist/{instructions.js → solana/instructions.js} +55 -38
  31. package/dist/solana/layout.d.ts +27 -0
  32. package/dist/{layout.js → solana/layout.js} +65 -3
  33. package/dist/{idl/timelock.d.ts → solana/timelockIDL.d.ts} +0 -0
  34. package/dist/{idl/timelock.js → solana/timelockIDL.js} +0 -0
  35. package/dist/{types.d.ts → solana/types.d.ts} +37 -34
  36. package/dist/{types.js → solana/types.js} +3 -20
  37. package/dist/solana/utils.d.ts +42 -0
  38. package/dist/solana/utils.js +271 -0
  39. package/package.json +1 -1
  40. package/dist/Stream.d.ts +0 -87
  41. package/dist/Stream.js +0 -503
  42. package/dist/StreamClient.d.ts +0 -146
  43. package/dist/__tests__/test_dependencies/airdrop/airdrop-request.d.ts +0 -3
  44. package/dist/__tests__/test_dependencies/airdrop/airdrop-request.js +0 -67
  45. package/dist/__tests__/test_dependencies/airdrop/airdrop.d.ts +0 -6
  46. package/dist/__tests__/test_dependencies/airdrop/airdrop.js +0 -215
  47. package/dist/__tests__/test_dependencies/constants/index.d.ts +0 -122
  48. package/dist/__tests__/test_dependencies/constants/index.js +0 -158
  49. package/dist/__tests__/test_dependencies/idl/airdrop.d.ts +0 -27
  50. package/dist/__tests__/test_dependencies/idl/airdrop.js +0 -171
  51. package/dist/layout.d.ts +0 -22
  52. package/dist/utils.js +0 -126
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.requestAirdrop = void 0;
40
- var web3_js_1 = require("@solana/web3.js");
41
- var airdrop_1 = require("./airdrop");
42
- var constants_1 = require("../constants");
43
- var constants_2 = require("../constants");
44
- var requestAirdrop = function (wallet, connection) { return __awaiter(void 0, void 0, void 0, function () {
45
- var txSolAirdrop, txTestTokenAirdrop;
46
- return __generator(this, function (_a) {
47
- switch (_a.label) {
48
- case 0:
49
- if (!(wallet === null || wallet === void 0 ? void 0 : wallet.publicKey) || !connection) {
50
- return [2 /*return*/];
51
- }
52
- return [4 /*yield*/, connection.requestAirdrop(wallet.publicKey, constants_1.AIRDROP_AMOUNT * web3_js_1.LAMPORTS_PER_SOL)];
53
- case 1:
54
- txSolAirdrop = _a.sent();
55
- return [4 /*yield*/, connection.confirmTransaction(txSolAirdrop, constants_2.TX_FINALITY_CONFIRMED)];
56
- case 2:
57
- _a.sent();
58
- return [4 /*yield*/, (0, airdrop_1.getTestTokenAirdrop)(connection, wallet)];
59
- case 3:
60
- txTestTokenAirdrop = _a.sent();
61
- return [2 /*return*/, Promise.all([
62
- connection.confirmTransaction(txTestTokenAirdrop, constants_2.TX_FINALITY_CONFIRMED),
63
- ])];
64
- }
65
- });
66
- }); };
67
- exports.requestAirdrop = requestAirdrop;
@@ -1,6 +0,0 @@
1
- import { Connection } from "@solana/web3.js";
2
- import type { TransactionSignature } from "@solana/web3.js";
3
- import { Wallet } from "@project-serum/anchor";
4
- export declare function initialize(connection: Connection, wallet: Wallet): Promise<boolean>;
5
- export declare function getTestTokenAirdrop(connection: Connection, wallet: Wallet): Promise<TransactionSignature>;
6
- export declare function cancel(connection: Connection, wallet: Wallet): Promise<boolean>;
@@ -1,215 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __read = (this && this.__read) || function (o, n) {
39
- var m = typeof Symbol === "function" && o[Symbol.iterator];
40
- if (!m) return o;
41
- var i = m.call(o), r, ar = [], e;
42
- try {
43
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
- }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
49
- }
50
- finally { if (e) throw e.error; }
51
- }
52
- return ar;
53
- };
54
- var __importDefault = (this && this.__importDefault) || function (mod) {
55
- return (mod && mod.__esModule) ? mod : { "default": mod };
56
- };
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- exports.cancel = exports.getTestTokenAirdrop = exports.initialize = void 0;
59
- var anchor_1 = require("@project-serum/anchor");
60
- var web3_js_1 = require("@solana/web3.js");
61
- var spl_token_1 = require("@solana/spl-token");
62
- var airdrop_1 = __importDefault(require("../idl/airdrop"));
63
- var constants_1 = require("../constants");
64
- var PROGRAM_ID = "Ek6Jpdv5iEEDLXTVQ8UFcntms3DT2ewHtzzwH2R5MpvN";
65
- function initProgram(connection, wallet) {
66
- var provider = new anchor_1.Provider(connection, wallet, {});
67
- return new anchor_1.Program(airdrop_1.default, PROGRAM_ID, provider);
68
- }
69
- function initialize(connection, wallet) {
70
- return __awaiter(this, void 0, void 0, function () {
71
- var program, mint, airdropAccount, assTokenAccount, assAirdropTokAcc, instr, err_1;
72
- return __generator(this, function (_a) {
73
- switch (_a.label) {
74
- case 0:
75
- program = initProgram(connection, wallet);
76
- mint = new web3_js_1.PublicKey(constants_1.AIRDROP_TEST_TOKEN);
77
- airdropAccount = new web3_js_1.Keypair();
78
- return [4 /*yield*/, (connection === null || connection === void 0 ? void 0 : connection.getTokenAccountsByOwner(wallet === null || wallet === void 0 ? void 0 : wallet.publicKey, {
79
- mint: mint,
80
- }))];
81
- case 1:
82
- assTokenAccount = (_a.sent()).value[0].pubkey;
83
- return [4 /*yield*/, spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, airdropAccount.publicKey)];
84
- case 2:
85
- assAirdropTokAcc = _a.sent();
86
- instr = spl_token_1.Token.createAssociatedTokenAccountInstruction(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, assAirdropTokAcc, airdropAccount.publicKey, wallet.publicKey);
87
- _a.label = 3;
88
- case 3:
89
- _a.trys.push([3, 5, , 6]);
90
- return [4 /*yield*/, program.rpc.initializeAirdrop(new anchor_1.BN(1000000 * Math.pow(10, 9)), new anchor_1.BN(100 * Math.pow(10, 9)), {
91
- accounts: {
92
- initializer: wallet === null || wallet === void 0 ? void 0 : wallet.publicKey,
93
- initializerDepositTokenAccount: assTokenAccount,
94
- airdropAccount: airdropAccount.publicKey,
95
- airdropTokenAccount: assAirdropTokAcc,
96
- systemProgram: web3_js_1.SystemProgram.programId,
97
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
98
- },
99
- signers: [airdropAccount],
100
- instructions: [instr],
101
- })];
102
- case 4:
103
- _a.sent();
104
- return [2 /*return*/, true];
105
- case 5:
106
- err_1 = _a.sent();
107
- return [2 /*return*/, false];
108
- case 6: return [2 /*return*/];
109
- }
110
- });
111
- });
112
- }
113
- exports.initialize = initialize;
114
- function getTestTokenAirdrop(connection, wallet) {
115
- return __awaiter(this, void 0, void 0, function () {
116
- var program, mint, airdropAccount, assTokenAcc, pda, _a, _pda, assAirdropTokAcc, tx, err_2;
117
- return __generator(this, function (_b) {
118
- switch (_b.label) {
119
- case 0:
120
- program = initProgram(connection, wallet);
121
- mint = new web3_js_1.PublicKey(constants_1.AIRDROP_TEST_TOKEN);
122
- return [4 /*yield*/, (connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(new web3_js_1.PublicKey(PROGRAM_ID)))];
123
- case 1:
124
- airdropAccount = (_b.sent())[0];
125
- return [4 /*yield*/, spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, wallet.publicKey)];
126
- case 2:
127
- assTokenAcc = _b.sent();
128
- return [4 /*yield*/, (connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(program.programId))];
129
- case 3:
130
- pda = (_b.sent())[0]
131
- .pubkey;
132
- return [4 /*yield*/, web3_js_1.PublicKey.findProgramAddress([Buffer.from("streamflow-airdrop", "utf-8")], program.programId)];
133
- case 4:
134
- _a = __read.apply(void 0, [_b.sent(), 1]), _pda = _a[0];
135
- return [4 /*yield*/, spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, pda)];
136
- case 5:
137
- assAirdropTokAcc = _b.sent();
138
- _b.label = 6;
139
- case 6:
140
- _b.trys.push([6, 8, , 9]);
141
- return [4 /*yield*/, program.rpc.getAirdrop({
142
- accounts: {
143
- taker: wallet === null || wallet === void 0 ? void 0 : wallet.publicKey,
144
- takerReceiveTokenAccount: assTokenAcc,
145
- airdropAccount: airdropAccount.pubkey,
146
- airdropTokenAccount: assAirdropTokAcc,
147
- mint: mint,
148
- pdaAccount: _pda,
149
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
150
- associatedTokenProgram: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID,
151
- systemProgram: web3_js_1.SystemProgram.programId,
152
- rent: web3_js_1.SYSVAR_RENT_PUBKEY,
153
- },
154
- })];
155
- case 7:
156
- tx = _b.sent();
157
- return [2 /*return*/, tx];
158
- case 8:
159
- err_2 = _b.sent();
160
- throw new Error(err_2);
161
- case 9: return [2 /*return*/];
162
- }
163
- });
164
- });
165
- }
166
- exports.getTestTokenAirdrop = getTestTokenAirdrop;
167
- function cancel(connection, wallet) {
168
- return __awaiter(this, void 0, void 0, function () {
169
- var program, mint, airdropAccount, assTokenAcc, pda, _a, _pda, assAirdropTokAcc, err_3;
170
- return __generator(this, function (_b) {
171
- switch (_b.label) {
172
- case 0:
173
- program = initProgram(connection, wallet);
174
- mint = new web3_js_1.PublicKey(constants_1.AIRDROP_TEST_TOKEN);
175
- return [4 /*yield*/, (connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(new web3_js_1.PublicKey(PROGRAM_ID)))];
176
- case 1:
177
- airdropAccount = (_b.sent())[0];
178
- return [4 /*yield*/, spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, wallet.publicKey)];
179
- case 2:
180
- assTokenAcc = _b.sent();
181
- return [4 /*yield*/, (connection === null || connection === void 0 ? void 0 : connection.getProgramAccounts(program.programId))];
182
- case 3:
183
- pda = (_b.sent())[0]
184
- .pubkey;
185
- return [4 /*yield*/, web3_js_1.PublicKey.findProgramAddress([Buffer.from("streamflow-airdrop", "utf-8")], program.programId)];
186
- case 4:
187
- _a = __read.apply(void 0, [_b.sent(), 1]), _pda = _a[0];
188
- return [4 /*yield*/, spl_token_1.Token.getAssociatedTokenAddress(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID, spl_token_1.TOKEN_PROGRAM_ID, mint, pda)];
189
- case 5:
190
- assAirdropTokAcc = _b.sent();
191
- _b.label = 6;
192
- case 6:
193
- _b.trys.push([6, 8, , 9]);
194
- return [4 /*yield*/, program.rpc.cancelAirdrop({
195
- accounts: {
196
- initializer: wallet === null || wallet === void 0 ? void 0 : wallet.publicKey,
197
- initializerDepositTokenAccount: assTokenAcc,
198
- pdaAccount: _pda,
199
- airdropAccount: airdropAccount.pubkey,
200
- airdropTokenAccount: assAirdropTokAcc,
201
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
202
- },
203
- })];
204
- case 7:
205
- _b.sent();
206
- return [2 /*return*/, true];
207
- case 8:
208
- err_3 = _b.sent();
209
- return [2 /*return*/, false];
210
- case 9: return [2 /*return*/];
211
- }
212
- });
213
- });
214
- }
215
- exports.cancel = cancel;
@@ -1,122 +0,0 @@
1
- export declare const AIRDROP_AMOUNT = 1;
2
- export declare const AIRDROP_PDA = "DRCLpDJUNiMeKuRP9dcnGuibjTMjDGFwbZEXsq1RRgiR";
3
- export declare const AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
4
- export declare const AIRDROP_WHITELIST: string[];
5
- export declare const ALLOWED_PDA_PROGRAMS: string[];
6
- export declare const TX_FINALITY_CONFIRMED = "confirmed";
7
- export declare const TX_FINALITY_FINALIZED = "finalized";
8
- export declare const INSTRUCTION_CREATE_STREAM = 0;
9
- export declare const INSTRUCTION_WITHDRAW_STREAM = 1;
10
- export declare const INSTRUCTION_CANCEL_STREAM = 2;
11
- export declare const INSTRUCTION_TRANSFER_RECIPIENT = 3;
12
- export declare enum ProgramInstruction {
13
- Create = 0,
14
- Withdraw = 1,
15
- Topup = 2,
16
- Cancel = 3,
17
- TransferRecipient = 4
18
- }
19
- export declare const EXPLORER_TYPE_TX = "tx";
20
- export declare const EXPLORER_TYPE_ADDR = "address";
21
- export declare const DATE_FORMAT = "yyyy-MM-dd";
22
- export declare const TIME_FORMAT = "HH:mm";
23
- export declare const START = "start";
24
- export declare const END = "end";
25
- export declare const ERR_NO_STREAM = "Specified stream doesn't exist. Please double check with the sender.";
26
- export declare const ERR_NOT_CONNECTED = "There was an issue with the connection - please try to refresh the page.";
27
- export declare const ERR_NO_TOKEN_SELECTED = "Please select the token";
28
- export declare const ERR_NO_PRIOR_CREDIT = "You don't have enough SOL in your wallet to pay for transaction fees.";
29
- export declare const PRODUCT_VESTING = "vesting";
30
- export declare const PRODUCT_STREAMS = "streams";
31
- export declare const PRODUCT_MULTIPAY = "multipay";
32
- export declare const PRODUCT_MULTISIG = "multisig";
33
- export declare const products: string[];
34
- export declare const DEFAULT_DECIMAL_PLACES = 2;
35
- export declare const ERRORS: {
36
- amount_required: string;
37
- amount_greater_than: string;
38
- token_required: string;
39
- recipient_required: string;
40
- not_valid_email: string;
41
- subject_required: string;
42
- start_date_required: string;
43
- start_date_is_in_the_past: string;
44
- start_time_required: string;
45
- start_time_is_in_the_past: string;
46
- end_date_required: string;
47
- end_time_required: string;
48
- deposited_amount_required: string;
49
- amount_too_high: string;
50
- invalid_address: string;
51
- address_is_a_program: string;
52
- release_amount_greater_than_deposited: string;
53
- end_should_be_after_start: string;
54
- cliff_should_be_after_start: string;
55
- cliff_should_be_before_end: string;
56
- required: string;
57
- release_frequency_is_too_slow: string;
58
- should_be_greater_than_0: string;
59
- max_year: string;
60
- subject_too_long: string;
61
- withdrawal_frequency_too_high: string;
62
- };
63
- export declare const PERIOD: {
64
- SECOND: number;
65
- MINUTE: number;
66
- HOUR: number;
67
- DAY: number;
68
- WEEK: number;
69
- MONTH: number;
70
- YEAR: number;
71
- };
72
- export declare const timePeriodOptions: {
73
- value: number;
74
- label: string;
75
- }[];
76
- export declare const EVENT_CATEGORY: {
77
- WALLET: string;
78
- STREAM: string;
79
- VESTING: string;
80
- };
81
- export declare const EVENT_ACTION: {
82
- TRANSFER: string;
83
- CANCEL: string;
84
- TOP_UP: string;
85
- WITHDRAW: string;
86
- CONNECT: string;
87
- DISCONNECT: string;
88
- };
89
- export declare const EVENT_LABEL: {
90
- NONE: string;
91
- };
92
- export declare const EVENT_TYPE: {
93
- EVENT: string;
94
- PAGEVIEW: string;
95
- PURCHASE: string;
96
- };
97
- export declare const TRANSACTION_VARIANT: {
98
- CREATE_VESTING: string;
99
- CREATE_STREAM: string;
100
- TOP_UP_STREAM: string;
101
- };
102
- export declare const AFFILIATION: {
103
- FREE: string;
104
- APP: string;
105
- };
106
- export declare const DEFAULT_GA_PURCHASE_CURRENCY = "USD";
107
- export declare const USD_PEGGED_COINS: string[];
108
- export declare const DATA_LAYER_VARIABLE: {
109
- WALLET_TYPE: string;
110
- TOKEN_FEE: string;
111
- TOKEN_SYMBOL: string;
112
- STREAM_ADDRESS: string;
113
- TOKEN_WITHDRAW_USD: string;
114
- STREAMFLOW_FEE_USD: string;
115
- STREAMFLOW_FEE_TOKEN: string;
116
- TOTAL_AMOUNT_TOKEN: string;
117
- TOTAL_AMOUNT_USD: string;
118
- };
119
- export declare const transferCancelOptions: {
120
- value: string;
121
- label: string;
122
- }[];
@@ -1,158 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transferCancelOptions = exports.DATA_LAYER_VARIABLE = exports.USD_PEGGED_COINS = exports.DEFAULT_GA_PURCHASE_CURRENCY = exports.AFFILIATION = exports.TRANSACTION_VARIANT = exports.EVENT_TYPE = exports.EVENT_LABEL = exports.EVENT_ACTION = exports.EVENT_CATEGORY = exports.timePeriodOptions = exports.PERIOD = exports.ERRORS = exports.DEFAULT_DECIMAL_PLACES = exports.products = exports.PRODUCT_MULTISIG = exports.PRODUCT_MULTIPAY = exports.PRODUCT_STREAMS = exports.PRODUCT_VESTING = exports.ERR_NO_PRIOR_CREDIT = exports.ERR_NO_TOKEN_SELECTED = exports.ERR_NOT_CONNECTED = exports.ERR_NO_STREAM = exports.END = exports.START = exports.TIME_FORMAT = exports.DATE_FORMAT = exports.EXPLORER_TYPE_ADDR = exports.EXPLORER_TYPE_TX = exports.ProgramInstruction = exports.INSTRUCTION_TRANSFER_RECIPIENT = exports.INSTRUCTION_CANCEL_STREAM = exports.INSTRUCTION_WITHDRAW_STREAM = exports.INSTRUCTION_CREATE_STREAM = exports.TX_FINALITY_FINALIZED = exports.TX_FINALITY_CONFIRMED = exports.ALLOWED_PDA_PROGRAMS = exports.AIRDROP_WHITELIST = exports.AIRDROP_TEST_TOKEN = exports.AIRDROP_PDA = exports.AIRDROP_AMOUNT = void 0;
4
- exports.AIRDROP_AMOUNT = 1; // 1 SOL is the cap on the testnet
5
- exports.AIRDROP_PDA = "DRCLpDJUNiMeKuRP9dcnGuibjTMjDGFwbZEXsq1RRgiR";
6
- exports.AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
7
- exports.AIRDROP_WHITELIST = [
8
- "3r1cS6LS7Q5e2XzMhjV4jwuJEyMsPnTFSSEU8HitWYFc",
9
- "9CTuPR1xDwyAnQmtAY7PawFDta7yjhkyZhLkXXsUQWFS",
10
- "8HRZui7gdzueWfB1Bgj2GesaPMJFyqLEk4y67TnNXcJd",
11
- "4pYeM1AhyqCXy63xtwfMtytz8keWxBD2gHWHqdwacK3C",
12
- ];
13
- exports.ALLOWED_PDA_PROGRAMS = [
14
- "GokivDYuQXPZCWRkwMhdH2h91KpDQXBEmpgBgs55bnpH",
15
- ];
16
- exports.TX_FINALITY_CONFIRMED = "confirmed";
17
- exports.TX_FINALITY_FINALIZED = "finalized";
18
- exports.INSTRUCTION_CREATE_STREAM = 0;
19
- exports.INSTRUCTION_WITHDRAW_STREAM = 1;
20
- exports.INSTRUCTION_CANCEL_STREAM = 2;
21
- exports.INSTRUCTION_TRANSFER_RECIPIENT = 3;
22
- var ProgramInstruction;
23
- (function (ProgramInstruction) {
24
- ProgramInstruction[ProgramInstruction["Create"] = 0] = "Create";
25
- ProgramInstruction[ProgramInstruction["Withdraw"] = 1] = "Withdraw";
26
- ProgramInstruction[ProgramInstruction["Topup"] = 2] = "Topup";
27
- ProgramInstruction[ProgramInstruction["Cancel"] = 3] = "Cancel";
28
- ProgramInstruction[ProgramInstruction["TransferRecipient"] = 4] = "TransferRecipient";
29
- })(ProgramInstruction = exports.ProgramInstruction || (exports.ProgramInstruction = {}));
30
- exports.EXPLORER_TYPE_TX = "tx";
31
- exports.EXPLORER_TYPE_ADDR = "address";
32
- exports.DATE_FORMAT = "yyyy-MM-dd";
33
- exports.TIME_FORMAT = "HH:mm";
34
- exports.START = "start";
35
- exports.END = "end";
36
- //might move to a separate class if it becomes clunky
37
- exports.ERR_NO_STREAM = "Specified stream doesn't exist. Please double check with the sender.";
38
- exports.ERR_NOT_CONNECTED = "There was an issue with the connection - please try to refresh the page.";
39
- exports.ERR_NO_TOKEN_SELECTED = "Please select the token";
40
- exports.ERR_NO_PRIOR_CREDIT = "You don't have enough SOL in your wallet to pay for transaction fees.";
41
- exports.PRODUCT_VESTING = "vesting";
42
- exports.PRODUCT_STREAMS = "streams";
43
- exports.PRODUCT_MULTIPAY = "multipay";
44
- exports.PRODUCT_MULTISIG = "multisig";
45
- exports.products = [
46
- exports.PRODUCT_VESTING,
47
- exports.PRODUCT_STREAMS,
48
- exports.PRODUCT_MULTIPAY,
49
- exports.PRODUCT_MULTISIG,
50
- ];
51
- exports.DEFAULT_DECIMAL_PLACES = 2;
52
- exports.ERRORS = {
53
- amount_required: "Amount is required.",
54
- amount_greater_than: "Please provide amount greater than 0.",
55
- token_required: "Token is required.",
56
- recipient_required: "You must choose a recipient.",
57
- not_valid_email: "Must be a valid email.",
58
- subject_required: "Please provide a subject (title).",
59
- start_date_required: "Start date is required.",
60
- start_date_is_in_the_past: "Cannot start stream in the past.",
61
- start_time_required: "Start time is required.",
62
- start_time_is_in_the_past: "Should start in future.",
63
- end_date_required: "End date is required.",
64
- end_time_required: "End time is required.",
65
- deposited_amount_required: "Deposited amount is required.",
66
- amount_too_high: "You don't have enough tokens.",
67
- invalid_address: "Please enter a valid Solana wallet address.",
68
- address_is_a_program: "Address cannot be a program.",
69
- release_amount_greater_than_deposited: "Should be <= deposited amount.",
70
- end_should_be_after_start: "End should happen after start.",
71
- cliff_should_be_after_start: "Cliff should happen after start.",
72
- cliff_should_be_before_end: "Cliff should happen before end.",
73
- required: "Required.",
74
- release_frequency_is_too_slow: "Should be smaller or equal to difference between END and CLIFF time.",
75
- should_be_greater_than_0: "Should be greater than 0.",
76
- max_year: "Year should be less than 9999.",
77
- subject_too_long: "It is either too long or there are many complex characters.",
78
- withdrawal_frequency_too_high: "Withdrawal frequency should be >= release frequency.",
79
- };
80
- exports.PERIOD = {
81
- SECOND: 1,
82
- MINUTE: 60,
83
- HOUR: 3600,
84
- DAY: 24 * 3600,
85
- WEEK: 7 * 24 * 3600,
86
- MONTH: Math.floor(30.4167 * 24 * 3600),
87
- YEAR: 365 * 24 * 3600, // 365 days
88
- };
89
- exports.timePeriodOptions = [
90
- { value: exports.PERIOD.SECOND, label: "second" },
91
- { value: exports.PERIOD.MINUTE, label: "minute" },
92
- { value: exports.PERIOD.HOUR, label: "hour" },
93
- { value: exports.PERIOD.DAY, label: "day" },
94
- { value: exports.PERIOD.WEEK, label: "week" },
95
- { value: exports.PERIOD.MONTH, label: "month" },
96
- { value: exports.PERIOD.YEAR, label: "year" },
97
- ];
98
- exports.EVENT_CATEGORY = {
99
- WALLET: "wallet",
100
- STREAM: "stream",
101
- VESTING: "vesting",
102
- };
103
- exports.EVENT_ACTION = {
104
- TRANSFER: "transfer",
105
- CANCEL: "cancel",
106
- TOP_UP: "top_up",
107
- WITHDRAW: "withdraw",
108
- CONNECT: "connect",
109
- DISCONNECT: "disconnect",
110
- };
111
- exports.EVENT_LABEL = {
112
- NONE: "none",
113
- };
114
- exports.EVENT_TYPE = {
115
- EVENT: "event",
116
- PAGEVIEW: "pageview",
117
- PURCHASE: "purchase",
118
- };
119
- exports.TRANSACTION_VARIANT = {
120
- CREATE_VESTING: "create_vesting",
121
- CREATE_STREAM: "create_stream",
122
- TOP_UP_STREAM: "top_up_stream",
123
- };
124
- exports.AFFILIATION = {
125
- FREE: "free",
126
- APP: "app",
127
- };
128
- exports.DEFAULT_GA_PURCHASE_CURRENCY = "USD";
129
- exports.USD_PEGGED_COINS = ["USDT", "USDC"];
130
- exports.DATA_LAYER_VARIABLE = {
131
- WALLET_TYPE: "walletType",
132
- TOKEN_FEE: "tokenFee",
133
- TOKEN_SYMBOL: "tokenSymbol",
134
- STREAM_ADDRESS: "streamAddress",
135
- TOKEN_WITHDRAW_USD: "tokenWithdrawUsd",
136
- STREAMFLOW_FEE_USD: "streamflowFeeUsd",
137
- STREAMFLOW_FEE_TOKEN: "streamflowFeeToken",
138
- TOTAL_AMOUNT_TOKEN: "totalAmountToken",
139
- TOTAL_AMOUNT_USD: "totalAmountUsd",
140
- };
141
- exports.transferCancelOptions = [
142
- {
143
- value: "recipient",
144
- label: "Only Recipient",
145
- },
146
- {
147
- value: "sender",
148
- label: "Only Sender",
149
- },
150
- {
151
- value: "both",
152
- label: "Both",
153
- },
154
- {
155
- value: "neither",
156
- label: "Neither",
157
- },
158
- ];
@@ -1,27 +0,0 @@
1
- declare const _default: {
2
- version: string;
3
- name: string;
4
- instructions: {
5
- name: string;
6
- accounts: {
7
- name: string;
8
- isMut: boolean;
9
- isSigner: boolean;
10
- }[];
11
- args: {
12
- name: string;
13
- type: string;
14
- }[];
15
- }[];
16
- accounts: {
17
- name: string;
18
- type: {
19
- kind: string;
20
- fields: {
21
- name: string;
22
- type: string;
23
- }[];
24
- };
25
- }[];
26
- };
27
- export default _default;