@rabby-wallet/rabby-bridge 0.0.4 → 0.0.5-beta.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/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # rabby-bridge
2
-
3
- Minimal bridge SDK for Rabby:
4
-
5
- - enumerates supported bridge aggregators and chains
6
- - maintains per-chain spender/router allowlists
7
- - validates backend bridge quotes before returning them
8
- - does not implement calldata decoding
9
-
10
- ## Test
11
-
12
- Run `yarn test` to build the package and execute the Jest suite.
1
+ # rabby-bridge
2
+
3
+ Minimal bridge SDK for Rabby:
4
+
5
+ - enumerates supported bridge aggregators and chains
6
+ - maintains per-chain spender/router allowlists
7
+ - validates backend bridge quotes before returning them
8
+ - does not implement calldata decoding
9
+
10
+ ## Test
11
+
12
+ Run `yarn test` to build the package and execute the Jest suite.
package/dist/consts.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const BRIDGE_AGGREGATORS: readonly ["lifi", "bungee", "relay", "stargate", "near_intents", "mayan", "across"];
1
+ export declare const BRIDGE_AGGREGATORS: readonly ["lifi", "bungee", "relay", "stargate", "near_intents", "mayan", "across", "socket"];
2
2
  export declare const BRIDGE_ENUM: {
3
3
  readonly LIFI: "lifi";
4
4
  readonly BUNGEE: "bungee";
@@ -7,5 +7,6 @@ export declare const BRIDGE_ENUM: {
7
7
  readonly NEAR_INTENTS: "near_intents";
8
8
  readonly MAYAN: "mayan";
9
9
  readonly ACROSS: "across";
10
+ readonly SOCKET: "socket";
10
11
  };
11
12
  export type BridgeAggregatorId = (typeof BRIDGE_AGGREGATORS)[number];
package/dist/consts.js CHANGED
@@ -8,4 +8,5 @@ export const BRIDGE_ENUM = {
8
8
  NEAR_INTENTS: 'near_intents',
9
9
  MAYAN: 'mayan',
10
10
  ACROSS: 'across',
11
+ SOCKET: 'socket',
11
12
  };
package/dist/data.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ChainEnum } from './chains.js';
2
- export declare const SUPPORTED_AGGREGATORS: readonly ["lifi", "bungee", "relay", "stargate", "near_intents", "mayan", "across"];
2
+ export declare const SUPPORTED_AGGREGATORS: readonly ["lifi", "bungee", "relay", "stargate", "near_intents", "mayan", "across", "socket"];
3
3
  declare const EXTRA_CHAINS: {
4
4
  readonly XDC: ChainEnum;
5
5
  readonly UNI: ChainEnum;
@@ -220,6 +220,27 @@ export declare const BRIDGE_SPENDER_WHITELIST_DATA: {
220
220
  readonly ZORA: "0x13fdac9f9b4777705db45291bbff3c972c6d1d97";
221
221
  readonly BLAST: "0x2d509190ed0172ba588407d4c2df918f955cc6e1";
222
222
  };
223
+ readonly socket: {
224
+ readonly [EXTRA_CHAINS.SONIC]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
225
+ readonly [EXTRA_CHAINS.BERA]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
226
+ readonly [EXTRA_CHAINS.UNI]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
227
+ readonly [EXTRA_CHAINS.INK]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
228
+ readonly [EXTRA_CHAINS.WORLD]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
229
+ readonly [EXTRA_CHAINS.HYPER]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
230
+ readonly ETH: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
231
+ readonly ARBITRUM: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
232
+ readonly OP: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
233
+ readonly BASE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
234
+ readonly POLYGON: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
235
+ readonly BSC: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
236
+ readonly AVAX: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
237
+ readonly GNOSIS: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
238
+ readonly LINEA: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
239
+ readonly SCRL: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
240
+ readonly BLAST: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
241
+ readonly MODE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
242
+ readonly MANTLE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
243
+ };
223
244
  };
224
245
  export declare const BRIDGE_ALT_CONTRACTS_DATA: {
225
246
  readonly across: readonly ["0x10d8b8daa26d307489803e10477de69c0492b610", "0x5a148a9260c1f670429361c34d40b477280f01a9"];
@@ -408,5 +429,26 @@ export declare const BRIDGE_ROUTER_WHITELIST_DATA: {
408
429
  readonly ZORA: "0x13fdac9f9b4777705db45291bbff3c972c6d1d97";
409
430
  readonly BLAST: "0x2d509190ed0172ba588407d4c2df918f955cc6e1";
410
431
  };
432
+ readonly socket: {
433
+ readonly [EXTRA_CHAINS.SONIC]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
434
+ readonly [EXTRA_CHAINS.BERA]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
435
+ readonly [EXTRA_CHAINS.UNI]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
436
+ readonly [EXTRA_CHAINS.INK]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
437
+ readonly [EXTRA_CHAINS.WORLD]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
438
+ readonly [EXTRA_CHAINS.HYPER]: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
439
+ readonly ETH: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
440
+ readonly ARBITRUM: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
441
+ readonly OP: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
442
+ readonly BASE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
443
+ readonly POLYGON: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
444
+ readonly BSC: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
445
+ readonly AVAX: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
446
+ readonly GNOSIS: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
447
+ readonly LINEA: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
448
+ readonly SCRL: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
449
+ readonly BLAST: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
450
+ readonly MODE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
451
+ readonly MANTLE: "0x50c4e75a512f2a14a7b304787adf79c4531a5909";
452
+ };
411
453
  };
412
454
  export {};
package/dist/data.js CHANGED
@@ -7,6 +7,7 @@ export const SUPPORTED_AGGREGATORS = [
7
7
  'near_intents',
8
8
  'mayan',
9
9
  'across',
10
+ 'socket',
10
11
  ];
11
12
  const EXTRA_CHAINS = {
12
13
  XDC: 'XDC',
@@ -242,6 +243,28 @@ export const BRIDGE_SPENDER_WHITELIST_DATA = {
242
243
  [EXTRA_CHAINS.MONAD]: '0xd2ecb3afe598b746f8123cae365a598da831a449',
243
244
  [EXTRA_CHAINS.PLASMA]: '0x50039faefebef707cfd94d6d462fe6d10b39207a',
244
245
  },
246
+ // Socket Swap V3 的 Allowance Holder,所有链同址(approve spender == tx.to)。
247
+ socket: {
248
+ [CHAINS_ENUM.ETH]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
249
+ [CHAINS_ENUM.ARBITRUM]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
250
+ [CHAINS_ENUM.OP]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
251
+ [CHAINS_ENUM.BASE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
252
+ [CHAINS_ENUM.POLYGON]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
253
+ [CHAINS_ENUM.BSC]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
254
+ [CHAINS_ENUM.AVAX]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
255
+ [CHAINS_ENUM.GNOSIS]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
256
+ [CHAINS_ENUM.LINEA]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
257
+ [CHAINS_ENUM.SCRL]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
258
+ [CHAINS_ENUM.BLAST]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
259
+ [CHAINS_ENUM.MODE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
260
+ [CHAINS_ENUM.MANTLE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
261
+ [EXTRA_CHAINS.SONIC]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
262
+ [EXTRA_CHAINS.BERA]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
263
+ [EXTRA_CHAINS.UNI]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
264
+ [EXTRA_CHAINS.INK]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
265
+ [EXTRA_CHAINS.WORLD]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
266
+ [EXTRA_CHAINS.HYPER]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
267
+ },
245
268
  };
246
269
  // 部分聚合器除逐链合约外,API 还可能路由到全局合约(同时作为 approve 目标与 tx.to)。
247
270
  // 这些地址对该聚合器所有链均合法,校验时与逐链白名单并列接受。对应 DeBankCore 的 *_alt_contracts。
@@ -444,4 +467,26 @@ export const BRIDGE_ROUTER_WHITELIST_DATA = {
444
467
  [EXTRA_CHAINS.MONAD]: '0xd2ecb3afe598b746f8123cae365a598da831a449',
445
468
  [EXTRA_CHAINS.PLASMA]: '0x50039faefebef707cfd94d6d462fe6d10b39207a',
446
469
  },
470
+ // Socket Swap V3 的 Allowance Holder,所有链同址(tx.to == approve spender)。
471
+ socket: {
472
+ [CHAINS_ENUM.ETH]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
473
+ [CHAINS_ENUM.ARBITRUM]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
474
+ [CHAINS_ENUM.OP]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
475
+ [CHAINS_ENUM.BASE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
476
+ [CHAINS_ENUM.POLYGON]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
477
+ [CHAINS_ENUM.BSC]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
478
+ [CHAINS_ENUM.AVAX]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
479
+ [CHAINS_ENUM.GNOSIS]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
480
+ [CHAINS_ENUM.LINEA]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
481
+ [CHAINS_ENUM.SCRL]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
482
+ [CHAINS_ENUM.BLAST]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
483
+ [CHAINS_ENUM.MODE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
484
+ [CHAINS_ENUM.MANTLE]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
485
+ [EXTRA_CHAINS.SONIC]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
486
+ [EXTRA_CHAINS.BERA]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
487
+ [EXTRA_CHAINS.UNI]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
488
+ [EXTRA_CHAINS.INK]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
489
+ [EXTRA_CHAINS.WORLD]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
490
+ [EXTRA_CHAINS.HYPER]: '0x50c4e75a512f2a14a7b304787adf79c4531a5909',
491
+ },
447
492
  };
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
- {
2
- "name": "@rabby-wallet/rabby-bridge",
3
- "version": "0.0.4",
4
- "description": "Bridge quote helpers and contract allowlists for Rabby",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
13
- }
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "peerDependencies": {
19
- "@debank/common": ">=0.3.60",
20
- "@rabby-wallet/rabby-api": ">=0.9.58"
21
- },
22
- "scripts": {
23
- "prepublishOnly": "yarn build",
24
- "build": "rimraf dist && tsc",
25
- "test": "yarn build && NODE_OPTIONS=--experimental-vm-modules jest --runInBand --watchman=false"
26
- },
27
- "devDependencies": {
28
- "@debank/common": "^0.3.60",
29
- "@rabby-wallet/rabby-api": "^0.9.58",
30
- "@types/node": "^18.19.0",
31
- "jest": "^29.7.0",
32
- "rimraf": "^3.0.2",
33
- "typescript": "^5.8.3"
34
- },
35
- "packageManager": "yarn@4.12.0"
36
- }
1
+ {
2
+ "name": "@rabby-wallet/rabby-bridge",
3
+ "version": "0.0.5-beta.0",
4
+ "description": "Bridge quote helpers and contract allowlists for Rabby",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "peerDependencies": {
19
+ "@debank/common": ">=0.3.60",
20
+ "@rabby-wallet/rabby-api": ">=0.9.58"
21
+ },
22
+ "scripts": {
23
+ "prepublishOnly": "yarn build",
24
+ "build": "rimraf dist && tsc",
25
+ "test": "yarn build && NODE_OPTIONS=--experimental-vm-modules jest --runInBand --watchman=false"
26
+ },
27
+ "devDependencies": {
28
+ "@debank/common": "^0.3.60",
29
+ "@rabby-wallet/rabby-api": "^0.9.58",
30
+ "@types/node": "^18.19.0",
31
+ "jest": "^29.7.0",
32
+ "rimraf": "^3.0.2",
33
+ "typescript": "^5.8.3"
34
+ },
35
+ "packageManager": "yarn@4.12.0"
36
+ }