Skip to content

Commit

Permalink
fix: increase registerAffiliate gas adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
rosepuppy committed Oct 24, 2024
1 parent 70b0f52 commit d657341
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions v4-client-js/src/clients/modules/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,9 @@ export class Post {
subaccount: SubaccountInfo,
affiliate: string,
broadcastMode?: BroadcastMode,
gasAdjustment?: number,
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
const msg = this.registerAffiliateMsg(subaccount.address, affiliate);
const gasAdjustment = 1.8;
return this.send(
subaccount.wallet,
() => Promise.resolve([msg]),
Expand All @@ -910,21 +910,29 @@ export class Post {
undefined,
broadcastMode,
undefined,
gasAdjustment,
gasAdjustment ?? 2,
);
}

registerAffiliateMsg(...args: Parameters<Composer['composeMsgRegisterAffiliate']>): EncodeObject {
return this.composer.composeMsgRegisterAffiliate(...args);
}

launchMarketMsg(...args: Parameters<Composer['composeMsgCreateMarketPermissionless']>): EncodeObject {
launchMarketMsg(
...args: Parameters<Composer['composeMsgCreateMarketPermissionless']>
): EncodeObject {
return this.composer.composeMsgCreateMarketPermissionless(...args);
}

async createMarketPermissionless(ticker: string, subaccount: SubaccountInfo, broadcastMode?: BroadcastMode, gasAdjustment?: number, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
async createMarketPermissionless(
ticker: string,
subaccount: SubaccountInfo,
broadcastMode?: BroadcastMode,
gasAdjustment?: number,
memo?: string,
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
const msg = this.launchMarketMsg(subaccount.address, ticker, subaccount.subaccountNumber);

return this.send(
subaccount.wallet,
() => Promise.resolve([msg]),
Expand Down

0 comments on commit d657341

Please sign in to comment.