File tree Expand file tree Collapse file tree
modules/sdk-core/src/bitgo/trading/network Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export class TradingNetwork implements ITradingNetwork {
109109
110110 /**
111111 * Prepare an allocation for submission
112- * @param {string } walletPassphrase ofc wallet passphrase
112+ * @param {string } walletPassphrase ofc wallet passphrase - required only when signing via user key
113113 * @param {string } connectionId connection to whom to make the allocation or deallocation
114114 * @param {string= } clientExternalId one time generated uuid v4
115115 * @param {string } currency currency for which the allocation should be made. e.g. btc / tbtc
@@ -130,10 +130,7 @@ export class TradingNetwork implements ITradingNetwork {
130130 }
131131
132132 const payload = JSON . stringify ( body ) ;
133-
134- const prv = await this . wallet . getPrv ( { walletPassphrase } ) ;
135- const signedBuffer : Buffer = await this . wallet . baseCoin . signMessage ( { prv } , payload ) ;
136- const signature = signedBuffer . toString ( 'hex' ) ;
133+ const signature = await this . wallet . toTradingAccount ( ) . signPayload ( { payload, walletPassphrase } ) ;
137134
138135 return {
139136 ...body ,
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export type GetNetworkAllocationByIdResponse = {
125125} ;
126126
127127export type PrepareNetworkAllocationParams = Omit < CreateNetworkAllocationParams , 'payload' | 'signature' > & {
128- walletPassphrase : string ;
128+ walletPassphrase ? : string ;
129129 clientExternalId ?: string ;
130130 nonce ?: string ;
131131} ;
You can’t perform that action at this time.
0 commit comments