@drift-labs/sdk 2.131.0-beta.0 → 2.131.0-beta.10
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 +1 -1
- package/bun.lock +96 -5
- package/lib/browser/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcAccountSubscriber.js +2 -18
- package/lib/browser/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcProgramAccountSubscriber.js +2 -18
- package/lib/browser/accounts/webSocketAccountSubscriberV2.d.ts +36 -0
- package/lib/browser/accounts/webSocketAccountSubscriberV2.js +223 -0
- package/lib/browser/accounts/webSocketDriftClientAccountSubscriber.d.ts +6 -1
- package/lib/browser/accounts/webSocketDriftClientAccountSubscriber.js +4 -2
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.d.ts +53 -0
- package/lib/browser/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
- package/lib/browser/constants/index.d.ts +5 -0
- package/lib/browser/constants/index.js +21 -0
- package/lib/browser/constants/insuranceFund.d.ts +5 -0
- package/lib/browser/constants/insuranceFund.js +9 -0
- package/lib/browser/driftClient.js +3 -3
- package/lib/browser/driftClientConfig.d.ts +7 -2
- package/lib/browser/events/types.d.ts +1 -1
- package/lib/browser/idl/drift.json +29 -5
- package/lib/browser/index.d.ts +2 -4
- package/lib/browser/index.js +4 -5
- package/lib/browser/math/insurance.d.ts +2 -1
- package/lib/browser/math/insurance.js +7 -6
- package/lib/browser/math/oracles.d.ts +2 -2
- package/lib/browser/math/oracles.js +32 -32
- package/lib/browser/orderSubscriber/OrderSubscriber.js +4 -3
- package/lib/node/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcAccountSubscriber.js +2 -18
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.js +2 -18
- package/lib/node/accounts/webSocketAccountSubscriberV2.d.ts +37 -0
- package/lib/node/accounts/webSocketAccountSubscriberV2.d.ts.map +1 -0
- package/lib/node/accounts/webSocketAccountSubscriberV2.js +223 -0
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts +6 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.js +4 -2
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts +54 -0
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.d.ts.map +1 -0
- package/lib/node/accounts/webSocketProgramAccountSubscriberV2.js +453 -0
- package/lib/node/constants/index.d.ts +6 -0
- package/lib/node/constants/index.d.ts.map +1 -0
- package/lib/node/constants/index.js +21 -0
- package/lib/node/constants/insuranceFund.d.ts +6 -0
- package/lib/node/constants/insuranceFund.d.ts.map +1 -0
- package/lib/node/constants/insuranceFund.js +9 -0
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +3 -3
- package/lib/node/driftClientConfig.d.ts +7 -2
- package/lib/node/driftClientConfig.d.ts.map +1 -1
- package/lib/node/events/types.d.ts +1 -1
- package/lib/node/idl/drift.json +29 -5
- package/lib/node/index.d.ts +2 -4
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +4 -5
- package/lib/node/math/insurance.d.ts +2 -1
- package/lib/node/math/insurance.d.ts.map +1 -1
- package/lib/node/math/insurance.js +7 -6
- package/lib/node/math/oracles.d.ts +2 -2
- package/lib/node/math/oracles.d.ts.map +1 -1
- package/lib/node/math/oracles.js +32 -32
- package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
- package/lib/node/orderSubscriber/OrderSubscriber.js +4 -3
- package/lib/node/orderSubscriber/WebsocketSubscription.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/accounts/README_WebSocketAccountSubscriberV2.md +54 -0
- package/src/accounts/README_WebSocketProgramAccountSubscriberV2.md +135 -0
- package/src/accounts/grpcAccountSubscriber.ts +2 -28
- package/src/accounts/grpcProgramAccountSubscriber.ts +2 -28
- package/src/accounts/webSocketAccountSubscriberV2.ts +315 -0
- package/src/accounts/webSocketDriftClientAccountSubscriber.ts +22 -2
- package/src/accounts/webSocketProgramAccountSubscriberV2.ts +596 -0
- package/src/constants/index.ts +5 -0
- package/src/constants/insuranceFund.ts +8 -0
- package/src/driftClient.ts +2 -1
- package/src/driftClientConfig.ts +16 -2
- package/src/events/types.ts +1 -1
- package/src/idl/drift.json +30 -6
- package/src/index.ts +2 -4
- package/src/math/insurance.ts +2 -1
- package/src/math/oracles.ts +9 -7
- package/src/orderSubscriber/OrderSubscriber.ts +2 -1
- package/src/orderSubscriber/WebsocketSubscription.ts +1 -1
- package/tests/bn/test.ts +2 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.131.0-beta.
|
|
1
|
+
2.131.0-beta.10
|
package/bun.lock
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@switchboard-xyz/on-demand": "2.4.1",
|
|
20
20
|
"@triton-one/yellowstone-grpc": "1.3.0",
|
|
21
21
|
"anchor-bankrun": "0.3.0",
|
|
22
|
+
"gill": "^0.10.2",
|
|
22
23
|
"nanoid": "3.3.4",
|
|
23
24
|
"node-cache": "5.1.2",
|
|
24
25
|
"rpc-websockets": "7.5.1",
|
|
@@ -187,23 +188,79 @@
|
|
|
187
188
|
|
|
188
189
|
"@sinonjs/text-encoding": ["@sinonjs/text-encoding@0.7.3", "", {}, "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA=="],
|
|
189
190
|
|
|
191
|
+
"@solana-program/address-lookup-table": ["@solana-program/address-lookup-table@0.7.0", "", { "peerDependencies": { "@solana/kit": "^2.1.0" } }, "sha512-dzCeIO5LtiK3bIg0AwO+TPeGURjSG2BKt0c4FRx7105AgLy7uzTktpUzUj6NXAK9SzbirI8HyvHUvw1uvL8O9A=="],
|
|
192
|
+
|
|
193
|
+
"@solana-program/compute-budget": ["@solana-program/compute-budget@0.8.0", "", { "peerDependencies": { "@solana/kit": "^2.1.0" } }, "sha512-qPKxdxaEsFxebZ4K5RPuy7VQIm/tfJLa1+Nlt3KNA8EYQkz9Xm8htdoEaXVrer9kpgzzp9R3I3Bh6omwCM06tQ=="],
|
|
194
|
+
|
|
195
|
+
"@solana-program/system": ["@solana-program/system@0.7.0", "", { "peerDependencies": { "@solana/kit": "^2.1.0" } }, "sha512-FKTBsKHpvHHNc1ATRm7SlC5nF/VdJtOSjldhcyfMN9R7xo712Mo2jHIzvBgn8zQO5Kg0DcWuKB7268Kv1ocicw=="],
|
|
196
|
+
|
|
197
|
+
"@solana-program/token-2022": ["@solana-program/token-2022@0.4.2", "", { "peerDependencies": { "@solana/kit": "^2.1.0", "@solana/sysvars": "^2.1.0" } }, "sha512-zIpR5t4s9qEU3hZKupzIBxJ6nUV5/UVyIT400tu9vT1HMs5JHxaTTsb5GUhYjiiTvNwU0MQavbwc4Dl29L0Xvw=="],
|
|
198
|
+
|
|
199
|
+
"@solana/accounts": ["@solana/accounts@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/rpc-spec": "2.3.0", "@solana/rpc-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-QgQTj404Z6PXNOyzaOpSzjgMOuGwG8vC66jSDB+3zHaRcEPRVRd2sVSrd1U6sHtnV3aiaS6YyDuPQMheg4K2jw=="],
|
|
200
|
+
|
|
201
|
+
"@solana/addresses": ["@solana/addresses@2.3.0", "", { "dependencies": { "@solana/assertions": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/nominal-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-ypTNkY2ZaRFpHLnHAgaW8a83N0/WoqdFvCqf4CQmnMdFsZSdC7qOwcbd7YzdaQn9dy+P2hybewzB+KP7LutxGA=="],
|
|
202
|
+
|
|
203
|
+
"@solana/assertions": ["@solana/assertions@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-Ekoet3khNg3XFLN7MIz8W31wPQISpKUGDGTylLptI+JjCDWx3PIa88xjEMqFo02WJ8sBj2NLV64Xg1sBcsHjZQ=="],
|
|
204
|
+
|
|
190
205
|
"@solana/buffer-layout": ["@solana/buffer-layout@4.0.1", "", { "dependencies": { "buffer": "~6.0.3" } }, "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA=="],
|
|
191
206
|
|
|
192
207
|
"@solana/buffer-layout-utils": ["@solana/buffer-layout-utils@0.2.0", "", { "dependencies": { "@solana/buffer-layout": "^4.0.0", "@solana/web3.js": "^1.32.0", "bigint-buffer": "^1.1.5", "bignumber.js": "^9.0.1" } }, "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g=="],
|
|
193
208
|
|
|
194
|
-
"@solana/codecs": ["@solana/codecs@2.
|
|
209
|
+
"@solana/codecs": ["@solana/codecs@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/codecs-data-structures": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/options": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-JVqGPkzoeyU262hJGdH64kNLH0M+Oew2CIPOa/9tR3++q2pEd4jU2Rxdfye9sd0Ce3XJrR5AIa8ZfbyQXzjh+g=="],
|
|
195
210
|
|
|
196
|
-
"@solana/codecs-core": ["@solana/codecs-core@2.
|
|
211
|
+
"@solana/codecs-core": ["@solana/codecs-core@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw=="],
|
|
197
212
|
|
|
198
213
|
"@solana/codecs-data-structures": ["@solana/codecs-data-structures@2.0.0-preview.4", "", { "dependencies": { "@solana/codecs-core": "2.0.0-preview.4", "@solana/codecs-numbers": "2.0.0-preview.4", "@solana/errors": "2.0.0-preview.4" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-nt2k2eTeyzlI/ccutPcG36M/J8NAYfxBPI9h/nQjgJ+M+IgOKi31JV8StDDlG/1XvY0zyqugV3I0r3KAbZRJpA=="],
|
|
199
214
|
|
|
200
|
-
"@solana/codecs-numbers": ["@solana/codecs-numbers@2.
|
|
215
|
+
"@solana/codecs-numbers": ["@solana/codecs-numbers@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg=="],
|
|
201
216
|
|
|
202
|
-
"@solana/codecs-strings": ["@solana/codecs-strings@2.
|
|
217
|
+
"@solana/codecs-strings": ["@solana/codecs-strings@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "fastestsmallesttextencoderdecoder": "^1.0.22", "typescript": ">=5.3.3" } }, "sha512-y5pSBYwzVziXu521hh+VxqUtp0hYGTl1eWGoc1W+8mdvBdC1kTqm/X7aYQw33J42hw03JjryvYOvmGgk3Qz/Ug=="],
|
|
203
218
|
|
|
204
219
|
"@solana/errors": ["@solana/errors@2.0.0-preview.4", "", { "dependencies": { "chalk": "^5.3.0", "commander": "^12.1.0" }, "peerDependencies": { "typescript": ">=5" }, "bin": { "errors": "bin/cli.mjs" } }, "sha512-kadtlbRv2LCWr8A9V22On15Us7Nn8BvqNaOB4hXsTB3O0fU40D1ru2l+cReqLcRPij4znqlRzW9Xi0m6J5DIhA=="],
|
|
205
220
|
|
|
206
|
-
"@solana/
|
|
221
|
+
"@solana/fast-stable-stringify": ["@solana/fast-stable-stringify@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-KfJPrMEieUg6D3hfQACoPy0ukrAV8Kio883llt/8chPEG3FVTX9z/Zuf4O01a15xZmBbmQ7toil2Dp0sxMJSxw=="],
|
|
222
|
+
|
|
223
|
+
"@solana/functional": ["@solana/functional@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-AgsPh3W3tE+nK3eEw/W9qiSfTGwLYEvl0rWaxHht/lRcuDVwfKRzeSa5G79eioWFFqr+pTtoCr3D3OLkwKz02Q=="],
|
|
224
|
+
|
|
225
|
+
"@solana/instructions": ["@solana/instructions@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-PLMsmaIKu7hEAzyElrk2T7JJx4D+9eRwebhFZpy2PXziNSmFF929eRHKUsKqBFM3cYR1Yy3m6roBZfA+bGE/oQ=="],
|
|
226
|
+
|
|
227
|
+
"@solana/keys": ["@solana/keys@2.3.0", "", { "dependencies": { "@solana/assertions": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/nominal-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-ZVVdga79pNH+2pVcm6fr2sWz9HTwfopDVhYb0Lh3dh+WBmJjwkabXEIHey2rUES7NjFa/G7sV8lrUn/v8LDCCQ=="],
|
|
228
|
+
|
|
229
|
+
"@solana/kit": ["@solana/kit@2.3.0", "", { "dependencies": { "@solana/accounts": "2.3.0", "@solana/addresses": "2.3.0", "@solana/codecs": "2.3.0", "@solana/errors": "2.3.0", "@solana/functional": "2.3.0", "@solana/instructions": "2.3.0", "@solana/keys": "2.3.0", "@solana/programs": "2.3.0", "@solana/rpc": "2.3.0", "@solana/rpc-parsed-types": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "@solana/rpc-subscriptions": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/signers": "2.3.0", "@solana/sysvars": "2.3.0", "@solana/transaction-confirmation": "2.3.0", "@solana/transaction-messages": "2.3.0", "@solana/transactions": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-sb6PgwoW2LjE5oTFu4lhlS/cGt/NB3YrShEyx7JgWFWysfgLdJnhwWThgwy/4HjNsmtMrQGWVls0yVBHcMvlMQ=="],
|
|
230
|
+
|
|
231
|
+
"@solana/nominal-types": ["@solana/nominal-types@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-uKlMnlP4PWW5UTXlhKM8lcgIaNj8dvd8xO4Y9l+FVvh9RvW2TO0GwUO6JCo7JBzCB0PSqRJdWWaQ8pu1Ti/OkA=="],
|
|
232
|
+
|
|
233
|
+
"@solana/options": ["@solana/options@2.3.0", "", { "dependencies": { "@solana/codecs-core": "2.3.0", "@solana/codecs-data-structures": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-PPnnZBRCWWoZQ11exPxf//DRzN2C6AoFsDI/u2AsQfYih434/7Kp4XLpfOMT/XESi+gdBMFNNfbES5zg3wAIkw=="],
|
|
234
|
+
|
|
235
|
+
"@solana/programs": ["@solana/programs@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-UXKujV71VCI5uPs+cFdwxybtHZAIZyQkqDiDnmK+DawtOO9mBn4Nimdb/6RjR2CXT78mzO9ZCZ3qfyX+ydcB7w=="],
|
|
236
|
+
|
|
237
|
+
"@solana/promises": ["@solana/promises@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-GjVgutZKXVuojd9rWy1PuLnfcRfqsaCm7InCiZc8bqmJpoghlyluweNc7ml9Y5yQn1P2IOyzh9+p/77vIyNybQ=="],
|
|
238
|
+
|
|
239
|
+
"@solana/rpc": ["@solana/rpc@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/fast-stable-stringify": "2.3.0", "@solana/functional": "2.3.0", "@solana/rpc-api": "2.3.0", "@solana/rpc-spec": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "@solana/rpc-transformers": "2.3.0", "@solana/rpc-transport-http": "2.3.0", "@solana/rpc-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-ZWN76iNQAOCpYC7yKfb3UNLIMZf603JckLKOOLTHuy9MZnTN8XV6uwvDFhf42XvhglgUjGCEnbUqWtxQ9pa/pQ=="],
|
|
240
|
+
|
|
241
|
+
"@solana/rpc-api": ["@solana/rpc-api@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/keys": "2.3.0", "@solana/rpc-parsed-types": "2.3.0", "@solana/rpc-spec": "2.3.0", "@solana/rpc-transformers": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/transaction-messages": "2.3.0", "@solana/transactions": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-UUdiRfWoyYhJL9PPvFeJr4aJ554ob2jXcpn4vKmRVn9ire0sCbpQKYx6K8eEKHZWXKrDW8IDspgTl0gT/aJWVg=="],
|
|
242
|
+
|
|
243
|
+
"@solana/rpc-parsed-types": ["@solana/rpc-parsed-types@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-B5pHzyEIbBJf9KHej+zdr5ZNAdSvu7WLU2lOUPh81KHdHQs6dEb310LGxcpCc7HVE8IEdO20AbckewDiAN6OCg=="],
|
|
244
|
+
|
|
245
|
+
"@solana/rpc-spec": ["@solana/rpc-spec@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/rpc-spec-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-fA2LMX4BMixCrNB2n6T83AvjZ3oUQTu7qyPLyt8gHQaoEAXs8k6GZmu6iYcr+FboQCjUmRPgMaABbcr9j2J9Sw=="],
|
|
246
|
+
|
|
247
|
+
"@solana/rpc-spec-types": ["@solana/rpc-spec-types@2.3.0", "", { "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-xQsb65lahjr8Wc9dMtP7xa0ZmDS8dOE2ncYjlvfyw/h4mpdXTUdrSMi6RtFwX33/rGuztQ7Hwaid5xLNSLvsFQ=="],
|
|
248
|
+
|
|
249
|
+
"@solana/rpc-subscriptions": ["@solana/rpc-subscriptions@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/fast-stable-stringify": "2.3.0", "@solana/functional": "2.3.0", "@solana/promises": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "@solana/rpc-subscriptions-api": "2.3.0", "@solana/rpc-subscriptions-channel-websocket": "2.3.0", "@solana/rpc-subscriptions-spec": "2.3.0", "@solana/rpc-transformers": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/subscribable": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-Uyr10nZKGVzvCOqwCZgwYrzuoDyUdwtgQRefh13pXIrdo4wYjVmoLykH49Omt6abwStB0a4UL5gX9V4mFdDJZg=="],
|
|
250
|
+
|
|
251
|
+
"@solana/rpc-subscriptions-api": ["@solana/rpc-subscriptions-api@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/keys": "2.3.0", "@solana/rpc-subscriptions-spec": "2.3.0", "@solana/rpc-transformers": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/transaction-messages": "2.3.0", "@solana/transactions": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-9mCjVbum2Hg9KGX3LKsrI5Xs0KX390lS+Z8qB80bxhar6MJPugqIPH8uRgLhCW9GN3JprAfjRNl7our8CPvsPQ=="],
|
|
252
|
+
|
|
253
|
+
"@solana/rpc-subscriptions-channel-websocket": ["@solana/rpc-subscriptions-channel-websocket@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/functional": "2.3.0", "@solana/rpc-subscriptions-spec": "2.3.0", "@solana/subscribable": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3", "ws": "^8.18.0" } }, "sha512-2oL6ceFwejIgeWzbNiUHI2tZZnaOxNTSerszcin7wYQwijxtpVgUHiuItM/Y70DQmH9sKhmikQp+dqeGalaJxw=="],
|
|
254
|
+
|
|
255
|
+
"@solana/rpc-subscriptions-spec": ["@solana/rpc-subscriptions-spec@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/promises": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "@solana/subscribable": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-rdmVcl4PvNKQeA2l8DorIeALCgJEMSu7U8AXJS1PICeb2lQuMeaR+6cs/iowjvIB0lMVjYN2sFf6Q3dJPu6wWg=="],
|
|
256
|
+
|
|
257
|
+
"@solana/rpc-transformers": ["@solana/rpc-transformers@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/functional": "2.3.0", "@solana/nominal-types": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "@solana/rpc-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-UuHYK3XEpo9nMXdjyGKkPCOr7WsZsxs7zLYDO1A5ELH3P3JoehvrDegYRAGzBS2VKsfApZ86ZpJToP0K3PhmMA=="],
|
|
258
|
+
|
|
259
|
+
"@solana/rpc-transport-http": ["@solana/rpc-transport-http@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0", "@solana/rpc-spec": "2.3.0", "@solana/rpc-spec-types": "2.3.0", "undici-types": "^7.11.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-HFKydmxGw8nAF5N+S0NLnPBDCe5oMDtI2RAmW8DMqP4U3Zxt2XWhvV1SNkAldT5tF0U1vP+is6fHxyhk4xqEvg=="],
|
|
260
|
+
|
|
261
|
+
"@solana/rpc-types": ["@solana/rpc-types@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/nominal-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-O09YX2hED2QUyGxrMOxQ9GzH1LlEwwZWu69QbL4oYmIf6P5dzEEHcqRY6L1LsDVqc/dzAdEs/E1FaPrcIaIIPw=="],
|
|
262
|
+
|
|
263
|
+
"@solana/signers": ["@solana/signers@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/errors": "2.3.0", "@solana/instructions": "2.3.0", "@solana/keys": "2.3.0", "@solana/nominal-types": "2.3.0", "@solana/transaction-messages": "2.3.0", "@solana/transactions": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-OSv6fGr/MFRx6J+ZChQMRqKNPGGmdjkqarKkRzkwmv7v8quWsIRnJT5EV8tBy3LI4DLO/A8vKiNSPzvm1TdaiQ=="],
|
|
207
264
|
|
|
208
265
|
"@solana/spl-token": ["@solana/spl-token@0.4.13", "", { "dependencies": { "@solana/buffer-layout": "^4.0.0", "@solana/buffer-layout-utils": "^0.2.0", "@solana/spl-token-group": "^0.0.7", "@solana/spl-token-metadata": "^0.1.6", "buffer": "^6.0.3" }, "peerDependencies": { "@solana/web3.js": "^1.95.5" } }, "sha512-cite/pYWQZZVvLbg5lsodSovbetK/eA24gaR0eeUeMuBAMNrT8XFCwaygKy0N2WSg3gSyjjNpIeAGBAKZaY/1w=="],
|
|
209
266
|
|
|
@@ -211,6 +268,16 @@
|
|
|
211
268
|
|
|
212
269
|
"@solana/spl-token-metadata": ["@solana/spl-token-metadata@0.1.6", "", { "dependencies": { "@solana/codecs": "2.0.0-rc.1" }, "peerDependencies": { "@solana/web3.js": "^1.95.3" } }, "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA=="],
|
|
213
270
|
|
|
271
|
+
"@solana/subscribable": ["@solana/subscribable@2.3.0", "", { "dependencies": { "@solana/errors": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-DkgohEDbMkdTWiKAoatY02Njr56WXx9e/dKKfmne8/Ad6/2llUIrax78nCdlvZW9quXMaXPTxZvdQqo9N669Og=="],
|
|
272
|
+
|
|
273
|
+
"@solana/sysvars": ["@solana/sysvars@2.3.0", "", { "dependencies": { "@solana/accounts": "2.3.0", "@solana/codecs": "2.3.0", "@solana/errors": "2.3.0", "@solana/rpc-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-LvjADZrpZ+CnhlHqfI5cmsRzX9Rpyb1Ox2dMHnbsRNzeKAMhu9w4ZBIaeTdO322zsTr509G1B+k2ABD3whvUBA=="],
|
|
274
|
+
|
|
275
|
+
"@solana/transaction-confirmation": ["@solana/transaction-confirmation@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/keys": "2.3.0", "@solana/promises": "2.3.0", "@solana/rpc": "2.3.0", "@solana/rpc-subscriptions": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/transaction-messages": "2.3.0", "@solana/transactions": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-UiEuiHCfAAZEKdfne/XljFNJbsKAe701UQHKXEInYzIgBjRbvaeYZlBmkkqtxwcasgBTOmEaEKT44J14N9VZDw=="],
|
|
276
|
+
|
|
277
|
+
"@solana/transaction-messages": ["@solana/transaction-messages@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-data-structures": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/errors": "2.3.0", "@solana/functional": "2.3.0", "@solana/instructions": "2.3.0", "@solana/nominal-types": "2.3.0", "@solana/rpc-types": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-bgqvWuy3MqKS5JdNLH649q+ngiyOu5rGS3DizSnWwYUd76RxZl1kN6CoqHSrrMzFMvis6sck/yPGG3wqrMlAww=="],
|
|
278
|
+
|
|
279
|
+
"@solana/transactions": ["@solana/transactions@2.3.0", "", { "dependencies": { "@solana/addresses": "2.3.0", "@solana/codecs-core": "2.3.0", "@solana/codecs-data-structures": "2.3.0", "@solana/codecs-numbers": "2.3.0", "@solana/codecs-strings": "2.3.0", "@solana/errors": "2.3.0", "@solana/functional": "2.3.0", "@solana/instructions": "2.3.0", "@solana/keys": "2.3.0", "@solana/nominal-types": "2.3.0", "@solana/rpc-types": "2.3.0", "@solana/transaction-messages": "2.3.0" }, "peerDependencies": { "typescript": ">=5.3.3" } }, "sha512-LnTvdi8QnrQtuEZor5Msje61sDpPstTVwKg4y81tNxDhiyomjuvnSNLAq6QsB9gIxUqbNzPZgOG9IU4I4/Uaug=="],
|
|
280
|
+
|
|
214
281
|
"@solana/web3.js": ["@solana/web3.js@1.98.0", "", { "dependencies": { "@babel/runtime": "^7.25.0", "@noble/curves": "^1.4.2", "@noble/hashes": "^1.4.0", "@solana/buffer-layout": "^4.0.1", "agentkeepalive": "^4.5.0", "bigint-buffer": "^1.1.5", "bn.js": "^5.2.1", "borsh": "^0.7.0", "bs58": "^4.0.1", "buffer": "6.0.3", "fast-stable-stringify": "^1.0.0", "jayson": "^4.1.1", "node-fetch": "^2.7.0", "rpc-websockets": "^9.0.2", "superstruct": "^2.0.2" } }, "sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA=="],
|
|
215
282
|
|
|
216
283
|
"@swc/helpers": ["@swc/helpers@0.5.15", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g=="],
|
|
@@ -607,6 +674,8 @@
|
|
|
607
674
|
|
|
608
675
|
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
|
609
676
|
|
|
677
|
+
"gill": ["gill@0.10.2", "", { "dependencies": { "@solana-program/address-lookup-table": "^0.7.0", "@solana-program/compute-budget": "^0.8.0", "@solana-program/system": "^0.7.0", "@solana-program/token-2022": "^0.4.1", "@solana/assertions": "^2.1.1", "@solana/codecs": "^2.1.1", "@solana/kit": "^2.1.1", "@solana/transaction-confirmation": "^2.1.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-upWoY2dfOzKHOcX3UnD+B3h9WUunPv0oxeKzsIgKSaLyURpWK9oI+K2NHWbwrUFsXEK6ozu/sgkhuqyAcVTZCg=="],
|
|
678
|
+
|
|
610
679
|
"glob": ["glob@8.1.0", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" } }, "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ=="],
|
|
611
680
|
|
|
612
681
|
"glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
|
|
@@ -1109,6 +1178,12 @@
|
|
|
1109
1178
|
|
|
1110
1179
|
"@solana/errors/commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
|
|
1111
1180
|
|
|
1181
|
+
"@solana/rpc-transport-http/undici-types": ["undici-types@7.12.0", "", {}, "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ=="],
|
|
1182
|
+
|
|
1183
|
+
"@solana/spl-token-group/@solana/codecs": ["@solana/codecs@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-data-structures": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/codecs-strings": "2.0.0-rc.1", "@solana/options": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ=="],
|
|
1184
|
+
|
|
1185
|
+
"@solana/spl-token-metadata/@solana/codecs": ["@solana/codecs@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-data-structures": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/codecs-strings": "2.0.0-rc.1", "@solana/options": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ=="],
|
|
1186
|
+
|
|
1112
1187
|
"@solana/web3.js/rpc-websockets": ["rpc-websockets@9.1.1", "", { "dependencies": { "@swc/helpers": "^0.5.11", "@types/uuid": "^8.3.4", "@types/ws": "^8.2.2", "buffer": "^6.0.3", "eventemitter3": "^5.0.1", "uuid": "^8.3.2", "ws": "^8.5.0" }, "optionalDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" } }, "sha512-1IXGM/TfPT6nfYMIXkJdzn+L4JEsmb0FL1O2OBjaH03V3yuUDdKFulGLMFG6ErV+8pZ5HVC0limve01RyO+saA=="],
|
|
1113
1188
|
|
|
1114
1189
|
"@solana/web3.js/superstruct": ["superstruct@2.0.2", "", {}, "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A=="],
|
|
@@ -1199,6 +1274,22 @@
|
|
|
1199
1274
|
|
|
1200
1275
|
"@pythnetwork/solana-utils/bs58/base-x": ["base-x@4.0.0", "", {}, "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw=="],
|
|
1201
1276
|
|
|
1277
|
+
"@solana/spl-token-group/@solana/codecs/@solana/codecs-core": ["@solana/codecs-core@2.0.0-rc.1", "", { "dependencies": { "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ=="],
|
|
1278
|
+
|
|
1279
|
+
"@solana/spl-token-group/@solana/codecs/@solana/codecs-numbers": ["@solana/codecs-numbers@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ=="],
|
|
1280
|
+
|
|
1281
|
+
"@solana/spl-token-group/@solana/codecs/@solana/codecs-strings": ["@solana/codecs-strings@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "fastestsmallesttextencoderdecoder": "^1.0.22", "typescript": ">=5" } }, "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g=="],
|
|
1282
|
+
|
|
1283
|
+
"@solana/spl-token-group/@solana/codecs/@solana/options": ["@solana/options@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-data-structures": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/codecs-strings": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA=="],
|
|
1284
|
+
|
|
1285
|
+
"@solana/spl-token-metadata/@solana/codecs/@solana/codecs-core": ["@solana/codecs-core@2.0.0-rc.1", "", { "dependencies": { "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ=="],
|
|
1286
|
+
|
|
1287
|
+
"@solana/spl-token-metadata/@solana/codecs/@solana/codecs-numbers": ["@solana/codecs-numbers@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ=="],
|
|
1288
|
+
|
|
1289
|
+
"@solana/spl-token-metadata/@solana/codecs/@solana/codecs-strings": ["@solana/codecs-strings@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "fastestsmallesttextencoderdecoder": "^1.0.22", "typescript": ">=5" } }, "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g=="],
|
|
1290
|
+
|
|
1291
|
+
"@solana/spl-token-metadata/@solana/codecs/@solana/options": ["@solana/options@2.0.0-rc.1", "", { "dependencies": { "@solana/codecs-core": "2.0.0-rc.1", "@solana/codecs-data-structures": "2.0.0-rc.1", "@solana/codecs-numbers": "2.0.0-rc.1", "@solana/codecs-strings": "2.0.0-rc.1", "@solana/errors": "2.0.0-rc.1" }, "peerDependencies": { "typescript": ">=5" } }, "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA=="],
|
|
1292
|
+
|
|
1202
1293
|
"@solana/web3.js/rpc-websockets/@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
|
|
1203
1294
|
|
|
1204
1295
|
"@solana/web3.js/rpc-websockets/eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="],
|
|
@@ -9,7 +9,6 @@ export declare class grpcAccountSubscriber<T> extends WebSocketAccountSubscriber
|
|
|
9
9
|
private stream;
|
|
10
10
|
private commitmentLevel;
|
|
11
11
|
listenerId?: number;
|
|
12
|
-
private enableReconnect;
|
|
13
12
|
private constructor();
|
|
14
13
|
static create<U>(grpcConfigs: GrpcConfigs, accountName: string, program: Program, accountPublicKey: PublicKey, decodeBuffer?: (buffer: Buffer) => U, resubOpts?: ResubOpts): Promise<grpcAccountSubscriber<U>>;
|
|
15
14
|
subscribe(onChange: (data: T) => void): Promise<void>;
|
|
@@ -29,11 +29,10 @@ const Buffer = __importStar(require("buffer"));
|
|
|
29
29
|
const webSocketAccountSubscriber_1 = require("./webSocketAccountSubscriber");
|
|
30
30
|
const grpc_1 = require("../isomorphic/grpc");
|
|
31
31
|
class grpcAccountSubscriber extends webSocketAccountSubscriber_1.WebSocketAccountSubscriber {
|
|
32
|
-
constructor(client, commitmentLevel, accountName, program, accountPublicKey, decodeBuffer, resubOpts
|
|
32
|
+
constructor(client, commitmentLevel, accountName, program, accountPublicKey, decodeBuffer, resubOpts) {
|
|
33
33
|
super(accountName, program, accountPublicKey, decodeBuffer, resubOpts);
|
|
34
34
|
this.client = client;
|
|
35
35
|
this.commitmentLevel = commitmentLevel;
|
|
36
|
-
this.enableReconnect = enableReconnect;
|
|
37
36
|
}
|
|
38
37
|
static async create(grpcConfigs, accountName, program, accountPublicKey, decodeBuffer, resubOpts) {
|
|
39
38
|
var _a, _b;
|
|
@@ -41,7 +40,7 @@ class grpcAccountSubscriber extends webSocketAccountSubscriber_1.WebSocketAccoun
|
|
|
41
40
|
const commitmentLevel =
|
|
42
41
|
// @ts-ignore :: isomorphic exported enum fails typescript but will work at runtime
|
|
43
42
|
(_b = grpcConfigs.commitmentLevel) !== null && _b !== void 0 ? _b : CommitmentLevel.CONFIRMED;
|
|
44
|
-
return new grpcAccountSubscriber(client, commitmentLevel, accountName, program, accountPublicKey, decodeBuffer, resubOpts
|
|
43
|
+
return new grpcAccountSubscriber(client, commitmentLevel, accountName, program, accountPublicKey, decodeBuffer, resubOpts);
|
|
45
44
|
}
|
|
46
45
|
async subscribe(onChange) {
|
|
47
46
|
if (this.listenerId != null || this.isUnsubscribing) {
|
|
@@ -71,19 +70,6 @@ class grpcAccountSubscriber extends webSocketAccountSubscriber_1.WebSocketAccoun
|
|
|
71
70
|
entry: {},
|
|
72
71
|
transactionsStatus: {},
|
|
73
72
|
};
|
|
74
|
-
if (this.enableReconnect) {
|
|
75
|
-
this.stream.on('error', (error) => {
|
|
76
|
-
// @ts-ignore
|
|
77
|
-
if (error.code === 1) {
|
|
78
|
-
// expected: 1 CANCELLED: Cancelled on client
|
|
79
|
-
console.error('GRPC (grpcAccountSubscriber) Cancelled on client caught:', error);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
console.error('GRPC (grpcAccountSubscriber) unexpected error caught:', error);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
73
|
this.stream.on('data', (chunk) => {
|
|
88
74
|
var _a;
|
|
89
75
|
if (!chunk.account) {
|
|
@@ -160,8 +146,6 @@ class grpcAccountSubscriber extends webSocketAccountSubscriber_1.WebSocketAccoun
|
|
|
160
146
|
reject(err);
|
|
161
147
|
}
|
|
162
148
|
});
|
|
163
|
-
this.stream.cancel();
|
|
164
|
-
this.stream.destroy();
|
|
165
149
|
}).catch((reason) => {
|
|
166
150
|
console.error(reason);
|
|
167
151
|
throw reason;
|
|
@@ -9,7 +9,6 @@ export declare class grpcProgramAccountSubscriber<T> extends WebSocketProgramAcc
|
|
|
9
9
|
private stream;
|
|
10
10
|
private commitmentLevel;
|
|
11
11
|
listenerId?: number;
|
|
12
|
-
private enableReconnect;
|
|
13
12
|
private constructor();
|
|
14
13
|
static create<U>(grpcConfigs: GrpcConfigs, subscriptionName: string, accountDiscriminator: string, program: Program, decodeBufferFn: (accountName: string, ix: Buffer) => U, options?: {
|
|
15
14
|
filters: MemcmpFilter[];
|
|
@@ -35,11 +35,10 @@ const grpc_1 = require("../isomorphic/grpc");
|
|
|
35
35
|
class grpcProgramAccountSubscriber extends webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber {
|
|
36
36
|
constructor(client, commitmentLevel, subscriptionName, accountDiscriminator, program, decodeBufferFn, options = {
|
|
37
37
|
filters: [],
|
|
38
|
-
}, resubOpts
|
|
38
|
+
}, resubOpts) {
|
|
39
39
|
super(subscriptionName, accountDiscriminator, program, decodeBufferFn, options, resubOpts);
|
|
40
40
|
this.client = client;
|
|
41
41
|
this.commitmentLevel = commitmentLevel;
|
|
42
|
-
this.enableReconnect = enableReconnect;
|
|
43
42
|
}
|
|
44
43
|
static async create(grpcConfigs, subscriptionName, accountDiscriminator, program, decodeBufferFn, options = {
|
|
45
44
|
filters: [],
|
|
@@ -49,7 +48,7 @@ class grpcProgramAccountSubscriber extends webSocketProgramAccountSubscriber_1.W
|
|
|
49
48
|
const commitmentLevel =
|
|
50
49
|
// @ts-ignore :: isomorphic exported enum fails typescript but will work at runtime
|
|
51
50
|
(_b = grpcConfigs.commitmentLevel) !== null && _b !== void 0 ? _b : CommitmentLevel.CONFIRMED;
|
|
52
|
-
return new grpcProgramAccountSubscriber(client, commitmentLevel, subscriptionName, accountDiscriminator, program, decodeBufferFn, options, resubOpts
|
|
51
|
+
return new grpcProgramAccountSubscriber(client, commitmentLevel, subscriptionName, accountDiscriminator, program, decodeBufferFn, options, resubOpts);
|
|
53
52
|
}
|
|
54
53
|
async subscribe(onChange) {
|
|
55
54
|
if (this.listenerId != null || this.isUnsubscribing) {
|
|
@@ -84,19 +83,6 @@ class grpcProgramAccountSubscriber extends webSocketProgramAccountSubscriber_1.W
|
|
|
84
83
|
entry: {},
|
|
85
84
|
transactionsStatus: {},
|
|
86
85
|
};
|
|
87
|
-
if (this.enableReconnect) {
|
|
88
|
-
this.stream.on('error', (error) => {
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
if (error.code === 1) {
|
|
91
|
-
// expected: 1 CANCELLED: Cancelled on client
|
|
92
|
-
console.error('GRPC (grpcProgramAccountSubscriber) Cancelled on client caught:', error);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
console.error('GRPC (grpcProgramAccountSubscriber) unexpected error caught:', error);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
86
|
this.stream.on('data', (chunk) => {
|
|
101
87
|
var _a;
|
|
102
88
|
if (!chunk.account) {
|
|
@@ -179,8 +165,6 @@ class grpcProgramAccountSubscriber extends webSocketProgramAccountSubscriber_1.W
|
|
|
179
165
|
reject(err);
|
|
180
166
|
}
|
|
181
167
|
});
|
|
182
|
-
this.stream.cancel();
|
|
183
|
-
this.stream.destroy();
|
|
184
168
|
}).catch((reason) => {
|
|
185
169
|
console.error(reason);
|
|
186
170
|
throw reason;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { DataAndSlot, AccountSubscriber, ResubOpts, BufferAndSlot } from './types';
|
|
4
|
+
import { Program } from '@coral-xyz/anchor';
|
|
5
|
+
import { AccountInfoBase, AccountInfoWithBase58EncodedData, AccountInfoWithBase64EncodedData, type Commitment } from 'gill';
|
|
6
|
+
import { PublicKey } from '@solana/web3.js';
|
|
7
|
+
export declare class WebSocketAccountSubscriberV2<T> implements AccountSubscriber<T> {
|
|
8
|
+
dataAndSlot?: DataAndSlot<T>;
|
|
9
|
+
bufferAndSlot?: BufferAndSlot;
|
|
10
|
+
accountName: string;
|
|
11
|
+
logAccountName: string;
|
|
12
|
+
program: Program;
|
|
13
|
+
accountPublicKey: PublicKey;
|
|
14
|
+
decodeBufferFn: (buffer: Buffer) => T;
|
|
15
|
+
onChange: (data: T) => void;
|
|
16
|
+
listenerId?: number;
|
|
17
|
+
resubOpts?: ResubOpts;
|
|
18
|
+
commitment?: Commitment;
|
|
19
|
+
isUnsubscribing: boolean;
|
|
20
|
+
timeoutId?: ReturnType<typeof setTimeout>;
|
|
21
|
+
receivingData: boolean;
|
|
22
|
+
private rpc;
|
|
23
|
+
private rpcSubscriptions;
|
|
24
|
+
private abortController?;
|
|
25
|
+
constructor(accountName: string, program: Program, accountPublicKey: PublicKey, decodeBuffer?: (buffer: Buffer) => T, resubOpts?: ResubOpts, commitment?: Commitment);
|
|
26
|
+
private handleNotificationLoop;
|
|
27
|
+
subscribe(onChange: (data: T) => void): Promise<void>;
|
|
28
|
+
setData(data: T, slot?: number): void;
|
|
29
|
+
protected setTimeout(): void;
|
|
30
|
+
fetch(): Promise<void>;
|
|
31
|
+
handleRpcResponse(context: {
|
|
32
|
+
slot: bigint;
|
|
33
|
+
}, accountInfo?: AccountInfoBase & (AccountInfoWithBase58EncodedData | AccountInfoWithBase64EncodedData)): void;
|
|
34
|
+
decodeBuffer(buffer: Buffer): T;
|
|
35
|
+
unsubscribe(onResub?: boolean): Promise<void>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WebSocketAccountSubscriberV2 = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const gill_1 = require("gill");
|
|
9
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
10
|
+
class WebSocketAccountSubscriberV2 {
|
|
11
|
+
constructor(accountName, program, accountPublicKey, decodeBuffer, resubOpts, commitment) {
|
|
12
|
+
var _a;
|
|
13
|
+
this.isUnsubscribing = false;
|
|
14
|
+
this.accountName = accountName;
|
|
15
|
+
this.logAccountName = `${accountName}-${accountPublicKey.toBase58()}-ws-acct-subscriber-v2`;
|
|
16
|
+
this.program = program;
|
|
17
|
+
this.accountPublicKey = accountPublicKey;
|
|
18
|
+
this.decodeBufferFn = decodeBuffer;
|
|
19
|
+
this.resubOpts = resubOpts;
|
|
20
|
+
if (((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs) < 1000) {
|
|
21
|
+
console.log(`resubTimeoutMs should be at least 1000ms to avoid spamming resub ${this.logAccountName}`);
|
|
22
|
+
}
|
|
23
|
+
this.receivingData = false;
|
|
24
|
+
if (['recent', 'single', 'singleGossip', 'root', 'max'].includes(this.program.provider.opts.commitment)) {
|
|
25
|
+
console.warn(`using commitment ${this.program.provider.opts.commitment} that is not supported by gill, this may cause issues`);
|
|
26
|
+
}
|
|
27
|
+
this.commitment =
|
|
28
|
+
commitment !== null && commitment !== void 0 ? commitment : this.program.provider.opts.commitment;
|
|
29
|
+
// Initialize gill client using the same RPC URL as the program provider
|
|
30
|
+
const rpcUrl = this.program.provider.connection
|
|
31
|
+
.rpcEndpoint;
|
|
32
|
+
const { rpc, rpcSubscriptions } = (0, gill_1.createSolanaClient)({
|
|
33
|
+
urlOrMoniker: rpcUrl,
|
|
34
|
+
});
|
|
35
|
+
this.rpc = rpc;
|
|
36
|
+
this.rpcSubscriptions = rpcSubscriptions;
|
|
37
|
+
}
|
|
38
|
+
async handleNotificationLoop(subscription) {
|
|
39
|
+
var _a;
|
|
40
|
+
for await (const notification of subscription) {
|
|
41
|
+
if ((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs) {
|
|
42
|
+
this.receivingData = true;
|
|
43
|
+
clearTimeout(this.timeoutId);
|
|
44
|
+
this.handleRpcResponse(notification.context, notification.value);
|
|
45
|
+
this.setTimeout();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.handleRpcResponse(notification.context, notification.value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async subscribe(onChange) {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
if (this.listenerId != null || this.isUnsubscribing) {
|
|
55
|
+
if ((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.logResubMessages) {
|
|
56
|
+
console.log(`[${this.logAccountName}] Subscribe returning early - listenerId=${this.listenerId}, isUnsubscribing=${this.isUnsubscribing}`);
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.onChange = onChange;
|
|
61
|
+
if (!this.dataAndSlot) {
|
|
62
|
+
await this.fetch();
|
|
63
|
+
}
|
|
64
|
+
// Create abort controller for proper cleanup
|
|
65
|
+
const abortController = new AbortController();
|
|
66
|
+
this.abortController = abortController;
|
|
67
|
+
this.listenerId = Math.random(); // Unique ID for logging purposes
|
|
68
|
+
if ((_b = this.resubOpts) === null || _b === void 0 ? void 0 : _b.resubTimeoutMs) {
|
|
69
|
+
this.receivingData = true;
|
|
70
|
+
this.setTimeout();
|
|
71
|
+
}
|
|
72
|
+
// Subscribe to account changes using gill's rpcSubscriptions
|
|
73
|
+
const pubkey = this.accountPublicKey.toBase58();
|
|
74
|
+
if ((0, gill_1.isAddress)(pubkey)) {
|
|
75
|
+
const subscription = await this.rpcSubscriptions
|
|
76
|
+
.accountNotifications(pubkey, {
|
|
77
|
+
commitment: this.commitment,
|
|
78
|
+
encoding: 'base64',
|
|
79
|
+
})
|
|
80
|
+
.subscribe({
|
|
81
|
+
abortSignal: abortController.signal,
|
|
82
|
+
});
|
|
83
|
+
// Start notification loop without awaiting
|
|
84
|
+
this.handleNotificationLoop(subscription);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
setData(data, slot) {
|
|
88
|
+
const newSlot = slot || 0;
|
|
89
|
+
if (this.dataAndSlot && this.dataAndSlot.slot > newSlot) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.dataAndSlot = {
|
|
93
|
+
data,
|
|
94
|
+
slot,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
setTimeout() {
|
|
98
|
+
var _a;
|
|
99
|
+
if (!this.onChange) {
|
|
100
|
+
throw new Error('onChange callback function must be set');
|
|
101
|
+
}
|
|
102
|
+
this.timeoutId = setTimeout(async () => {
|
|
103
|
+
var _a, _b, _c, _d;
|
|
104
|
+
if (this.isUnsubscribing) {
|
|
105
|
+
// If we are in the process of unsubscribing, do not attempt to resubscribe
|
|
106
|
+
if ((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.logResubMessages) {
|
|
107
|
+
console.log(`[${this.logAccountName}] Timeout fired but isUnsubscribing=true, skipping resubscribe`);
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (this.receivingData) {
|
|
112
|
+
if ((_b = this.resubOpts) === null || _b === void 0 ? void 0 : _b.logResubMessages) {
|
|
113
|
+
console.log(`No ws data from ${this.logAccountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing - listenerId=${this.listenerId}, isUnsubscribing=${this.isUnsubscribing}`);
|
|
114
|
+
}
|
|
115
|
+
await this.unsubscribe(true);
|
|
116
|
+
this.receivingData = false;
|
|
117
|
+
await this.subscribe(this.onChange);
|
|
118
|
+
if ((_c = this.resubOpts) === null || _c === void 0 ? void 0 : _c.logResubMessages) {
|
|
119
|
+
console.log(`[${this.logAccountName}] Resubscribe completed - receivingData=${this.receivingData}, listenerId=${this.listenerId}, isUnsubscribing=${this.isUnsubscribing}`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if ((_d = this.resubOpts) === null || _d === void 0 ? void 0 : _d.logResubMessages) {
|
|
124
|
+
console.log(`[${this.logAccountName}] Timeout fired but receivingData=false, skipping resubscribe`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, (_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs);
|
|
128
|
+
}
|
|
129
|
+
async fetch() {
|
|
130
|
+
// Use gill's rpc for fetching account info
|
|
131
|
+
const accountAddress = this.accountPublicKey.toBase58();
|
|
132
|
+
const rpcResponse = await this.rpc
|
|
133
|
+
.getAccountInfo(accountAddress, {
|
|
134
|
+
commitment: this.commitment,
|
|
135
|
+
encoding: 'base64',
|
|
136
|
+
})
|
|
137
|
+
.send();
|
|
138
|
+
// Convert gill response to match the expected format
|
|
139
|
+
const context = {
|
|
140
|
+
slot: Number(rpcResponse.context.slot),
|
|
141
|
+
};
|
|
142
|
+
const accountInfo = rpcResponse.value;
|
|
143
|
+
this.handleRpcResponse({ slot: BigInt(context.slot) }, accountInfo);
|
|
144
|
+
}
|
|
145
|
+
handleRpcResponse(context, accountInfo) {
|
|
146
|
+
const newSlot = context.slot;
|
|
147
|
+
let newBuffer = undefined;
|
|
148
|
+
if (accountInfo) {
|
|
149
|
+
// Extract data from gill response
|
|
150
|
+
if (accountInfo.data) {
|
|
151
|
+
// Handle different data formats from gill
|
|
152
|
+
if (Array.isArray(accountInfo.data)) {
|
|
153
|
+
// If it's a tuple [data, encoding]
|
|
154
|
+
const [data, encoding] = accountInfo.data;
|
|
155
|
+
if (encoding === 'base58') {
|
|
156
|
+
// we know encoding will be base58
|
|
157
|
+
// Convert base58 to buffer using bs58
|
|
158
|
+
newBuffer = Buffer.from(bs58_1.default.decode(data));
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
newBuffer = Buffer.from(data, 'base64');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!this.bufferAndSlot) {
|
|
167
|
+
this.bufferAndSlot = {
|
|
168
|
+
buffer: newBuffer,
|
|
169
|
+
slot: Number(newSlot),
|
|
170
|
+
};
|
|
171
|
+
if (newBuffer) {
|
|
172
|
+
const account = this.decodeBuffer(newBuffer);
|
|
173
|
+
this.dataAndSlot = {
|
|
174
|
+
data: account,
|
|
175
|
+
slot: Number(newSlot),
|
|
176
|
+
};
|
|
177
|
+
this.onChange(account);
|
|
178
|
+
}
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (Number(newSlot) < this.bufferAndSlot.slot) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const oldBuffer = this.bufferAndSlot.buffer;
|
|
185
|
+
if (newBuffer && (!oldBuffer || !newBuffer.equals(oldBuffer))) {
|
|
186
|
+
this.bufferAndSlot = {
|
|
187
|
+
buffer: newBuffer,
|
|
188
|
+
slot: Number(newSlot),
|
|
189
|
+
};
|
|
190
|
+
const account = this.decodeBuffer(newBuffer);
|
|
191
|
+
this.dataAndSlot = {
|
|
192
|
+
data: account,
|
|
193
|
+
slot: Number(newSlot),
|
|
194
|
+
};
|
|
195
|
+
this.onChange(account);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
decodeBuffer(buffer) {
|
|
199
|
+
if (this.decodeBufferFn) {
|
|
200
|
+
return this.decodeBufferFn(buffer);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
return this.program.account[this.accountName].coder.accounts.decode((0, utils_1.capitalize)(this.accountName), buffer);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
unsubscribe(onResub = false) {
|
|
207
|
+
if (!onResub && this.resubOpts) {
|
|
208
|
+
this.resubOpts.resubTimeoutMs = undefined;
|
|
209
|
+
}
|
|
210
|
+
this.isUnsubscribing = true;
|
|
211
|
+
clearTimeout(this.timeoutId);
|
|
212
|
+
this.timeoutId = undefined;
|
|
213
|
+
// Abort the WebSocket subscription
|
|
214
|
+
if (this.abortController) {
|
|
215
|
+
this.abortController.abort('unsubscribing');
|
|
216
|
+
this.abortController = undefined;
|
|
217
|
+
}
|
|
218
|
+
this.listenerId = undefined;
|
|
219
|
+
this.isUnsubscribing = false;
|
|
220
|
+
return Promise.resolve();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
exports.WebSocketAccountSubscriberV2 = WebSocketAccountSubscriberV2;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
2
4
|
import { AccountSubscriber, DataAndSlot, DelistedMarketSetting, DriftClientAccountEvents, DriftClientAccountSubscriber, ResubOpts } from './types';
|
|
3
5
|
import { PerpMarketAccount, SpotMarketAccount, StateAccount } from '../types';
|
|
4
6
|
import { Program } from '@coral-xyz/anchor';
|
|
5
7
|
import StrictEventEmitter from 'strict-event-emitter-types';
|
|
6
8
|
import { EventEmitter } from 'events';
|
|
9
|
+
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
|
|
7
10
|
import { Commitment, PublicKey } from '@solana/web3.js';
|
|
8
11
|
import { OracleInfo, OraclePriceData } from '../oracles/types';
|
|
9
12
|
import { OracleClientCache } from '../oracles/oracleClientCache';
|
|
13
|
+
import { WebSocketAccountSubscriberV2 } from './webSocketAccountSubscriberV2';
|
|
10
14
|
export declare class WebSocketDriftClientAccountSubscriber implements DriftClientAccountSubscriber {
|
|
11
15
|
isSubscribed: boolean;
|
|
12
16
|
program: Program;
|
|
@@ -30,10 +34,11 @@ export declare class WebSocketDriftClientAccountSubscriber implements DriftClien
|
|
|
30
34
|
initialPerpMarketAccountData: Map<number, PerpMarketAccount>;
|
|
31
35
|
initialSpotMarketAccountData: Map<number, SpotMarketAccount>;
|
|
32
36
|
initialOraclePriceData: Map<string, OraclePriceData>;
|
|
37
|
+
customPerpMarketAccountSubscriber?: new (accountName: string, program: Program, accountPublicKey: PublicKey, decodeBuffer?: (buffer: Buffer) => any, resubOpts?: ResubOpts, commitment?: Commitment) => AccountSubscriber<any>;
|
|
33
38
|
protected isSubscribing: boolean;
|
|
34
39
|
protected subscriptionPromise: Promise<boolean>;
|
|
35
40
|
protected subscriptionPromiseResolver: (val: boolean) => void;
|
|
36
|
-
constructor(program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting, resubOpts?: ResubOpts, commitment?: Commitment);
|
|
41
|
+
constructor(program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting, resubOpts?: ResubOpts, commitment?: Commitment, customPerpMarketAccountSubscriber?: new (accountName: string, program: Program, accountPublicKey: PublicKey, decodeBuffer?: (buffer: Buffer) => any, resubOpts?: ResubOpts, commitment?: Commitment) => WebSocketAccountSubscriberV2<any> | WebSocketAccountSubscriber<any>);
|
|
37
42
|
subscribe(): Promise<boolean>;
|
|
38
43
|
chunks: <T>(array: readonly T[], size: number) => T[][];
|
|
39
44
|
setInitialData(): Promise<void>;
|