@drift-labs/sdk-browser 2.107.0-beta.2 → 2.107.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 CHANGED
@@ -1 +1 @@
1
- 2.107.0-beta.2
1
+ 2.107.0-beta.3
@@ -91,11 +91,12 @@ class SwiftOrderSubscriber {
91
91
  });
92
92
  }
93
93
  async getPlaceAndMakeSwiftOrderIxs(orderMessageRaw, swiftOrderParamsMessage, makerOrderParams) {
94
+ const swiftOrderParamsBuf = Buffer.from(orderMessageRaw['order_message'], 'hex');
94
95
  const takerAuthority = new web3_js_1.PublicKey(orderMessageRaw['taker_authority']);
95
96
  const takerUserPubkey = await (0, __1.getUserAccountPublicKey)(this.driftClient.program.programId, takerAuthority, swiftOrderParamsMessage.subAccountId);
96
97
  const takerUserAccount = (await this.userMap.mustGet(takerUserPubkey.toString())).getUserAccount();
97
98
  const ixs = await this.driftClient.getPlaceAndMakeSwiftPerpOrderIxs({
98
- orderParams: orderMessageRaw['order_message'],
99
+ orderParams: swiftOrderParamsBuf,
99
100
  signature: Buffer.from(orderMessageRaw['order_signature'], 'base64'),
100
101
  }, (0, tweetnacl_util_1.decodeUTF8)(orderMessageRaw['uuid']), {
101
102
  taker: takerUserPubkey,
@@ -91,11 +91,12 @@ class SwiftOrderSubscriber {
91
91
  });
92
92
  }
93
93
  async getPlaceAndMakeSwiftOrderIxs(orderMessageRaw, swiftOrderParamsMessage, makerOrderParams) {
94
+ const swiftOrderParamsBuf = Buffer.from(orderMessageRaw['order_message'], 'hex');
94
95
  const takerAuthority = new web3_js_1.PublicKey(orderMessageRaw['taker_authority']);
95
96
  const takerUserPubkey = await (0, __1.getUserAccountPublicKey)(this.driftClient.program.programId, takerAuthority, swiftOrderParamsMessage.subAccountId);
96
97
  const takerUserAccount = (await this.userMap.mustGet(takerUserPubkey.toString())).getUserAccount();
97
98
  const ixs = await this.driftClient.getPlaceAndMakeSwiftPerpOrderIxs({
98
- orderParams: orderMessageRaw['order_message'],
99
+ orderParams: swiftOrderParamsBuf,
99
100
  signature: Buffer.from(orderMessageRaw['order_signature'], 'base64'),
100
101
  }, (0, tweetnacl_util_1.decodeUTF8)(orderMessageRaw['uuid']), {
101
102
  taker: takerUserPubkey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk-browser",
3
- "version": "2.107.0-beta.2",
3
+ "version": "2.107.0-beta.3",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -153,6 +153,10 @@ export class SwiftOrderSubscriber {
153
153
  swiftOrderParamsMessage: SwiftOrderParamsMessage,
154
154
  makerOrderParams: OptionalOrderParams
155
155
  ): Promise<TransactionInstruction[]> {
156
+ const swiftOrderParamsBuf = Buffer.from(
157
+ orderMessageRaw['order_message'],
158
+ 'hex'
159
+ );
156
160
  const takerAuthority = new PublicKey(orderMessageRaw['taker_authority']);
157
161
  const takerUserPubkey = await getUserAccountPublicKey(
158
162
  this.driftClient.program.programId,
@@ -164,7 +168,7 @@ export class SwiftOrderSubscriber {
164
168
  ).getUserAccount();
165
169
  const ixs = await this.driftClient.getPlaceAndMakeSwiftPerpOrderIxs(
166
170
  {
167
- orderParams: orderMessageRaw['order_message'],
171
+ orderParams: swiftOrderParamsBuf,
168
172
  signature: Buffer.from(orderMessageRaw['order_signature'], 'base64'),
169
173
  },
170
174
  decodeUTF8(orderMessageRaw['uuid']),