@drift-labs/sdk 2.97.0-beta.25 → 2.97.0-beta.26
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.97.0-beta.
|
|
1
|
+
2.97.0-beta.26
|
|
@@ -83,21 +83,12 @@ class OrderSubscriber {
|
|
|
83
83
|
await this.driftClient.connection._rpcRequest('getProgramAccounts', rpcRequestArgs);
|
|
84
84
|
const rpcResponseAndContext = rpcJSONResponse.result;
|
|
85
85
|
const slot = rpcResponseAndContext.context.slot;
|
|
86
|
-
const programAccountSet = new Set();
|
|
87
86
|
for (const programAccount of rpcResponseAndContext.value) {
|
|
88
87
|
const key = programAccount.pubkey.toString();
|
|
89
|
-
programAccountSet.add(key);
|
|
90
88
|
this.tryUpdateUserAccount(key, 'raw', programAccount.account.data, slot);
|
|
91
89
|
// give event loop a chance to breathe
|
|
92
90
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
93
91
|
}
|
|
94
|
-
for (const key of this.usersAccounts.keys()) {
|
|
95
|
-
if (!programAccountSet.has(key)) {
|
|
96
|
-
this.usersAccounts.delete(key);
|
|
97
|
-
}
|
|
98
|
-
// give event loop a chance to breathe
|
|
99
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
100
|
-
}
|
|
101
92
|
}
|
|
102
93
|
catch (e) {
|
|
103
94
|
console.error(e);
|
|
@@ -83,21 +83,12 @@ class OrderSubscriber {
|
|
|
83
83
|
await this.driftClient.connection._rpcRequest('getProgramAccounts', rpcRequestArgs);
|
|
84
84
|
const rpcResponseAndContext = rpcJSONResponse.result;
|
|
85
85
|
const slot = rpcResponseAndContext.context.slot;
|
|
86
|
-
const programAccountSet = new Set();
|
|
87
86
|
for (const programAccount of rpcResponseAndContext.value) {
|
|
88
87
|
const key = programAccount.pubkey.toString();
|
|
89
|
-
programAccountSet.add(key);
|
|
90
88
|
this.tryUpdateUserAccount(key, 'raw', programAccount.account.data, slot);
|
|
91
89
|
// give event loop a chance to breathe
|
|
92
90
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
93
91
|
}
|
|
94
|
-
for (const key of this.usersAccounts.keys()) {
|
|
95
|
-
if (!programAccountSet.has(key)) {
|
|
96
|
-
this.usersAccounts.delete(key);
|
|
97
|
-
}
|
|
98
|
-
// give event loop a chance to breathe
|
|
99
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
100
|
-
}
|
|
101
92
|
}
|
|
102
93
|
catch (e) {
|
|
103
94
|
console.error(e);
|
package/package.json
CHANGED
|
@@ -113,10 +113,8 @@ export class OrderSubscriber {
|
|
|
113
113
|
|
|
114
114
|
const slot: number = rpcResponseAndContext.context.slot;
|
|
115
115
|
|
|
116
|
-
const programAccountSet = new Set<string>();
|
|
117
116
|
for (const programAccount of rpcResponseAndContext.value) {
|
|
118
117
|
const key = programAccount.pubkey.toString();
|
|
119
|
-
programAccountSet.add(key);
|
|
120
118
|
this.tryUpdateUserAccount(
|
|
121
119
|
key,
|
|
122
120
|
'raw',
|
|
@@ -126,14 +124,6 @@ export class OrderSubscriber {
|
|
|
126
124
|
// give event loop a chance to breathe
|
|
127
125
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
128
126
|
}
|
|
129
|
-
|
|
130
|
-
for (const key of this.usersAccounts.keys()) {
|
|
131
|
-
if (!programAccountSet.has(key)) {
|
|
132
|
-
this.usersAccounts.delete(key);
|
|
133
|
-
}
|
|
134
|
-
// give event loop a chance to breathe
|
|
135
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
136
|
-
}
|
|
137
127
|
} catch (e) {
|
|
138
128
|
console.error(e);
|
|
139
129
|
} finally {
|