Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Apr 19, 2024
1 parent b252f4e commit e033f00
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
26 changes: 13 additions & 13 deletions src/adapters/satsConnectAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ abstract class SatsConnectAdapter {
};
}

private async estimateRpfOrder(
params: Params<'runes_estimateRpfOrder'>
): Promise<RpcResult<'runes_estimateRpfOrder'>> {
const rpfOrderRequest: Omit<Params<'runes_estimateRpfOrder'>, 'network'> = {
private async estimateRbfOrder(
params: Params<'runes_estimateRbfOrder'>
): Promise<RpcResult<'runes_estimateRbfOrder'>> {
const rbfOrderRequest: Omit<Params<'runes_estimateRbfOrder'>, 'network'> = {
newFeeRate: params.newFeeRate,
orderId: params.orderId,
};
const response = await getRunesApiClient(params.network).rpfOrder(rpfOrderRequest);
const response = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
if (response.data) {
return {
status: 'success',
Expand All @@ -248,13 +248,13 @@ abstract class SatsConnectAdapter {
};
}

private async rpfOrder(params: Params<'runes_rpfOrder'>): Promise<RpcResult<'runes_rpfOrder'>> {
private async rbfOrder(params: Params<'runes_rbfOrder'>): Promise<RpcResult<'runes_rbfOrder'>> {
try {
const rpfOrderRequest: Omit<Params<'runes_rpfOrder'>, 'network'> = {
const rbfOrderRequest: Omit<Params<'runes_rbfOrder'>, 'network'> = {
newFeeRate: params.newFeeRate,
orderId: params.orderId,
};
const orderResponse = await getRunesApiClient(params.network).rpfOrder(rpfOrderRequest);
const orderResponse = await getRunesApiClient(params.network).rbfOrder(rbfOrderRequest);
if (!orderResponse.data) {
return {
status: 'error',
Expand Down Expand Up @@ -288,7 +288,7 @@ abstract class SatsConnectAdapter {
status: 'success',
result: {
fundingAddress: orderResponse.data.fundingAddress,
orderId: rpfOrderRequest.orderId,
orderId: rbfOrderRequest.orderId,
fundRBFTransactionId: paymentResponse.result.txid,
},
};
Expand Down Expand Up @@ -323,13 +323,13 @@ abstract class SatsConnectAdapter {
case 'runes_getOrder': {
return this.getOrder(params as Params<'runes_getOrder'>) as Promise<RpcResult<Method>>;
}
case 'runes_estimateRpfOrder': {
return this.estimateRpfOrder(params as Params<'runes_estimateRpfOrder'>) as Promise<
case 'runes_estimateRbfOrder': {
return this.estimateRbfOrder(params as Params<'runes_estimateRbfOrder'>) as Promise<
RpcResult<Method>
>;
}
case 'runes_rpfOrder': {
return this.rpfOrder(params as Params<'runes_rpfOrder'>) as Promise<RpcResult<Method>>;
case 'runes_rbfOrder': {
return this.rbfOrder(params as Params<'runes_rbfOrder'>) as Promise<RpcResult<Method>>;
}
default:
return this.requestInternal(method, params);
Expand Down
8 changes: 4 additions & 4 deletions src/request/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
SignPsbt,
} from './btcMethods';
import {
EstimateRpfOrder,
EstimateRbfOrder,
EstimateRunesEtch,
EstimateRunesMint,
EtchRunes,
GetOrder,
MintRunes,
RpfOrder,
RbfOrder,
} from './runesMethods';
import {
StxCallContract,
Expand Down Expand Up @@ -56,8 +56,8 @@ export interface RunesRequests {
runes_estimateEtch: EstimateRunesEtch;
runes_etch: EtchRunes;
runes_getOrder: GetOrder;
runes_estimateRpfOrder: EstimateRpfOrder;
runes_rpfOrder: RpfOrder;
runes_estimateRbfOrder: EstimateRbfOrder;
runes_rbfOrder: RbfOrder;
}

export type RunesRequestMethod = keyof RunesRequests;
Expand Down
14 changes: 7 additions & 7 deletions src/request/types/runesMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
EstimateOrderResponse,
GetOrderRequest,
GetOrderResponse,
RPFOrderRequest,
RPFOrderResponse,
RBFOrderRequest,
RBFOrderResponse,
} from '../../runes/types';
import { BitcoinNetworkType, MethodParamsAndResult } from '../../types';

Expand Down Expand Up @@ -63,20 +63,20 @@ interface GetOrderParams extends GetOrderRequest {

export type GetOrder = MethodParamsAndResult<GetOrderParams, GetOrderResponse>;

interface EstimateRpfOrderParams extends RPFOrderRequest {
interface EstimateRbfOrderParams extends RBFOrderRequest {
network?: BitcoinNetworkType;
}

export type EstimateRpfOrder = MethodParamsAndResult<EstimateRpfOrderParams, RPFOrderResponse>;
export type EstimateRbfOrder = MethodParamsAndResult<EstimateRbfOrderParams, RBFOrderResponse>;

interface RpfOrderParams extends RPFOrderRequest {
interface RbfOrderParams extends RBFOrderRequest {
network?: BitcoinNetworkType;
}

interface RpfOrderResult {
interface RbfOrderResult {
orderId: string;
fundRBFTransactionId: string;
fundingAddress: string;
}

export type RpfOrder = MethodParamsAndResult<RpfOrderParams, RpfOrderResult>;
export type RbfOrder = MethodParamsAndResult<RbfOrderParams, RbfOrderResult>;
10 changes: 5 additions & 5 deletions src/runes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
EstimateMintOrderRequest,
EstimateOrderResponse,
GetOrderResponse,
RPFOrderRequest,
RPFOrderResponse,
RBFOrderRequest,
RBFOrderResponse,
} from './types';
import { BitcoinNetworkType } from '../types';

Expand Down Expand Up @@ -142,10 +142,10 @@ export class RunesApi {
}
};

rpfOrder = async (rpfRequest: RPFOrderRequest) => {
const { orderId, newFeeRate } = rpfRequest;
rbfOrder = async (rbfRequest: RBFOrderRequest) => {
const { orderId, newFeeRate } = rbfRequest;
try {
const response = await this.client.post<RPFOrderResponse>(`/orders/${orderId}/rbf-estimate`, {
const response = await this.client.post<RBFOrderResponse>(`/orders/${orderId}/rbf-estimate`, {
newFeeRate,
});
return {
Expand Down
4 changes: 2 additions & 2 deletions src/runes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ export type GetOrderResponse = {
createdAt: string;
};

export type RPFOrderRequest = {
export type RBFOrderRequest = {
orderId: string;
newFeeRate: number;
};

export type RPFOrderResponse = {
export type RBFOrderResponse = {
rbfCost: number;
fundingAddress: string;
};

0 comments on commit e033f00

Please sign in to comment.