@gibs/abis 1.10.1
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 +26 -0
- package/src/index.ts +89 -0
- package/tsconfig.json +17 -0
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gibs/abis",
|
|
3
|
+
"version": "1.10.1",
|
|
4
|
+
"description": "Contract ABIs for the Gibs Finance bridge protocol",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"access": "public",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "npx tsc",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^22.12.0",
|
|
20
|
+
"typescript": "~5.7.2",
|
|
21
|
+
"vitest": "^3.1.1"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"viem": ">=2.37.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { parseAbi, parseAbiParameters } from 'viem'
|
|
2
|
+
|
|
3
|
+
/** the abi for the input bridge */
|
|
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
|
+
// ---- Events ----
|
|
39
|
+
'event FeeUpdated(bytes32 feeType, address indexed token, uint256 fee)',
|
|
40
|
+
// ---- Fee type identifiers ----
|
|
41
|
+
'function FOREIGN_TO_HOME_FEE() view returns (bytes32)',
|
|
42
|
+
'function HOME_TO_FOREIGN_FEE() view returns (bytes32)',
|
|
43
|
+
// ---- Fee calculation & distribution ----
|
|
44
|
+
'function calculateFee(bytes32 feeType, address token, uint256 value) view returns (uint256)',
|
|
45
|
+
'function distributeFee(address token)',
|
|
46
|
+
'function getFee(bytes32 feeType, address token) view returns (uint256)',
|
|
47
|
+
'function setFee(bytes32 feeType, address token, uint256 fee)',
|
|
48
|
+
// ---- Reward address management (no events — call rewardAddressList() to snapshot) ----
|
|
49
|
+
'function addRewardAddress(address addr)',
|
|
50
|
+
'function isRewardAddress(address addr) view returns (bool)',
|
|
51
|
+
'function removeRewardAddress(address addr)',
|
|
52
|
+
'function rewardAddressCount() view returns (uint256)',
|
|
53
|
+
'function rewardAddressList() view returns (address[])',
|
|
54
|
+
// ---- Admin & introspection ----
|
|
55
|
+
'function getModuleInterfacesVersion() pure returns (uint64 major, uint64 minor, uint64 patch)',
|
|
56
|
+
'function mediator() view returns (address)',
|
|
57
|
+
'function owner() view returns (address)',
|
|
58
|
+
'function transferOwnership(address newOwner)',
|
|
59
|
+
])
|
|
60
|
+
/** the abi for the native router */
|
|
61
|
+
export const nativeRouter = parseAbi([
|
|
62
|
+
'function wrapAndRelayTokens(address receiver) external payable',
|
|
63
|
+
'function relayTokensAndCall(address receiver, bytes calldata data) external payable',
|
|
64
|
+
])
|
|
65
|
+
/** the abi for the native router with extra input for the sender origin (tokensex) */
|
|
66
|
+
export const nativeRouterExtraInput = parseAbi([
|
|
67
|
+
'function wrapAndRelayTokens(address receiver, address sender) external payable',
|
|
68
|
+
'function relayTokensAndCall(address receiver, bytes calldata data, address sender) external payable',
|
|
69
|
+
])
|
|
70
|
+
/** the abi for the univ2 router */
|
|
71
|
+
export const univ2Router = parseAbi([
|
|
72
|
+
'function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns(uint256[] memory)',
|
|
73
|
+
'function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline) external returns(uint256[] memory amounts)',
|
|
74
|
+
])
|
|
75
|
+
/** the abi for the fee delivery struct */
|
|
76
|
+
export const feeDeliveryStruct = parseAbiParameters('(address, uint256, uint256, uint256)')
|
|
77
|
+
/** the abi for the relay tokens direct */
|
|
78
|
+
export const relayTokensDirect = parseAbi([
|
|
79
|
+
'function safeExecuteSignaturesWithAutoGasLimit(bytes calldata data, bytes calldata signatures) external',
|
|
80
|
+
])
|
|
81
|
+
/** the abi for the home amb */
|
|
82
|
+
export const homeAmb = parseAbi([
|
|
83
|
+
'function submitSignature(bytes message, bytes signature) external',
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
/** the abi for the univ2 pair */
|
|
87
|
+
export const pair = parseAbi([
|
|
88
|
+
'function getReserves() view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)',
|
|
89
|
+
])
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"moduleResolution": "nodenext"
|
|
14
|
+
},
|
|
15
|
+
"include": ["src/**/*.ts"],
|
|
16
|
+
"exclude": ["src/**/*.test.ts", "src/**/*.spec.ts"]
|
|
17
|
+
}
|