@gobob/bob-sdk 4.3.15 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gateway/abi.d.ts +11 -54
- package/dist/gateway/abi.js +14 -34
- package/dist/gateway/abi.js.map +1 -1
- package/dist/gateway/client.d.ts +5 -5
- package/dist/gateway/client.js +69 -79
- package/dist/gateway/client.js.map +1 -1
- package/dist/gateway/layerzero.d.ts +1 -0
- package/dist/gateway/layerzero.js +3 -3
- package/dist/gateway/layerzero.js.map +1 -1
- package/dist/gateway/tokens.js +19 -35
- package/dist/gateway/tokens.js.map +1 -1
- package/dist/gateway/types/offramp.d.ts +21 -18
- package/dist/gateway/types/quote.d.ts +3 -1
- package/dist/gateway/utils/common.d.ts +3 -2
- package/dist/gateway/utils/common.js +17 -8
- package/dist/gateway/utils/common.js.map +1 -1
- package/package.json +5 -4
- package/dist/assets/token-list.json +0 -582
- package/dist/scripts/verify-tokenlist.d.ts +0 -2
- package/dist/scripts/verify-tokenlist.js +0 -232
- package/dist/scripts/verify-tokenlist.js.map +0 -1
package/dist/gateway/abi.d.ts
CHANGED
|
@@ -26,9 +26,9 @@ export declare const strategyCaller: readonly [{
|
|
|
26
26
|
readonly outputs: readonly [];
|
|
27
27
|
readonly stateMutability: "nonpayable";
|
|
28
28
|
}];
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const offrampCallerV2: readonly [{
|
|
30
30
|
readonly type: "function";
|
|
31
|
-
readonly name: "
|
|
31
|
+
readonly name: "createOrderV2";
|
|
32
32
|
readonly inputs: readonly [{
|
|
33
33
|
readonly name: "offrampOrderArgs";
|
|
34
34
|
readonly type: "tuple";
|
|
@@ -38,9 +38,17 @@ export declare const offrampCaller: readonly [{
|
|
|
38
38
|
readonly type: "uint256";
|
|
39
39
|
readonly internalType: "uint256";
|
|
40
40
|
}, {
|
|
41
|
-
readonly name: "
|
|
41
|
+
readonly name: "satSolverFeeMax";
|
|
42
42
|
readonly type: "uint256";
|
|
43
43
|
readonly internalType: "uint256";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "satAffiliateFee";
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
readonly internalType: "uint256";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "affiliateFeeRecipient";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
readonly internalType: "address";
|
|
44
52
|
}, {
|
|
45
53
|
readonly name: "creationDeadline";
|
|
46
54
|
readonly type: "uint256";
|
|
@@ -89,57 +97,6 @@ export declare const offrampCaller: readonly [{
|
|
|
89
97
|
}];
|
|
90
98
|
readonly outputs: readonly [];
|
|
91
99
|
readonly stateMutability: "nonpayable";
|
|
92
|
-
}, {
|
|
93
|
-
readonly type: "function";
|
|
94
|
-
readonly name: "getOrderDetails";
|
|
95
|
-
readonly inputs: readonly [{
|
|
96
|
-
readonly name: "orderId";
|
|
97
|
-
readonly type: "uint256";
|
|
98
|
-
readonly internalType: "uint256";
|
|
99
|
-
}];
|
|
100
|
-
readonly outputs: readonly [{
|
|
101
|
-
readonly name: "";
|
|
102
|
-
readonly type: "tuple";
|
|
103
|
-
readonly internalType: "struct OfframpOrderDetails";
|
|
104
|
-
readonly components: readonly [{
|
|
105
|
-
readonly name: "satAmountLocked";
|
|
106
|
-
readonly type: "uint256";
|
|
107
|
-
readonly internalType: "uint256";
|
|
108
|
-
}, {
|
|
109
|
-
readonly name: "satFeesMax";
|
|
110
|
-
readonly type: "uint256";
|
|
111
|
-
readonly internalType: "uint256";
|
|
112
|
-
}, {
|
|
113
|
-
readonly name: "owner";
|
|
114
|
-
readonly type: "address";
|
|
115
|
-
readonly internalType: "address";
|
|
116
|
-
}, {
|
|
117
|
-
readonly name: "outputScript";
|
|
118
|
-
readonly type: "bytes";
|
|
119
|
-
readonly internalType: "bytes";
|
|
120
|
-
}, {
|
|
121
|
-
readonly name: "status";
|
|
122
|
-
readonly type: "uint8";
|
|
123
|
-
readonly internalType: "enum OfframpOrderStatus";
|
|
124
|
-
}, {
|
|
125
|
-
readonly name: "timestamp";
|
|
126
|
-
readonly type: "uint256";
|
|
127
|
-
readonly internalType: "uint256";
|
|
128
|
-
}, {
|
|
129
|
-
readonly name: "token";
|
|
130
|
-
readonly type: "address";
|
|
131
|
-
readonly internalType: "address";
|
|
132
|
-
}, {
|
|
133
|
-
readonly name: "solverOwner";
|
|
134
|
-
readonly type: "address";
|
|
135
|
-
readonly internalType: "address";
|
|
136
|
-
}, {
|
|
137
|
-
readonly name: "solverRecipient";
|
|
138
|
-
readonly type: "address";
|
|
139
|
-
readonly internalType: "address";
|
|
140
|
-
}];
|
|
141
|
-
}];
|
|
142
|
-
readonly stateMutability: "view";
|
|
143
100
|
}];
|
|
144
101
|
export declare const compoundV2CTokenAbi: readonly [{
|
|
145
102
|
readonly name: "exchangeRateCurrent";
|
package/dist/gateway/abi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.quoterV2Abi = exports.layerZeroOftAbi = exports.claimDelayAbi = exports.aaveV2AtokenAbi = exports.compoundV2CTokenAbi = exports.
|
|
3
|
+
exports.quoterV2Abi = exports.layerZeroOftAbi = exports.claimDelayAbi = exports.aaveV2AtokenAbi = exports.compoundV2CTokenAbi = exports.offrampCallerV2 = exports.strategyCaller = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
5
|
exports.strategyCaller = [
|
|
6
6
|
{
|
|
@@ -39,10 +39,10 @@ exports.strategyCaller = [
|
|
|
39
39
|
stateMutability: 'nonpayable',
|
|
40
40
|
},
|
|
41
41
|
];
|
|
42
|
-
exports.
|
|
42
|
+
exports.offrampCallerV2 = [
|
|
43
43
|
{
|
|
44
44
|
type: 'function',
|
|
45
|
-
name: '
|
|
45
|
+
name: 'createOrderV2',
|
|
46
46
|
inputs: [
|
|
47
47
|
{
|
|
48
48
|
name: 'offrampOrderArgs',
|
|
@@ -55,10 +55,20 @@ exports.offrampCaller = [
|
|
|
55
55
|
internalType: 'uint256',
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
name: '
|
|
58
|
+
name: 'satSolverFeeMax',
|
|
59
59
|
type: 'uint256',
|
|
60
60
|
internalType: 'uint256',
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
name: 'satAffiliateFee',
|
|
64
|
+
type: 'uint256',
|
|
65
|
+
internalType: 'uint256',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'affiliateFeeRecipient',
|
|
69
|
+
type: 'address',
|
|
70
|
+
internalType: 'address',
|
|
71
|
+
},
|
|
62
72
|
{
|
|
63
73
|
name: 'creationDeadline',
|
|
64
74
|
type: 'uint256',
|
|
@@ -121,36 +131,6 @@ exports.offrampCaller = [
|
|
|
121
131
|
outputs: [],
|
|
122
132
|
stateMutability: 'nonpayable',
|
|
123
133
|
},
|
|
124
|
-
{
|
|
125
|
-
type: 'function',
|
|
126
|
-
name: 'getOrderDetails',
|
|
127
|
-
inputs: [
|
|
128
|
-
{
|
|
129
|
-
name: 'orderId',
|
|
130
|
-
type: 'uint256',
|
|
131
|
-
internalType: 'uint256',
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
outputs: [
|
|
135
|
-
{
|
|
136
|
-
name: '',
|
|
137
|
-
type: 'tuple',
|
|
138
|
-
internalType: 'struct OfframpOrderDetails',
|
|
139
|
-
components: [
|
|
140
|
-
{ name: 'satAmountLocked', type: 'uint256', internalType: 'uint256' },
|
|
141
|
-
{ name: 'satFeesMax', type: 'uint256', internalType: 'uint256' },
|
|
142
|
-
{ name: 'owner', type: 'address', internalType: 'address' },
|
|
143
|
-
{ name: 'outputScript', type: 'bytes', internalType: 'bytes' },
|
|
144
|
-
{ name: 'status', type: 'uint8', internalType: 'enum OfframpOrderStatus' },
|
|
145
|
-
{ name: 'timestamp', type: 'uint256', internalType: 'uint256' },
|
|
146
|
-
{ name: 'token', type: 'address', internalType: 'address' },
|
|
147
|
-
{ name: 'solverOwner', type: 'address', internalType: 'address' },
|
|
148
|
-
{ name: 'solverRecipient', type: 'address', internalType: 'address' },
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
stateMutability: 'view',
|
|
153
|
-
},
|
|
154
134
|
];
|
|
155
135
|
exports.compoundV2CTokenAbi = (0, viem_1.parseAbi)([
|
|
156
136
|
'function exchangeRateCurrent() external returns (uint256)',
|
package/dist/gateway/abi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../../src/gateway/abi.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEnB,QAAA,cAAc,GAAG;IAC1B;QACI,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,sCAAsC;QAC5C,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,iBAAiB;aAClC;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;aAC1B;YACD;gBACI,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,SAAS;aAC1B;YACD;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;gBACb,YAAY,EAAE,6BAA6B;gBAC3C,UAAU,EAAE;oBACR;wBACI,IAAI,EAAE,cAAc;wBACpB,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,SAAS;qBAC1B;iBACJ;aACJ;SACJ;QACD,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;KAChC;CACK,CAAC;AAEE,QAAA,
|
|
1
|
+
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../../src/gateway/abi.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEnB,QAAA,cAAc,GAAG;IAC1B;QACI,IAAI,EAAE,UAAU;QAChB,IAA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E,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;oBAC/D,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE;oBACvD,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;iBAC1E;aACJ;SACJ;QACD,OAAO,EAAE;YACL,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YAC9D,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;YACvE,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE;YAC3E,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE;SACpE;QACD,eAAe,EAAE,YAAY;KAChC;CACK,CAAC"}
|
package/dist/gateway/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Account, Address, Hash, PublicClient, Transport, Chain as ViemChain, WalletClient } from 'viem';
|
|
2
2
|
import { BaseClient } from './base-client';
|
|
3
|
-
import { BitcoinSigner, BumpFeeParams, EnrichedToken, ExecuteQuoteParams, GatewayOrder, GatewayStartOrder, GatewayStrategyContract, GatewayTokensInfo, GetQuoteParams, OfframpCreateOrderParams, OfframpLiquidity, OfframpOrder, OfframpOrderStatus, OfframpQuote, OnrampOrder, OnrampQuote, StrategyParams, Token, UnlockOrderParams } from './types';
|
|
3
|
+
import { BitcoinSigner, BumpFeeParams, EnrichedToken, ExecuteQuoteParams, GatewayOrder, GatewayStartOrder, GatewayStrategyContract, GatewayTokensInfo, GetQuoteParams, OfframpCreateOrderParams, OfframpLiquidity, OfframpOrder, OfframpOrderStatus, OfframpQuote, OfframpRawOrder, OnrampOrder, OnrampQuote, StrategyParams, Token, UnlockOrderParams } from './types';
|
|
4
4
|
export declare const MAINNET_GATEWAY_BASE_URL = "https://gateway-api-mainnet.gobob.xyz";
|
|
5
5
|
export declare const SIGNET_GATEWAY_BASE_URL = "https://gateway-api-signet.gobob.xyz";
|
|
6
6
|
export declare const ORDER_DEADLINE_IN_SECONDS: number;
|
|
@@ -20,18 +20,18 @@ export declare class GatewayApiClient extends BaseClient {
|
|
|
20
20
|
});
|
|
21
21
|
private get baseUrl();
|
|
22
22
|
private get chainId();
|
|
23
|
+
mapRawOrderToOfframpOrder(order: OfframpRawOrder): Promise<OfframpOrder>;
|
|
23
24
|
getQuote(params: GetQuoteParams): Promise<ExecuteQuoteParams>;
|
|
24
25
|
getOfframpCreateOrderGasCost(params: GetQuoteParams, offrampQuote: OfframpQuote): Promise<bigint>;
|
|
25
26
|
getOnrampQuote(params: GetQuoteParams): Promise<OnrampQuote & GatewayTokensInfo>;
|
|
26
27
|
getOfframpQuote(params: GetQuoteParams): Promise<OfframpQuote>;
|
|
27
28
|
fetchOfframpRegistryAddress(): Promise<Address>;
|
|
28
29
|
fetchOfframpLiquidity(token: string): Promise<OfframpLiquidity>;
|
|
29
|
-
fetchOfframpQuote(token: Address, amountInToken: bigint, userAddress: Address, toUserAddress?: string): Promise<OfframpQuote>;
|
|
30
|
+
fetchOfframpQuote(token: Address, amountInToken: bigint, userAddress: Address, toUserAddress?: string, affiliateFeeRecipient?: Address, affiliateFeeSats?: bigint): Promise<OfframpQuote>;
|
|
30
31
|
createOfframpOrder(quote: OfframpQuote, params: GetQuoteParams): Promise<OfframpCreateOrderParams>;
|
|
31
|
-
bumpFeeForOfframpOrder({ orderId, walletClient, publicClient, }: BumpFeeParams & EvmWalletClientParams): Promise<Hash>;
|
|
32
|
-
unlockOfframpOrder({ orderId, receiver, walletClient, publicClient, }: UnlockOrderParams & EvmWalletClientParams): Promise<Hash>;
|
|
32
|
+
bumpFeeForOfframpOrder({ orderId, offrampRegistryAddress, walletClient, publicClient, }: BumpFeeParams & EvmWalletClientParams): Promise<Hash>;
|
|
33
|
+
unlockOfframpOrder({ orderId, receiver, offrampRegistryAddress, walletClient, publicClient, }: UnlockOrderParams & EvmWalletClientParams): Promise<Hash>;
|
|
33
34
|
getOfframpOrders(userAddress: Address): Promise<OfframpOrder[]>;
|
|
34
|
-
private getBumpFeeRequirement;
|
|
35
35
|
canOrderBeUnlocked(status: OfframpOrderStatus, orderTimestamp: number, offrampRegistryAddress: Address): Promise<boolean>;
|
|
36
36
|
private fetchOfframpOrder;
|
|
37
37
|
startOnrampOrder(gatewayQuote: OnrampQuote, params: GetQuoteParams): Promise<GatewayStartOrder>;
|
package/dist/gateway/client.js
CHANGED
|
@@ -79,6 +79,30 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
79
79
|
get chainId() {
|
|
80
80
|
return this.chain.id;
|
|
81
81
|
}
|
|
82
|
+
async mapRawOrderToOfframpOrder(order) {
|
|
83
|
+
const status = order.status;
|
|
84
|
+
const offrampRegistryAddress = order.offrampRegistryAddress;
|
|
85
|
+
const canOrderBeUnlocked = await this.canOrderBeUnlocked(status, Number(order.orderTimestamp), offrampRegistryAddress);
|
|
86
|
+
return {
|
|
87
|
+
orderId: (0, utils_2.safeBigInt)(order.orderId),
|
|
88
|
+
token: order.token,
|
|
89
|
+
satAmountLocked: (0, utils_2.safeBigInt)(order.satAmountLocked),
|
|
90
|
+
satSolverFeeMax: (0, utils_2.safeBigInt)(order.satFeesMax),
|
|
91
|
+
status,
|
|
92
|
+
orderTimestamp: (0, utils_2.safeNumber)(order.orderTimestamp),
|
|
93
|
+
submitOrderEvmTx: order.submitOrderEvmTx,
|
|
94
|
+
refundedEvmTx: order.refundedEvmTx,
|
|
95
|
+
btcTx: order.btcTx,
|
|
96
|
+
shouldFeesBeBumped: order.shouldFeesBeBumped,
|
|
97
|
+
canOrderBeUnlocked,
|
|
98
|
+
offrampRegistryAddress,
|
|
99
|
+
satAffiliateFee: (0, utils_2.safeBigInt)(order.satAffiliateFee),
|
|
100
|
+
affiliateFeeRecipient: order.affiliateFeeRecipient,
|
|
101
|
+
offrampRegistryVersion: (0, utils_2.safeNumber)(order.offrampRegistryVersion),
|
|
102
|
+
bumpFeeAmountInSats: order.bumpFeeAmountInSats !== null ? (0, utils_2.safeBigInt)(order.bumpFeeAmountInSats) : null,
|
|
103
|
+
userAddress: order.userAddress,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
82
106
|
async getQuote(params) {
|
|
83
107
|
if (params.fromChain?.toString().toLowerCase() === 'bitcoin') {
|
|
84
108
|
const data = await this.getOnrampQuote(params);
|
|
@@ -182,8 +206,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
182
206
|
(isTestnet && this.chain.id !== chains_1.bobSepolia.id)) {
|
|
183
207
|
throw new Error('Invalid output chain');
|
|
184
208
|
}
|
|
185
|
-
const
|
|
186
|
-
const outputTokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, toToken);
|
|
209
|
+
const outputTokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, params.toToken);
|
|
187
210
|
const strategyAddress = params.strategyAddress?.startsWith('0x') ? params.strategyAddress : undefined;
|
|
188
211
|
const url = new URL(`${this.baseUrl}/v4/quote/${outputTokenAddress}`);
|
|
189
212
|
url.searchParams.append('userAddress', `${params.toUserAddress}`);
|
|
@@ -195,6 +218,10 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
195
218
|
url.searchParams.append('ethAmountToReceive', `${params.gasRefill}`);
|
|
196
219
|
if (params.message)
|
|
197
220
|
url.searchParams.append('strategyExtraData', `${params.message}`);
|
|
221
|
+
if (params.affiliateFeeRecipient && params.affiliateFeeSats) {
|
|
222
|
+
url.searchParams.append('affiliateFee', params.affiliateFeeSats.toString());
|
|
223
|
+
url.searchParams.append('affiliateFeeRecipient', params.affiliateFeeRecipient.toString());
|
|
224
|
+
}
|
|
198
225
|
const response = await this.safeFetch(url, {
|
|
199
226
|
headers: {
|
|
200
227
|
'Content-Type': 'application/json',
|
|
@@ -229,8 +256,8 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
229
256
|
if (!params.fromToken) {
|
|
230
257
|
throw new Error('`fromToken` must be specified for offramp');
|
|
231
258
|
}
|
|
232
|
-
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, params.fromToken
|
|
233
|
-
const quote = await this.fetchOfframpQuote(tokenAddress, BigInt(params.amount || 0), params.fromUserAddress, params.toUserAddress);
|
|
259
|
+
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, params.fromToken);
|
|
260
|
+
const quote = await this.fetchOfframpQuote(tokenAddress, BigInt(params.amount || 0), params.fromUserAddress, params.toUserAddress, params.affiliateFeeRecipient, params.affiliateFeeSats);
|
|
234
261
|
return quote;
|
|
235
262
|
}
|
|
236
263
|
async fetchOfframpRegistryAddress() {
|
|
@@ -244,7 +271,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
244
271
|
return response.text();
|
|
245
272
|
}
|
|
246
273
|
async fetchOfframpLiquidity(token) {
|
|
247
|
-
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, token
|
|
274
|
+
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, token);
|
|
248
275
|
const response = await this.safeFetch(`${this.baseUrl}/offramp-liquidity/${tokenAddress}`, undefined, 'Failed to get offramp liquidity');
|
|
249
276
|
if (!response.ok) {
|
|
250
277
|
const errorData = await response.json().catch(() => null);
|
|
@@ -258,7 +285,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
258
285
|
totalOfframpLiquidity: BigInt(rawLiquidity.totalOfframpLiquidity),
|
|
259
286
|
};
|
|
260
287
|
}
|
|
261
|
-
async fetchOfframpQuote(token, amountInToken, userAddress, toUserAddress) {
|
|
288
|
+
async fetchOfframpQuote(token, amountInToken, userAddress, toUserAddress, affiliateFeeRecipient, affiliateFeeSats) {
|
|
262
289
|
const queryParams = new URLSearchParams({
|
|
263
290
|
amountInWrappedToken: amountInToken.toString(),
|
|
264
291
|
token,
|
|
@@ -267,6 +294,10 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
267
294
|
if (toUserAddress) {
|
|
268
295
|
queryParams.append('userBtcAddress', toUserAddress);
|
|
269
296
|
}
|
|
297
|
+
if (affiliateFeeRecipient && affiliateFeeSats) {
|
|
298
|
+
queryParams.append('affiliateFee', affiliateFeeSats.toString());
|
|
299
|
+
queryParams.append('affiliateFeeRecipient', affiliateFeeRecipient.toString());
|
|
300
|
+
}
|
|
270
301
|
const response = await this.safeFetch(`${this.baseUrl}/offramp-quote?${queryParams}`, undefined, 'Failed to get offramp quote');
|
|
271
302
|
if (!response.ok) {
|
|
272
303
|
const errorData = await response.json().catch(() => null);
|
|
@@ -277,9 +308,9 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
277
308
|
const rawQuote = await response.json();
|
|
278
309
|
const currentUnixTimeInSec = Math.floor(Date.now() / 1000);
|
|
279
310
|
const deadline = currentUnixTimeInSec + exports.ORDER_DEADLINE_IN_SECONDS;
|
|
311
|
+
const normalizedAffiliateFeeRecipient = affiliateFeeRecipient ?? viem_1.zeroAddress;
|
|
280
312
|
return {
|
|
281
313
|
amountLockInSat: rawQuote.amountLockInSat,
|
|
282
|
-
registryAddress: rawQuote.registryAddress,
|
|
283
314
|
deadline: deadline,
|
|
284
315
|
token: token,
|
|
285
316
|
feeBreakdown: {
|
|
@@ -290,6 +321,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
290
321
|
fastestFeeRate: rawQuote.feeBreakdown.fastestFeeRate,
|
|
291
322
|
},
|
|
292
323
|
amountReceiveInSat: rawQuote.amountLockInSat - rawQuote.feeBreakdown.overallFeeSats,
|
|
324
|
+
affiliateFeeRecipient: normalizedAffiliateFeeRecipient,
|
|
293
325
|
};
|
|
294
326
|
}
|
|
295
327
|
async createOfframpOrder(quote, params) {
|
|
@@ -303,13 +335,15 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
303
335
|
const receiverAddress = (0, utils_2.toHexScriptPubKey)(params.toUserAddress, bitcoinNetwork);
|
|
304
336
|
return {
|
|
305
337
|
quote,
|
|
306
|
-
offrampABI: abi_1.
|
|
338
|
+
offrampABI: abi_1.offrampCallerV2,
|
|
307
339
|
feeBreakdown: quote.feeBreakdown,
|
|
308
|
-
offrampFunctionName: '
|
|
340
|
+
offrampFunctionName: 'createOrderV2',
|
|
309
341
|
offrampArgs: [
|
|
310
342
|
{
|
|
311
343
|
satAmountToLock: BigInt(quote.amountLockInSat),
|
|
312
|
-
|
|
344
|
+
satSolverFeeMax: BigInt(quote.feeBreakdown.overallFeeSats),
|
|
345
|
+
satAffiliateFee: BigInt(quote.feeBreakdown.affiliateFeeSats),
|
|
346
|
+
affiliateFeeRecipient: quote.affiliateFeeRecipient,
|
|
313
347
|
creationDeadline: BigInt(quote.deadline),
|
|
314
348
|
outputScript: receiverAddress,
|
|
315
349
|
token: quote.token,
|
|
@@ -318,42 +352,36 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
318
352
|
],
|
|
319
353
|
};
|
|
320
354
|
}
|
|
321
|
-
async bumpFeeForOfframpOrder({ orderId, walletClient, publicClient, }) {
|
|
322
|
-
const orderDetails = await this.fetchOfframpOrder(orderId);
|
|
355
|
+
async bumpFeeForOfframpOrder({ orderId, offrampRegistryAddress, walletClient, publicClient, }) {
|
|
356
|
+
const orderDetails = await this.fetchOfframpOrder(orderId, offrampRegistryAddress);
|
|
323
357
|
if (orderDetails.status !== 'Active') {
|
|
324
358
|
throw new Error(`Offramp order needs to be Active for bumping fees`);
|
|
325
359
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
throw new Error(`Unable to calculate a new quote for the order. reason: (${error.toString()}).`);
|
|
329
|
-
}
|
|
330
|
-
if (!shouldFeesBeBumped) {
|
|
331
|
-
throw new Error(`Current fees (${orderDetails.satFeesMax.toString()} sat) are sufficient to satisfy the order, as the new required fees (${newFeeSat.toString()} sat) are lower or equal.`);
|
|
360
|
+
if (orderDetails.bumpFeeAmountInSats === null) {
|
|
361
|
+
throw new Error(`No need to bump fees, the current fees are sufficient`);
|
|
332
362
|
}
|
|
333
|
-
const offrampRegistryAddress = await this.fetchOfframpRegistryAddress();
|
|
334
363
|
const { request } = await publicClient.simulateContract({
|
|
335
364
|
address: offrampRegistryAddress,
|
|
336
|
-
abi: abi_1.
|
|
365
|
+
abi: abi_1.offrampCallerV2,
|
|
337
366
|
functionName: 'bumpFeeOfExistingOrder',
|
|
338
|
-
args: [orderId, BigInt(
|
|
367
|
+
args: [orderId, BigInt(orderDetails.bumpFeeAmountInSats)],
|
|
339
368
|
account: walletClient.account,
|
|
340
369
|
});
|
|
341
370
|
const transactionHash = await walletClient.writeContract(request);
|
|
342
371
|
await publicClient.waitForTransactionReceipt({ hash: transactionHash });
|
|
343
372
|
return transactionHash;
|
|
344
373
|
}
|
|
345
|
-
async unlockOfframpOrder({ orderId, receiver, walletClient, publicClient, }) {
|
|
346
|
-
const orderDetails = await this.fetchOfframpOrder(orderId);
|
|
374
|
+
async unlockOfframpOrder({ orderId, receiver, offrampRegistryAddress, walletClient, publicClient, }) {
|
|
375
|
+
const orderDetails = await this.fetchOfframpOrder(orderId, offrampRegistryAddress);
|
|
347
376
|
if (orderDetails.status == 'Processed' || orderDetails.status == 'Refunded') {
|
|
348
377
|
throw new Error(`Offramp order already processed / refunded`);
|
|
349
378
|
}
|
|
350
|
-
const offrampRegistryAddress = await this.fetchOfframpRegistryAddress();
|
|
351
379
|
if (!(await this.canOrderBeUnlocked(orderDetails.status, orderDetails.orderTimestamp, offrampRegistryAddress))) {
|
|
352
380
|
throw new Error(`Offramp order is still within the 7-day claim delay and cannot be unlocked yet.`);
|
|
353
381
|
}
|
|
354
382
|
const { request } = await publicClient.simulateContract({
|
|
355
383
|
address: offrampRegistryAddress,
|
|
356
|
-
abi: abi_1.
|
|
384
|
+
abi: abi_1.offrampCallerV2,
|
|
357
385
|
functionName: 'refundOrder',
|
|
358
386
|
args: [orderId, receiver],
|
|
359
387
|
account: walletClient.account,
|
|
@@ -365,38 +393,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
365
393
|
async getOfframpOrders(userAddress) {
|
|
366
394
|
const response = await this.safeFetch(`${this.baseUrl}/offramp-orders/${userAddress}`, undefined, 'Failed to fetch offramp orders');
|
|
367
395
|
const rawOrders = await response.json();
|
|
368
|
-
|
|
369
|
-
return Promise.all(rawOrders.map(async (order) => {
|
|
370
|
-
const status = order.status;
|
|
371
|
-
const canOrderBeUnlocked = await this.canOrderBeUnlocked(status, Number(order.orderTimestamp), offrampRegistryAddress);
|
|
372
|
-
return {
|
|
373
|
-
...order,
|
|
374
|
-
status,
|
|
375
|
-
token: order.token,
|
|
376
|
-
orderId: BigInt(order.orderId.toString()),
|
|
377
|
-
satAmountLocked: BigInt(order.satAmountLocked.toString()),
|
|
378
|
-
satFeesMax: BigInt(order.satFeesMax.toString()),
|
|
379
|
-
orderTimestamp: Number(order.orderTimestamp),
|
|
380
|
-
shouldFeesBeBumped: order.shouldFeesBeBumped,
|
|
381
|
-
canOrderBeUnlocked,
|
|
382
|
-
offrampRegistryAddress,
|
|
383
|
-
};
|
|
384
|
-
}));
|
|
385
|
-
}
|
|
386
|
-
async getBumpFeeRequirement(token, satAmountLocked, satFeesMax, userAddress) {
|
|
387
|
-
const decimals = tokens_1.ADDRESS_LOOKUP[this.chainId][token.toLowerCase()]?.decimals;
|
|
388
|
-
if (decimals === undefined) {
|
|
389
|
-
throw new Error('Tokens with less than 8 decimals are not supported');
|
|
390
|
-
}
|
|
391
|
-
const amountInToken = satAmountLocked * BigInt(10 ** (decimals - 8));
|
|
392
|
-
try {
|
|
393
|
-
const offrampQuote = await this.fetchOfframpQuote(token, amountInToken, userAddress);
|
|
394
|
-
const shouldBump = satFeesMax < offrampQuote.feeBreakdown.overallFeeSats;
|
|
395
|
-
return [shouldBump, BigInt(offrampQuote.feeBreakdown.overallFeeSats)];
|
|
396
|
-
}
|
|
397
|
-
catch (err) {
|
|
398
|
-
throw new Error(`Error fetching offramp quote: ${err.message || err}`);
|
|
399
|
-
}
|
|
396
|
+
return Promise.all(rawOrders.map((order) => this.mapRawOrderToOfframpOrder(order)));
|
|
400
397
|
}
|
|
401
398
|
async canOrderBeUnlocked(status, orderTimestamp, offrampRegistryAddress) {
|
|
402
399
|
if (status === 'Active' && Math.floor(Date.now() / 1000) - orderTimestamp >= 60) {
|
|
@@ -414,27 +411,20 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
414
411
|
});
|
|
415
412
|
return orderTimestamp + Number(claimDelay) <= nowInSec;
|
|
416
413
|
}
|
|
417
|
-
async fetchOfframpOrder(orderId) {
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
address: offrampRegistryAddress,
|
|
422
|
-
abi: abi_1.offrampCaller,
|
|
423
|
-
functionName: 'getOrderDetails',
|
|
424
|
-
args: [orderId],
|
|
414
|
+
async fetchOfframpOrder(orderId, registryAddress) {
|
|
415
|
+
const queryParams = new URLSearchParams({
|
|
416
|
+
registryAddress: registryAddress.toString(),
|
|
417
|
+
orderId: orderId.toString(),
|
|
425
418
|
});
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
status: (0, utils_2.parseOrderStatus)(Number(order.status)),
|
|
436
|
-
orderTimestamp: Number(order.timestamp),
|
|
437
|
-
};
|
|
419
|
+
const response = await this.safeFetch(`${this.baseUrl}/offramp-order?${queryParams}`, undefined, 'Failed to fetch offramp order');
|
|
420
|
+
if (!response.ok) {
|
|
421
|
+
const errorData = await response.json().catch(() => null);
|
|
422
|
+
const apiMessage = errorData?.message;
|
|
423
|
+
const errorMessage = apiMessage || `Failed to get offramp order (status: ${response.status} ${response.statusText})`;
|
|
424
|
+
throw new Error(`${errorMessage}`);
|
|
425
|
+
}
|
|
426
|
+
const offrampRawOrder = await response.json();
|
|
427
|
+
return await this.mapRawOrderToOfframpOrder(offrampRawOrder);
|
|
438
428
|
}
|
|
439
429
|
async startOnrampOrder(gatewayQuote, params) {
|
|
440
430
|
if (!params.toUserAddress || !(0, viem_1.isAddress)(params.toUserAddress)) {
|
|
@@ -515,7 +505,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
515
505
|
}
|
|
516
506
|
else if (quote.type === 'offramp') {
|
|
517
507
|
const { params, data } = quote;
|
|
518
|
-
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, params.fromToken
|
|
508
|
+
const tokenAddress = (0, tokens_1.getTokenAddress)(this.chainId, params.fromToken);
|
|
519
509
|
const [offrampOrder, offrampRegistryAddress] = await Promise.all([
|
|
520
510
|
this.createOfframpOrder(data, params),
|
|
521
511
|
this.fetchOfframpRegistryAddress(),
|
|
@@ -742,7 +732,7 @@ class GatewayApiClient extends base_client_1.BaseClient {
|
|
|
742
732
|
const strategies = await response.json();
|
|
743
733
|
return strategies.map((strategy) => {
|
|
744
734
|
const strategySlug = (0, utils_2.slugify)(strategy.strategyName);
|
|
745
|
-
const inputToken = tokens_1.ADDRESS_LOOKUP[chainId][strategy.inputTokenAddress];
|
|
735
|
+
const inputToken = tokens_1.ADDRESS_LOOKUP[chainId][(0, viem_1.getAddress)(strategy.inputTokenAddress)];
|
|
746
736
|
const outputToken = strategy.outputTokenAddress
|
|
747
737
|
? tokens_1.ADDRESS_LOOKUP[chainId][strategy.outputTokenAddress]
|
|
748
738
|
: undefined;
|