@gibs/bridge-sdk 1.10.1 → 1.12.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/package.json +12 -5
- package/src/abis.ts +3 -70
- package/src/chain-info.test.ts +968 -0
- package/src/chain-info.ts +161 -127
- package/src/chains.test.ts +123 -0
- package/src/chains.ts +5 -5
- package/src/config.test.ts +679 -0
- package/src/config.ts +138 -118
- package/src/fee-type.test.ts +45 -0
- package/src/fee-type.ts +2 -2
- package/src/image-links.test.ts +160 -0
- package/src/image-links.ts +20 -16
- package/src/index.ts +8 -8
- package/src/settings.test.ts +2754 -0
- package/src/settings.ts +325 -348
- package/src/types.ts +25 -25
- package/tsconfig.json +2 -1
- package/vitest.config.ts +13 -0
- package/dist/src/abis.d.ts +0 -384
- package/dist/src/abis.js +0 -68
- package/dist/src/chain-info.d.ts +0 -130
- package/dist/src/chain-info.js +0 -350
- package/dist/src/chains.d.ts +0 -6
- package/dist/src/chains.js +0 -86
- package/dist/src/config.d.ts +0 -136
- package/dist/src/config.js +0 -386
- package/dist/src/fee-type.d.ts +0 -10
- package/dist/src/fee-type.js +0 -9
- package/dist/src/image-links.d.ts +0 -41
- package/dist/src/image-links.js +0 -45
- package/dist/src/index.d.ts +0 -8
- package/dist/src/index.js +0 -8
- package/dist/src/settings.d.ts +0 -357
- package/dist/src/settings.js +0 -642
- package/dist/src/types.d.ts +0 -44
- package/dist/src/types.js +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gibs/bridge-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"type": "module",
|
|
@@ -16,19 +16,26 @@
|
|
|
16
16
|
"./settings": "./src/settings.ts"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "npx tsc"
|
|
19
|
+
"build": "npx tsc",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"test:coverage": "vitest run --coverage"
|
|
20
23
|
},
|
|
21
24
|
"keywords": [],
|
|
22
25
|
"author": "",
|
|
23
26
|
"license": "ISC",
|
|
24
27
|
"description": "",
|
|
25
28
|
"devDependencies": {
|
|
26
|
-
"@types/
|
|
27
|
-
"
|
|
29
|
+
"@types/lodash": "^4.17.16",
|
|
30
|
+
"@types/node": "^24",
|
|
31
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
32
|
+
"typescript": "~5.7.2",
|
|
33
|
+
"vitest": "^3.1.1"
|
|
28
34
|
},
|
|
29
35
|
"dependencies": {
|
|
36
|
+
"@gibs/abis": "^1.0.0",
|
|
30
37
|
"@gibs/common": "^1.0.0",
|
|
31
38
|
"lodash": "^4.17.21",
|
|
32
|
-
"viem": "^2.
|
|
39
|
+
"viem": "^2.46.3"
|
|
33
40
|
}
|
|
34
41
|
}
|
package/src/abis.ts
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const inputBridge = parseAbi([
|
|
5
|
-
'function minPerTx(address token) external view returns(uint256)',
|
|
6
|
-
'function foreignTokenAddress(address token) external view returns(address)',
|
|
7
|
-
'function homeTokenAddress(address token) external view returns(address)',
|
|
8
|
-
'function bridgedTokenAddress(address token) external view returns(address)',
|
|
9
|
-
'function nativeTokenAddress(address token) external view returns(address)',
|
|
10
|
-
'function feeManager() external view returns(address)',
|
|
11
|
-
'function relayTokensAndCall(address token, address _receiver, uint256 _value, bytes memory _data) external',
|
|
12
|
-
'function relayTokens(address token, address _receiver, uint256 _value) external',
|
|
13
|
-
])
|
|
14
|
-
/** the abi for the input bridge with extra input for the sender origin (tokensex) */
|
|
15
|
-
export const inputBridgeExtraInput = parseAbi([
|
|
16
|
-
'function relayTokensAndCall(address token, address _receiver, uint256 _value, bytes memory _data, address _senderOrigin) external',
|
|
17
|
-
'function relayTokens(address token, address _receiver, uint256 _value, address _senderOrigin) external',
|
|
18
|
-
])
|
|
19
|
-
/** the abi for erc677 tokens */
|
|
20
|
-
export const erc677 = parseAbi([
|
|
21
|
-
'function transferAndCall(address, uint256, bytes calldata) external',
|
|
22
|
-
])
|
|
23
|
-
/** the abi for erc677 tokens bridge with extra input for the sender origin (tokensex) */
|
|
24
|
-
export const erc677ExtraInput = parseAbi([
|
|
25
|
-
'function transferAndCall(address, uint256, bytes calldata, address sender) external',
|
|
26
|
-
])
|
|
27
|
-
/** the abi to read data from the output router */
|
|
28
|
-
export const outputRouter = parseAbi([
|
|
29
|
-
'function onTokenBridged(address _token, uint256 _value, bytes memory _data) external payable',
|
|
30
|
-
'function WETH() external view returns(address)',
|
|
31
|
-
'function bridge() external view returns(address)',
|
|
32
|
-
'function safeExecuteSignaturesWithAutoGasLimit(address runner,bytes calldata _data,bytes calldata _signatures) external payable',
|
|
33
|
-
])
|
|
34
|
-
/** the abi for the output bridge */
|
|
35
|
-
export const outputBridge = parseAbi(['function bridgeContract() external view returns(address)'])
|
|
36
|
-
/** the abi for the fee manager */
|
|
37
|
-
export const feeManager = parseAbi([
|
|
38
|
-
'function HOME_TO_FOREIGN_FEE() public view returns(bytes32)',
|
|
39
|
-
'function FOREIGN_TO_HOME_FEE() public view returns(bytes32)',
|
|
40
|
-
'function getFee(bytes32, address) public view returns(uint256)',
|
|
41
|
-
])
|
|
42
|
-
/** the abi for the native router */
|
|
43
|
-
export const nativeRouter = parseAbi([
|
|
44
|
-
'function wrapAndRelayTokens(address receiver) external payable',
|
|
45
|
-
'function relayTokensAndCall(address receiver, bytes calldata data) external payable',
|
|
46
|
-
])
|
|
47
|
-
/** the abi for the native router with extra input for the sender origin (tokensex) */
|
|
48
|
-
export const nativeRouterExtraInput = parseAbi([
|
|
49
|
-
'function wrapAndRelayTokens(address receiver, address sender) external payable',
|
|
50
|
-
'function relayTokensAndCall(address receiver, bytes calldata data, address sender) external payable',
|
|
51
|
-
])
|
|
52
|
-
/** the abi for the univ2 router */
|
|
53
|
-
export const univ2Router = parseAbi([
|
|
54
|
-
'function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns(uint256[] memory)',
|
|
55
|
-
])
|
|
56
|
-
/** the abi for the fee delivery struct */
|
|
57
|
-
export const feeDeliveryStruct = parseAbiParameters('(address, uint256, uint256, uint256)')
|
|
58
|
-
/** the abi for the relay tokens direct */
|
|
59
|
-
export const relayTokensDirect = parseAbi([
|
|
60
|
-
'function safeExecuteSignaturesWithAutoGasLimit(bytes calldata data, bytes calldata signatures) external',
|
|
61
|
-
])
|
|
62
|
-
/** the abi for the home amb */
|
|
63
|
-
export const homeAmb = parseAbi([
|
|
64
|
-
'function submitSignature(bytes message, bytes signature) external',
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
/** the abi for the univ2 pair */
|
|
68
|
-
export const pair = parseAbi([
|
|
69
|
-
'function getReserves() view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)',
|
|
70
|
-
])
|
|
1
|
+
// All ABIs have moved to the standalone @gibs/abis package.
|
|
2
|
+
// This module re-exports everything for backwards compatibility.
|
|
3
|
+
export * from '@gibs/abis';
|