@drift-labs/sdk 2.31.0-beta.6 → 2.31.0-beta.7

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.
@@ -114,6 +114,16 @@ exports.DevnetPerpMarkets = [
114
114
  launchTs: 1683125906000,
115
115
  oracleSource: __1.OracleSource.PYTH_1M,
116
116
  },
117
+ {
118
+ fullName: 'OP',
119
+ category: ['L2', 'Infra'],
120
+ symbol: 'OP-PERP',
121
+ baseAssetSymbol: 'OP',
122
+ marketIndex: 11,
123
+ oracle: new web3_js_1.PublicKey('8ctSiDhA7eJoii4TkKV8Rx4KFdz3ycsA1FXy9wq56quG'),
124
+ launchTs: 1683125906000,
125
+ oracleSource: __1.OracleSource.PYTH,
126
+ },
117
127
  ];
118
128
  exports.MainnetPerpMarkets = [
119
129
  {
@@ -226,6 +236,16 @@ exports.MainnetPerpMarkets = [
226
236
  launchTs: 1683125906000,
227
237
  oracleSource: __1.OracleSource.PYTH_1M,
228
238
  },
239
+ {
240
+ fullName: 'OP',
241
+ category: ['L2', 'Infra'],
242
+ symbol: 'OP-PERP',
243
+ baseAssetSymbol: 'OP',
244
+ marketIndex: 11,
245
+ oracle: new web3_js_1.PublicKey('4o4CUwzFwLqCvmA5x1G4VzoZkAhAcbiuiYyjWX1CVbY2'),
246
+ launchTs: 1683125906000,
247
+ oracleSource: __1.OracleSource.PYTH,
248
+ },
229
249
  ];
230
250
  exports.PerpMarkets = {
231
251
  devnet: exports.DevnetPerpMarkets,
@@ -3040,7 +3040,7 @@ class DriftClient {
3040
3040
  return this.txSender.send(tx, additionalSigners, opts, preSigned);
3041
3041
  }
3042
3042
  else {
3043
- return this.txSender.sendVersionedTransaction(tx, additionalSigners, opts);
3043
+ return this.txSender.sendVersionedTransaction(tx, additionalSigners, opts, preSigned);
3044
3044
  }
3045
3045
  }
3046
3046
  async buildTransaction(instructions, txParams, txVersion, lookupTables) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.0-beta.6",
2
+ "version": "2.31.0-beta.7",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -14,7 +14,7 @@ export declare class RetryTxSender implements TxSender {
14
14
  send(tx: Transaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
15
15
  prepareTx(tx: Transaction, additionalSigners: Array<Signer>, opts: ConfirmOptions): Promise<Transaction>;
16
16
  getVersionedTransaction(ixs: TransactionInstruction[], lookupTableAccounts: AddressLookupTableAccount[], additionalSigners?: Array<Signer>, opts?: ConfirmOptions): Promise<VersionedTransaction>;
17
- sendVersionedTransaction(tx: VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions): Promise<TxSigAndSlot>;
17
+ sendVersionedTransaction(tx: VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
18
18
  sendRawTransaction(rawTransaction: Buffer | Uint8Array, opts: ConfirmOptions): Promise<TxSigAndSlot>;
19
19
  confirmTransaction(signature: TransactionSignature, commitment?: Commitment): Promise<RpcResponseAndContext<SignatureResult>>;
20
20
  getTimestamp(): number;
@@ -54,10 +54,13 @@ class RetryTxSender {
54
54
  const tx = new web3_js_1.VersionedTransaction(message);
55
55
  return tx;
56
56
  }
57
- async sendVersionedTransaction(tx, additionalSigners, opts) {
57
+ async sendVersionedTransaction(tx, additionalSigners, opts, preSigned) {
58
58
  let signedTx;
59
- // @ts-ignore
60
- if (this.provider.wallet.payer) {
59
+ if (preSigned) {
60
+ signedTx = tx;
61
+ // @ts-ignore
62
+ }
63
+ else if (this.provider.wallet.payer) {
61
64
  // @ts-ignore
62
65
  tx.sign((additionalSigners !== null && additionalSigners !== void 0 ? additionalSigners : []).concat(this.provider.wallet.payer));
63
66
  signedTx = tx;
package/lib/tx/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export type TxSigAndSlot = {
8
8
  export interface TxSender {
9
9
  provider: Provider;
10
10
  send(tx: Transaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
11
- sendVersionedTransaction(tx: VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions): Promise<TxSigAndSlot>;
11
+ sendVersionedTransaction(tx: VersionedTransaction, additionalSigners?: Array<Signer>, opts?: ConfirmOptions, preSigned?: boolean): Promise<TxSigAndSlot>;
12
12
  getVersionedTransaction(ixs: TransactionInstruction[], lookupTableAccounts: AddressLookupTableAccount[], additionalSigners?: Array<Signer>, opts?: ConfirmOptions): Promise<VersionedTransaction>;
13
13
  sendRawTransaction(rawTransaction: Buffer | Uint8Array, opts: ConfirmOptions): Promise<TxSigAndSlot>;
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.31.0-beta.6",
3
+ "version": "2.31.0-beta.7",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -124,6 +124,16 @@ export const DevnetPerpMarkets: PerpMarketConfig[] = [
124
124
  launchTs: 1683125906000,
125
125
  oracleSource: OracleSource.PYTH_1M,
126
126
  },
127
+ {
128
+ fullName: 'OP',
129
+ category: ['L2', 'Infra'],
130
+ symbol: 'OP-PERP',
131
+ baseAssetSymbol: 'OP',
132
+ marketIndex: 11,
133
+ oracle: new PublicKey('8ctSiDhA7eJoii4TkKV8Rx4KFdz3ycsA1FXy9wq56quG'),
134
+ launchTs: 1683125906000,
135
+ oracleSource: OracleSource.PYTH,
136
+ },
127
137
  ];
128
138
 
129
139
  export const MainnetPerpMarkets: PerpMarketConfig[] = [
@@ -237,6 +247,16 @@ export const MainnetPerpMarkets: PerpMarketConfig[] = [
237
247
  launchTs: 1683125906000,
238
248
  oracleSource: OracleSource.PYTH_1M,
239
249
  },
250
+ {
251
+ fullName: 'OP',
252
+ category: ['L2', 'Infra'],
253
+ symbol: 'OP-PERP',
254
+ baseAssetSymbol: 'OP',
255
+ marketIndex: 11,
256
+ oracle: new PublicKey('4o4CUwzFwLqCvmA5x1G4VzoZkAhAcbiuiYyjWX1CVbY2'),
257
+ launchTs: 1683125906000,
258
+ oracleSource: OracleSource.PYTH,
259
+ },
240
260
  ];
241
261
 
242
262
  export const PerpMarkets: { [key in DriftEnv]: PerpMarketConfig[] } = {
@@ -5347,7 +5347,8 @@ export class DriftClient {
5347
5347
  return this.txSender.sendVersionedTransaction(
5348
5348
  tx as VersionedTransaction,
5349
5349
  additionalSigners,
5350
- opts
5350
+ opts,
5351
+ preSigned
5351
5352
  );
5352
5353
  }
5353
5354
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.0-beta.6",
2
+ "version": "2.31.0-beta.7",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
@@ -117,11 +117,14 @@ export class RetryTxSender implements TxSender {
117
117
  async sendVersionedTransaction(
118
118
  tx: VersionedTransaction,
119
119
  additionalSigners?: Array<Signer>,
120
- opts?: ConfirmOptions
120
+ opts?: ConfirmOptions,
121
+ preSigned?: boolean
121
122
  ): Promise<TxSigAndSlot> {
122
123
  let signedTx;
123
- // @ts-ignore
124
- if (this.provider.wallet.payer) {
124
+ if (preSigned) {
125
+ signedTx = tx;
126
+ // @ts-ignore
127
+ } else if (this.provider.wallet.payer) {
125
128
  // @ts-ignore
126
129
  tx.sign((additionalSigners ?? []).concat(this.provider.wallet.payer));
127
130
  signedTx = tx;
package/src/tx/types.ts CHANGED
@@ -27,7 +27,8 @@ export interface TxSender {
27
27
  sendVersionedTransaction(
28
28
  tx: VersionedTransaction,
29
29
  additionalSigners?: Array<Signer>,
30
- opts?: ConfirmOptions
30
+ opts?: ConfirmOptions,
31
+ preSigned?: boolean
31
32
  ): Promise<TxSigAndSlot>;
32
33
 
33
34
  getVersionedTransaction(