@@ -32,14 +32,7 @@ import { createBitcoinPsbt, getAddressInfo } from '../wallet';
3232import { SYMBOL_LOOKUP , ADDRESS_LOOKUP , getTokenDecimals } from './tokens' ;
3333import { AddressType , Network } from 'bitcoin-address-validation' ;
3434import { EsploraClient } from '../esplora' ;
35- import {
36- claimDelayAbi ,
37- offrampBumpFeeCaller ,
38- offrampCreateOrderCaller ,
39- offrampGetOrderCaller ,
40- offrampUnlockFundsCaller ,
41- strategyCaller ,
42- } from './abi' ;
35+ import { claimDelayAbi , offrampCaller , strategyCaller } from './abi' ;
4336import { isAddress , Address , isAddressEqual , createPublicClient , http , PublicClient } from 'viem' ;
4437import * as bitcoin from 'bitcoinjs-lib' ;
4538import { bob , bobSepolia } from 'viem/chains' ;
@@ -85,7 +78,7 @@ export class GatewayApiClient {
8578 * @constructor
8679 * @param chainName The chain name.
8780 */
88- constructor ( chainName : string , options ?: { rpcUrl ?: string } ) {
81+ constructor ( chainName : 'mainnet' | 'testnet' | 'signet' | 'bob' , options ?: { rpcUrl ?: string } ) {
8982 switch ( chainName ) {
9083 case 'mainnet' :
9184 case Chain . BOB :
@@ -345,7 +338,7 @@ export class GatewayApiClient {
345338
346339 return {
347340 quote : offrampQuote ,
348- offrampABI : offrampCreateOrderCaller ,
341+ offrampABI : offrampCaller [ 'createOrder' ] ,
349342 offrampFunctionName : 'createOrder' as const ,
350343 offrampArgs : [
351344 {
@@ -393,7 +386,7 @@ export class GatewayApiClient {
393386 const offrampRegistryAddress : Address = await this . fetchOfframpRegistryAddress ( ) ;
394387
395388 return {
396- offrampABI : offrampBumpFeeCaller ,
389+ offrampABI : offrampCaller [ 'bumpFeeOfExistingOrder' ] ,
397390 offrampRegistryAddress : offrampRegistryAddress ,
398391 offrampFunctionName : 'bumpFeeOfExistingOrder' as const ,
399392 offrampArgs : [ orderId , newFeeSat ] ,
@@ -426,7 +419,7 @@ export class GatewayApiClient {
426419 }
427420
428421 return {
429- offrampABI : offrampUnlockFundsCaller ,
422+ offrampABI : offrampCaller [ 'unlockFunds' ] ,
430423 offrampRegistryAddress : offrampRegistryAddress ,
431424 offrampFunctionName : 'unlockFunds' ,
432425 offrampArgs : [ orderId , receiver ] ,
@@ -531,7 +524,7 @@ export class GatewayApiClient {
531524
532525 const order = await publicClient . readContract ( {
533526 address : offrampRegistryAddress ,
534- abi : offrampGetOrderCaller ,
527+ abi : [ offrampCaller [ 'getOfframpOrder' ] ] ,
535528 functionName : 'getOfframpOrder' ,
536529 args : [ orderId ] ,
537530 } ) ;
0 commit comments