55 BroadcastTxAsyncResponse ,
66 BroadcastTxSyncResponse ,
77} from '@cosmjs/tendermint-rpc/build/tendermint37' ;
8- import { GetAuthenticatorsResponse } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/accountplus/query' ;
98import {
109 Order_ConditionType ,
1110 Order_TimeInForce ,
@@ -18,7 +17,6 @@ import { bigIntToBytes } from '../lib/helpers';
1817import { isStatefulOrder , verifyOrderFlags } from '../lib/validation' ;
1918import { GovAddNewMarketParams , OrderFlags } from '../types' ;
2019import {
21- AuthenticatorType ,
2220 Network ,
2321 OrderExecution ,
2422 OrderSide ,
@@ -68,11 +66,6 @@ export interface OrderBatchWithMarketId {
6866 clientIds : number [ ] ;
6967}
7068
71- export interface PermissionedKeysAccountAuth {
72- authenticators : Long [ ] ;
73- accountForOrder : SubaccountInfo ;
74- }
75-
7669export class CompositeClient {
7770 public readonly network : Network ;
7871 public gasDenom : SelectedGasDenom = SelectedGasDenom . USDC ;
@@ -158,7 +151,6 @@ export class CompositeClient {
158151 memo ?: string ,
159152 broadcastMode ?: BroadcastMode ,
160153 account ?: ( ) => Promise < Account > ,
161- authenticators ?: Long [ ] ,
162154 ) : Promise < BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx > {
163155 return this . validatorClient . post . send (
164156 wallet ,
@@ -168,8 +160,6 @@ export class CompositeClient {
168160 memo ,
169161 broadcastMode ,
170162 account ,
171- undefined ,
172- authenticators ,
173163 ) ;
174164 }
175165
@@ -307,15 +297,10 @@ export class CompositeClient {
307297 timeInForce : Order_TimeInForce ,
308298 reduceOnly : boolean ,
309299 memo ?: string ,
310- permissionedKeysAccountAuth ?: PermissionedKeysAccountAuth ,
311300 ) : Promise < BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx > {
312- // For permissioned orders, use the permissioning account details instead of the subaccount
313- // This allows placing orders on behalf of another account when using permissioned keys
314- const accountForOrder = permissionedKeysAccountAuth ? permissionedKeysAccountAuth . accountForOrder : subaccount ;
315301 const msgs : Promise < EncodeObject [ ] > = new Promise ( ( resolve , reject ) => {
316-
317302 const msg = this . placeShortTermOrderMessage (
318- accountForOrder ,
303+ subaccount ,
319304 marketId ,
320305 side ,
321306 price ,
@@ -326,16 +311,14 @@ export class CompositeClient {
326311 reduceOnly ,
327312 ) ;
328313 msg
329- . then ( ( it ) => {
330- resolve ( [ it ] ) ;
331- } )
314+ . then ( ( it ) => resolve ( [ it ] ) )
332315 . catch ( ( err ) => {
333316 console . log ( err ) ;
334317 reject ( err ) ;
335318 } ) ;
336319 } ) ;
337320 const account : Promise < Account > = this . validatorClient . post . account (
338- accountForOrder . address ,
321+ subaccount . address ,
339322 undefined ,
340323 ) ;
341324 return this . send (
@@ -346,7 +329,6 @@ export class CompositeClient {
346329 memo ,
347330 undefined ,
348331 ( ) => account ,
349- permissionedKeysAccountAuth ?. authenticators ,
350332 ) ;
351333 }
352334
@@ -1235,23 +1217,4 @@ export class CompositeClient {
12351217 ) : Promise < BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx > {
12361218 return this . validatorClient . post . createMarketPermissionless ( ticker , subaccount , broadcastMode , gasAdjustment , memo ) ;
12371219 }
1238-
1239- async addAuthenticator (
1240- subaccount : SubaccountInfo ,
1241- authenticatorType : AuthenticatorType ,
1242- data : Uint8Array ,
1243- ) : Promise < BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx > {
1244- return this . validatorClient . post . addAuthenticator ( subaccount , authenticatorType , data )
1245- }
1246-
1247- async removeAuthenticator (
1248- subaccount : SubaccountInfo ,
1249- id : Long ,
1250- ) : Promise < BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx > {
1251- return this . validatorClient . post . removeAuthenticator ( subaccount , id )
1252- }
1253-
1254- async getAuthenticators ( address : string ) : Promise < GetAuthenticatorsResponse > {
1255- return this . validatorClient . get . getAuthenticators ( address ) ;
1256- }
12571220}
0 commit comments