@gobob/bob-sdk 3.3.3 → 3.3.4-alpha2

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.
@@ -1,9 +1,8 @@
1
1
  import type { EsploraClient } from '../esplora';
2
- import { Address } from 'viem';
2
+ import { Address, Hex } from 'viem';
3
3
  import { offrampCaller, strategyCaller } from './abi';
4
4
  type ChainSlug = string | number;
5
5
  type TokenSymbol = string;
6
- export type EvmAddress = string;
7
6
  export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
8
7
  export declare enum Chain {
9
8
  BITCOIN = "bitcoin",
@@ -15,6 +14,10 @@ export declare enum ChainId {
15
14
  BOB_SEPOLIA = 808813,
16
15
  OPTIMISM = 10
17
16
  }
17
+ export declare const chainIdMapping: {
18
+ readonly 60808: Chain.BOB;
19
+ readonly 808813: Chain.BOB_SEPOLIA;
20
+ };
18
21
  export type StakeParams = {
19
22
  strategyAddress: Address;
20
23
  token: Address;
@@ -111,33 +114,33 @@ export interface GatewayStrategyContract {
111
114
  outputToken: GatewayToken | null;
112
115
  }
113
116
  export type GatewayQuote = {
114
- gatewayAddress: EvmAddress;
115
- baseTokenAddress: EvmAddress;
117
+ gatewayAddress: Address;
118
+ baseTokenAddress: Address;
116
119
  dustThreshold: number;
117
120
  satoshis: number;
118
121
  fee: number;
119
122
  bitcoinAddress: string;
120
123
  txProofDifficultyFactor: number;
121
- strategyAddress?: EvmAddress;
124
+ strategyAddress?: Address;
122
125
  };
123
126
  export type GatewayCreateOrderRequest = {
124
- gatewayAddress: EvmAddress;
125
- strategyAddress?: EvmAddress;
127
+ gatewayAddress: Address;
128
+ strategyAddress?: Address;
126
129
  satsToConvertToEth: number;
127
- userAddress: EvmAddress;
128
- gatewayExtraData?: string;
129
- strategyExtraData?: string;
130
+ userAddress: Address;
131
+ gatewayExtraData?: Hex;
132
+ strategyExtraData?: Hex;
130
133
  satoshis: number;
131
134
  campaignId?: string;
132
135
  };
133
- export type OffRampGatewayCreateQuoteResponse = {
136
+ export type OfframpGatewayCreateQuoteResponse = {
134
137
  amountToLock: string;
135
138
  minimumFeesToPay: string;
136
- gateway: EvmAddress;
139
+ gateway: Address;
137
140
  };
138
141
  export interface OnrampOrderResponse {
139
- gatewayAddress: EvmAddress;
140
- baseTokenAddress: EvmAddress;
142
+ gatewayAddress: Address;
143
+ baseTokenAddress: Address;
141
144
  txid: string;
142
145
  status: boolean;
143
146
  timestamp: number;
@@ -145,10 +148,10 @@ export interface OnrampOrderResponse {
145
148
  satoshis: number;
146
149
  fee: number;
147
150
  txProofDifficultyFactor: number;
148
- strategyAddress?: EvmAddress;
151
+ strategyAddress?: Address;
149
152
  satsToConvertToEth: number;
150
153
  outputEthAmount?: string;
151
- outputTokenAddress?: EvmAddress;
154
+ outputTokenAddress?: Address;
152
155
  outputTokenAmount?: string;
153
156
  txHash?: string;
154
157
  }
@@ -300,15 +303,17 @@ export interface DefiLlamaPool {
300
303
  underlyingTokens: null | string[];
301
304
  rewardTokens: null | string[];
302
305
  }
303
- export type OnrampQuoteParams = {
304
- type: 'onramp';
305
- params: Optional<GatewayQuoteParams, 'amount' | 'fromChain' | 'fromToken' | 'fromUserAddress' | 'toUserAddress'>;
306
+ export type OnrampQuoteParams = Optional<GatewayQuoteParams, 'toUserAddress'>;
307
+ export type OfframpQuoteParams = Optional<GatewayQuoteParams, 'fromUserAddress'>;
308
+ export type GetQuoteParams = Optional<OnrampQuoteParams | OfframpQuoteParams, 'amount'>;
309
+ export type OnrampExecuteQuoteParams = {
310
+ onrampQuote?: GatewayQuote & GatewayTokensInfo;
311
+ params: GetQuoteParams;
306
312
  };
307
- export type OfframpQuoteParams = {
308
- type: 'offramp';
309
- params: {
310
- tokenAddress: Address;
311
- amount: number;
312
- };
313
+ export type OfframpExecuteQuoteParams = {
314
+ offrampQuote?: OfframpQuote;
315
+ params: GetQuoteParams;
313
316
  };
317
+ export type ExecuteStakeParam = StakeParams;
318
+ export type ExecuteQuoteParams = OnrampExecuteQuoteParams | OfframpExecuteQuoteParams;
314
319
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainId = exports.Chain = void 0;
3
+ exports.chainIdMapping = exports.ChainId = exports.Chain = void 0;
4
4
  var Chain;
5
5
  (function (Chain) {
6
6
  Chain["BITCOIN"] = "bitcoin";
@@ -13,4 +13,8 @@ var ChainId;
13
13
  ChainId[ChainId["BOB_SEPOLIA"] = 808813] = "BOB_SEPOLIA";
14
14
  ChainId[ChainId["OPTIMISM"] = 10] = "OPTIMISM";
15
15
  })(ChainId || (exports.ChainId = ChainId = {}));
16
+ exports.chainIdMapping = {
17
+ [ChainId.BOB]: Chain.BOB,
18
+ [ChainId.BOB_SEPOLIA]: Chain.BOB_SEPOLIA,
19
+ };
16
20
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":";;;AAWA,IAAY,KAKX;AALD,WAAY,KAAK;IAEb,4BAAmB,CAAA;IACnB,oBAAW,CAAA;IACX,oCAA2B,CAAA;AAC/B,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAED,IAAY,OAIX;AAJD,WAAY,OAAO;IACf,uCAAW,CAAA;IACX,wDAAoB,CAAA;IACpB,8CAAa,CAAA;AACjB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":";;;AASA,IAAY,KAKX;AALD,WAAY,KAAK;IAEb,4BAAmB,CAAA;IACnB,oBAAW,CAAA;IACX,oCAA2B,CAAA;AAC/B,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAED,IAAY,OAIX;AAJD,WAAY,OAAO;IACf,uCAAW,CAAA;IACX,wDAAoB,CAAA;IACpB,8CAAa,CAAA;AACjB,CAAC,EAJW,OAAO,uBAAP,OAAO,QAIlB;AAEY,QAAA,cAAc,GAAG;IAC1B,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG;IACxB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW;CAClC,CAAC"}