@gobob/bob-sdk
Advanced tools
Comparing version 2.3.3 to 2.3.4
@@ -191,13 +191,12 @@ "use strict"; | ||
const hasEnoughConfirmations = confirmations >= order.txProofDifficultyFactor; | ||
const data = { | ||
confirmations, | ||
confirmed: hasEnoughConfirmations | ||
}; | ||
return order.status | ||
? order.strategyAddress | ||
? order.outputTokenAddress | ||
? { status: types_1.OrderStatusType.Success, data } | ||
: { status: types_1.OrderStatusType.Failed, data } | ||
: { status: types_1.OrderStatusType.Success, data } | ||
: { status: types_1.OrderStatusType.Pending, data }; | ||
const data = { confirmations }; | ||
return !hasEnoughConfirmations | ||
? { confirmed: false, data } | ||
: order.status | ||
? order.strategyAddress | ||
? order.outputTokenAddress | ||
? { success: true, data } | ||
: { success: false, data } | ||
: { success: true, data } | ||
: { pending: true, data }; | ||
}, | ||
@@ -204,0 +203,0 @@ }; |
export { GatewayApiClient as GatewaySDK } from "./client"; | ||
export { GatewayQuoteParams, GatewayQuote, GatewayOrder, GatewayStrategyContract, OrderStatusType, OrderStatus, } from "./types"; | ||
export { GatewayQuoteParams, GatewayQuote, GatewayOrder, GatewayStrategyContract, OrderStatus, } from "./types"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OrderStatusType = exports.GatewaySDK = void 0; | ||
exports.GatewaySDK = void 0; | ||
var client_1 = require("./client"); | ||
Object.defineProperty(exports, "GatewaySDK", { enumerable: true, get: function () { return client_1.GatewayApiClient; } }); | ||
var types_1 = require("./types"); | ||
Object.defineProperty(exports, "OrderStatusType", { enumerable: true, get: function () { return types_1.OrderStatusType; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -98,21 +98,2 @@ import type { EsploraClient } from "../esplora"; | ||
}; | ||
export type OrderStatusData = { | ||
confirmations: number; | ||
confirmed: boolean; | ||
}; | ||
export declare enum OrderStatusType { | ||
Success = "Success", | ||
Failed = "Failed", | ||
Pending = "Pending" | ||
} | ||
export type OrderStatus = { | ||
status: OrderStatusType.Success; | ||
data: OrderStatusData; | ||
} | { | ||
status: OrderStatusType.Failed; | ||
data: OrderStatusData; | ||
} | { | ||
status: OrderStatusType.Pending; | ||
data: OrderStatusData; | ||
}; | ||
export interface GatewayOrderResponse { | ||
@@ -134,2 +115,25 @@ gatewayAddress: EvmAddress; | ||
txHash?: string; | ||
} | ||
export type OrderStatusData = { | ||
confirmations: number; | ||
}; | ||
export type OrderStatus = { | ||
confirmed: false; | ||
pending?: never; | ||
success?: never; | ||
data: OrderStatusData; | ||
} | { | ||
confirmed?: never; | ||
pending: true; | ||
success?: never; | ||
data: OrderStatusData; | ||
} | { | ||
confirmed?: never; | ||
pending?: never; | ||
success: boolean; | ||
data: OrderStatusData; | ||
}; | ||
export type GatewayOrder = Omit<GatewayOrderResponse & { | ||
gasRefill: number; | ||
}, "satsToConvertToEth"> & { | ||
getTokenAddress(): string | undefined; | ||
@@ -140,6 +144,3 @@ getToken(): Token | undefined; | ||
getStatus(esploraClient: EsploraClient, latestHeight?: number): Promise<OrderStatus>; | ||
} | ||
export type GatewayOrder = Omit<GatewayOrderResponse & { | ||
gasRefill: number; | ||
}, "satsToConvertToEth">; | ||
}; | ||
export type GatewayTokensInfo = { | ||
@@ -146,0 +147,0 @@ baseToken: Token; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OrderStatusType = exports.ChainId = exports.Chain = void 0; | ||
exports.ChainId = exports.Chain = void 0; | ||
var Chain; | ||
@@ -15,9 +15,4 @@ (function (Chain) { | ||
})(ChainId || (exports.ChainId = ChainId = {})); | ||
var OrderStatusType; | ||
(function (OrderStatusType) { | ||
OrderStatusType["Success"] = "Success"; | ||
OrderStatusType["Failed"] = "Failed"; | ||
OrderStatusType["Pending"] = "Pending"; | ||
})(OrderStatusType || (exports.OrderStatusType = OrderStatusType = {})); | ||
; | ||
; | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@gobob/bob-sdk", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"main": "dist/index.js", | ||
@@ -23,3 +23,3 @@ "types": "dist/index.d.ts", | ||
"devDependencies": { | ||
"@types/node": "^22.5.2", | ||
"@types/node": "^22.5.5", | ||
"@types/yargs": "^17.0.33", | ||
@@ -26,0 +26,0 @@ "ecpair": "^2.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
144560
2244