@drift-labs/sdk-browser 2.155.0-beta.2 → 2.155.0-beta.3
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/lib/browser/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/laserProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
- package/lib/browser/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
- package/lib/browser/driftClient.d.ts +1 -2
- package/lib/browser/driftClient.js +5 -6
- package/lib/browser/oracles/pythPullClient.d.ts +2 -2
- package/lib/browser/oracles/pythPullClient.js +5 -2
- package/lib/browser/pyth/constants.d.ts +3 -0
- package/lib/browser/pyth/constants.js +6 -0
- package/lib/browser/pyth/index.d.ts +3 -0
- package/lib/browser/pyth/index.js +10 -0
- package/lib/browser/pyth/types.d.ts +2226 -0
- package/lib/browser/pyth/types.js +2224 -0
- package/lib/browser/pyth/utils.d.ts +2 -0
- package/lib/browser/pyth/utils.js +10 -0
- package/lib/node/accounts/grpcAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcMultiAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/grpcProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/laserProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/laserProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketDriftClientAccountSubscriber.d.ts.map +1 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts +0 -1
- package/lib/node/accounts/webSocketProgramAccountSubscriber.d.ts.map +1 -1
- package/lib/node/driftClient.d.ts +1 -2
- package/lib/node/driftClient.d.ts.map +1 -1
- package/lib/node/driftClient.js +5 -6
- package/lib/node/oracles/pythPullClient.d.ts +2 -2
- package/lib/node/oracles/pythPullClient.d.ts.map +1 -1
- package/lib/node/oracles/pythPullClient.js +5 -2
- package/lib/node/pyth/constants.d.ts +4 -0
- package/lib/node/pyth/constants.d.ts.map +1 -0
- package/lib/node/pyth/constants.js +6 -0
- package/lib/node/pyth/index.d.ts +4 -0
- package/lib/node/pyth/index.d.ts.map +1 -0
- package/lib/node/pyth/index.js +10 -0
- package/lib/node/pyth/types.d.ts +2227 -0
- package/lib/node/pyth/types.d.ts.map +1 -0
- package/lib/node/pyth/types.js +2224 -0
- package/lib/node/pyth/utils.d.ts +3 -0
- package/lib/node/pyth/utils.d.ts.map +1 -0
- package/lib/node/pyth/utils.js +10 -0
- package/package.json +3 -4
- package/src/driftClient.ts +9 -11
- package/src/oracles/pythPullClient.ts +4 -5
- package/src/pyth/constants.ts +9 -0
- package/src/pyth/index.ts +11 -0
- package/src/pyth/types.ts +4453 -0
- package/src/pyth/utils.ts +13 -0
- package/tests/decode/test.ts +2 -1
- package/tests/dlob/helpers.ts +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
|
|
3
|
+
export const getGuardianSetPda = (
|
|
4
|
+
guardianSetIndex: number,
|
|
5
|
+
wormholeProgramId: PublicKey
|
|
6
|
+
) => {
|
|
7
|
+
const guardianSetIndexBuf = Buffer.alloc(4);
|
|
8
|
+
guardianSetIndexBuf.writeUInt32BE(guardianSetIndex, 0);
|
|
9
|
+
return PublicKey.findProgramAddressSync(
|
|
10
|
+
[Buffer.from('GuardianSet'), guardianSetIndexBuf],
|
|
11
|
+
wormholeProgramId
|
|
12
|
+
)[0];
|
|
13
|
+
};
|
package/tests/decode/test.ts
CHANGED
|
@@ -187,10 +187,11 @@ function testPerpPosition(anchor: PerpPosition, custom: PerpPosition) {
|
|
|
187
187
|
assert(anchor.openAsks.eq(custom.openAsks));
|
|
188
188
|
assert(anchor.settledPnl.eq(custom.settledPnl));
|
|
189
189
|
assert(anchor.lpShares.eq(custom.lpShares));
|
|
190
|
-
assert(anchor.lastBaseAssetAmountPerLp.eq(custom.lastBaseAssetAmountPerLp));
|
|
191
190
|
assert(anchor.lastQuoteAssetAmountPerLp.eq(custom.lastQuoteAssetAmountPerLp));
|
|
192
191
|
assert(anchor.openOrders === custom.openOrders);
|
|
193
192
|
assert(anchor.perLpBase === custom.perLpBase);
|
|
193
|
+
assert(anchor.isolatedPositionScaledBalance.eq(custom.isolatedPositionScaledBalance));
|
|
194
|
+
assert(anchor.positionFlag === custom.positionFlag);
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
function* getOrders(orders: Order[]) {
|
package/tests/dlob/helpers.ts
CHANGED