@streamflow/stream 7.4.12 → 7.4.13
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.
|
@@ -49,6 +49,7 @@ const streamflow_aligned_unlocks_json_1 = __importDefault(require("./descriptor/
|
|
|
49
49
|
const derive_accounts_js_1 = require("./lib/derive-accounts.js");
|
|
50
50
|
const contractUtils_js_1 = require("../common/contractUtils.js");
|
|
51
51
|
const METADATA_ACC_SIZE = 1104;
|
|
52
|
+
const ALIGNED_METADATA_ACC_SIZE = 320;
|
|
52
53
|
class SolanaStreamClient extends BaseStreamClient_js_1.BaseStreamClient {
|
|
53
54
|
/**
|
|
54
55
|
* Create Stream instance
|
|
@@ -842,6 +843,9 @@ class SolanaStreamClient extends BaseStreamClient_js_1.BaseStreamClient {
|
|
|
842
843
|
bytes: sender,
|
|
843
844
|
},
|
|
844
845
|
},
|
|
846
|
+
{
|
|
847
|
+
dataSize: ALIGNED_METADATA_ACC_SIZE,
|
|
848
|
+
},
|
|
845
849
|
]);
|
|
846
850
|
const streamPubKeys = alignedOutgoingProgramAccounts.map((account) => account.account.stream);
|
|
847
851
|
const streamAccounts = await this.connection.getMultipleAccountsInfo(streamPubKeys, constants_js_1.TX_FINALITY_CONFIRMED);
|
|
@@ -857,11 +861,11 @@ class SolanaStreamClient extends BaseStreamClient_js_1.BaseStreamClient {
|
|
|
857
861
|
const streams = {};
|
|
858
862
|
const alignedStreamsPubKeys = Object.keys(streamRecord);
|
|
859
863
|
const alignedProxyPDAs = alignedStreamsPubKeys.map((streamPubKey) => (0, derive_accounts_js_1.deriveContractPDA)(this.alignedProxyProgram.programId, new web3_js_1.PublicKey(streamPubKey)));
|
|
860
|
-
const alignedProxyAccounts = await this.
|
|
864
|
+
const alignedProxyAccounts = await this.connection.getMultipleAccountsInfo(alignedProxyPDAs);
|
|
861
865
|
alignedProxyAccounts.forEach((account, index) => {
|
|
862
|
-
if (account) {
|
|
866
|
+
if (account && account.data.length === ALIGNED_METADATA_ACC_SIZE) {
|
|
863
867
|
const alignedData = streamRecord[alignedStreamsPubKeys[index]];
|
|
864
|
-
streams[alignedStreamsPubKeys[index]] = new types_js_1.AlignedContract(alignedData, account);
|
|
868
|
+
streams[alignedStreamsPubKeys[index]] = new types_js_1.AlignedContract(alignedData, this.alignedProxyProgram.account.contract.coder.accounts.decode("contract", account.data));
|
|
865
869
|
}
|
|
866
870
|
});
|
|
867
871
|
return streams;
|
|
@@ -20,6 +20,7 @@ import StreamflowAlignedUnlocksIDL from "./descriptor/idl/streamflow_aligned_unl
|
|
|
20
20
|
import { deriveContractPDA, deriveEscrowPDA, deriveTestOraclePDA } from "./lib/derive-accounts.js";
|
|
21
21
|
import { isCreateAlignedStreamData } from "../common/contractUtils.js";
|
|
22
22
|
const METADATA_ACC_SIZE = 1104;
|
|
23
|
+
const ALIGNED_METADATA_ACC_SIZE = 320;
|
|
23
24
|
export class SolanaStreamClient extends BaseStreamClient {
|
|
24
25
|
connection;
|
|
25
26
|
programId;
|
|
@@ -818,6 +819,9 @@ export class SolanaStreamClient extends BaseStreamClient {
|
|
|
818
819
|
bytes: sender,
|
|
819
820
|
},
|
|
820
821
|
},
|
|
822
|
+
{
|
|
823
|
+
dataSize: ALIGNED_METADATA_ACC_SIZE,
|
|
824
|
+
},
|
|
821
825
|
]);
|
|
822
826
|
const streamPubKeys = alignedOutgoingProgramAccounts.map((account) => account.account.stream);
|
|
823
827
|
const streamAccounts = await this.connection.getMultipleAccountsInfo(streamPubKeys, TX_FINALITY_CONFIRMED);
|
|
@@ -833,11 +837,11 @@ export class SolanaStreamClient extends BaseStreamClient {
|
|
|
833
837
|
const streams = {};
|
|
834
838
|
const alignedStreamsPubKeys = Object.keys(streamRecord);
|
|
835
839
|
const alignedProxyPDAs = alignedStreamsPubKeys.map((streamPubKey) => deriveContractPDA(this.alignedProxyProgram.programId, new PublicKey(streamPubKey)));
|
|
836
|
-
const alignedProxyAccounts = await this.
|
|
840
|
+
const alignedProxyAccounts = await this.connection.getMultipleAccountsInfo(alignedProxyPDAs);
|
|
837
841
|
alignedProxyAccounts.forEach((account, index) => {
|
|
838
|
-
if (account) {
|
|
842
|
+
if (account && account.data.length === ALIGNED_METADATA_ACC_SIZE) {
|
|
839
843
|
const alignedData = streamRecord[alignedStreamsPubKeys[index]];
|
|
840
|
-
streams[alignedStreamsPubKeys[index]] = new AlignedContract(alignedData, account);
|
|
844
|
+
streams[alignedStreamsPubKeys[index]] = new AlignedContract(alignedData, this.alignedProxyProgram.account.contract.coder.accounts.decode("contract", account.data));
|
|
841
845
|
}
|
|
842
846
|
});
|
|
843
847
|
return streams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamflow/stream",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.13",
|
|
4
4
|
"description": "JavaScript SDK to interact with Streamflow protocol.",
|
|
5
5
|
"homepage": "https://github.com/streamflow-finance/js-sdk/",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -8,29 +8,34 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/esm/index.d.ts",
|
|
11
12
|
"import": "./dist/esm/index.js",
|
|
12
|
-
"require": "./dist/cjs/index.js"
|
|
13
|
-
"types": "./dist/esm/index.d.ts"
|
|
13
|
+
"require": "./dist/cjs/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./aptos": {
|
|
16
|
+
"types": "./dist/esm/aptos/index.d.ts",
|
|
16
17
|
"import": "./dist/esm/aptos/index.js",
|
|
17
|
-
"require": "./dist/cjs/aptos/index.js"
|
|
18
|
-
"types": "./dist/esm/aptos/index.d.ts"
|
|
18
|
+
"require": "./dist/cjs/aptos/index.js"
|
|
19
19
|
},
|
|
20
20
|
"./evm": {
|
|
21
|
+
"types": "./dist/esm/evm/index.d.ts",
|
|
21
22
|
"import": "./dist/esm/evm/index.js",
|
|
22
|
-
"require": "./dist/cjs/evm/index.js"
|
|
23
|
-
|
|
23
|
+
"require": "./dist/cjs/evm/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./solana/idl/*": {
|
|
26
|
+
"types": "./dist/esm/solana/descriptor/*",
|
|
27
|
+
"import": "./dist/esm/solana/descriptor/*",
|
|
28
|
+
"require": "./dist/cjs/solana/descriptor/*"
|
|
24
29
|
},
|
|
25
30
|
"./solana": {
|
|
31
|
+
"types": "./dist/esm/solana/index.d.ts",
|
|
26
32
|
"import": "./dist/esm/solana/index.js",
|
|
27
|
-
"require": "./dist/cjs/solana/index.js"
|
|
28
|
-
"types": "./dist/esm/solana/index.d.ts"
|
|
33
|
+
"require": "./dist/cjs/solana/index.js"
|
|
29
34
|
},
|
|
30
35
|
"./sui": {
|
|
36
|
+
"types": "./dist/esm/sui/index.d.ts",
|
|
31
37
|
"import": "./dist/esm/sui/index.js",
|
|
32
|
-
"require": "./dist/cjs/sui/index.js"
|
|
33
|
-
"types": "./dist/esm/sui/index.d.ts"
|
|
38
|
+
"require": "./dist/cjs/sui/index.js"
|
|
34
39
|
}
|
|
35
40
|
},
|
|
36
41
|
"scripts": {
|
|
@@ -42,9 +47,9 @@
|
|
|
42
47
|
"lint": "eslint --fix .",
|
|
43
48
|
"prepublishOnly": "pnpm run lint && pnpm run test run && pnpm run build"
|
|
44
49
|
},
|
|
45
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "1fdd4be9210a469bac52e97f969b679774a9aefd",
|
|
46
51
|
"devDependencies": {
|
|
47
|
-
"@streamflow/eslint-config": "7.4.
|
|
52
|
+
"@streamflow/eslint-config": "7.4.13",
|
|
48
53
|
"@types/bn.js": "5.1.1",
|
|
49
54
|
"@types/ethereum-checksum-address": "^0.0.0",
|
|
50
55
|
"date-fns": "2.28.0",
|
|
@@ -59,7 +64,7 @@
|
|
|
59
64
|
"@solana/spl-token": "0.4.9",
|
|
60
65
|
"@solana/wallet-adapter-base": "0.9.19",
|
|
61
66
|
"@solana/web3.js": "1.95.4",
|
|
62
|
-
"@streamflow/common": "7.4.
|
|
67
|
+
"@streamflow/common": "7.4.13",
|
|
63
68
|
"@suiet/wallet-kit": "^0.3.3",
|
|
64
69
|
"aptos": "1.21.0",
|
|
65
70
|
"bn.js": "5.2.1",
|