@bouncetech/contracts 1.0.3 → 1.0.4
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 +23 -0
- package/abis/erc20-abi.json +130 -0
- package/addresses.json +2 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,29 @@ The following ABIs are available:
|
|
|
87
87
|
- `LEVERAGED_TOKEN_HELPER_ABI` - LeveragedTokenHelper contract ABI
|
|
88
88
|
- `REFERRALS_ABI` - Referrals contract ABI
|
|
89
89
|
|
|
90
|
+
## Python Usage
|
|
91
|
+
|
|
92
|
+
Python users can access the same contract addresses and ABIs directly from this npm package, ensuring a **single source of truth**. The Python package reads directly from the published npm package via CDN:
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
import json
|
|
96
|
+
import urllib.request
|
|
97
|
+
|
|
98
|
+
# Fetch addresses
|
|
99
|
+
with urllib.request.urlopen(
|
|
100
|
+
"https://unpkg.com/@bouncetech/contracts@1.0.3/addresses.json"
|
|
101
|
+
) as response:
|
|
102
|
+
addresses = json.loads(response.read())
|
|
103
|
+
|
|
104
|
+
# Fetch ABIs
|
|
105
|
+
with urllib.request.urlopen(
|
|
106
|
+
"https://unpkg.com/@bouncetech/contracts@1.0.3/abis/factory-abi.json"
|
|
107
|
+
) as response:
|
|
108
|
+
factory_abi = json.loads(response.read())
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Note:** Update the version `@1.0.3` as needed to the lastest version.
|
|
112
|
+
|
|
90
113
|
## Updating
|
|
91
114
|
|
|
92
115
|
When new contract addresses or ABIs are added, simply update your package:
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "allowance",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{ "name": "owner", "type": "address", "internalType": "address" },
|
|
7
|
+
{ "name": "spender", "type": "address", "internalType": "address" }
|
|
8
|
+
],
|
|
9
|
+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
|
|
10
|
+
"stateMutability": "view"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "function",
|
|
14
|
+
"name": "approve",
|
|
15
|
+
"inputs": [
|
|
16
|
+
{ "name": "spender", "type": "address", "internalType": "address" },
|
|
17
|
+
{ "name": "value", "type": "uint256", "internalType": "uint256" }
|
|
18
|
+
],
|
|
19
|
+
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
20
|
+
"stateMutability": "nonpayable"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "function",
|
|
24
|
+
"name": "balanceOf",
|
|
25
|
+
"inputs": [
|
|
26
|
+
{ "name": "account", "type": "address", "internalType": "address" }
|
|
27
|
+
],
|
|
28
|
+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
|
|
29
|
+
"stateMutability": "view"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "function",
|
|
33
|
+
"name": "decimals",
|
|
34
|
+
"inputs": [],
|
|
35
|
+
"outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }],
|
|
36
|
+
"stateMutability": "view"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "function",
|
|
40
|
+
"name": "name",
|
|
41
|
+
"inputs": [],
|
|
42
|
+
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
|
|
43
|
+
"stateMutability": "view"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "function",
|
|
47
|
+
"name": "symbol",
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
|
|
50
|
+
"stateMutability": "view"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "function",
|
|
54
|
+
"name": "totalSupply",
|
|
55
|
+
"inputs": [],
|
|
56
|
+
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
|
|
57
|
+
"stateMutability": "view"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "function",
|
|
61
|
+
"name": "transfer",
|
|
62
|
+
"inputs": [
|
|
63
|
+
{ "name": "to", "type": "address", "internalType": "address" },
|
|
64
|
+
{ "name": "value", "type": "uint256", "internalType": "uint256" }
|
|
65
|
+
],
|
|
66
|
+
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
67
|
+
"stateMutability": "nonpayable"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "function",
|
|
71
|
+
"name": "transferFrom",
|
|
72
|
+
"inputs": [
|
|
73
|
+
{ "name": "from", "type": "address", "internalType": "address" },
|
|
74
|
+
{ "name": "to", "type": "address", "internalType": "address" },
|
|
75
|
+
{ "name": "value", "type": "uint256", "internalType": "uint256" }
|
|
76
|
+
],
|
|
77
|
+
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
78
|
+
"stateMutability": "nonpayable"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "event",
|
|
82
|
+
"name": "Approval",
|
|
83
|
+
"inputs": [
|
|
84
|
+
{
|
|
85
|
+
"name": "owner",
|
|
86
|
+
"type": "address",
|
|
87
|
+
"indexed": true,
|
|
88
|
+
"internalType": "address"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "spender",
|
|
92
|
+
"type": "address",
|
|
93
|
+
"indexed": true,
|
|
94
|
+
"internalType": "address"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "value",
|
|
98
|
+
"type": "uint256",
|
|
99
|
+
"indexed": false,
|
|
100
|
+
"internalType": "uint256"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"anonymous": false
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "event",
|
|
107
|
+
"name": "Transfer",
|
|
108
|
+
"inputs": [
|
|
109
|
+
{
|
|
110
|
+
"name": "from",
|
|
111
|
+
"type": "address",
|
|
112
|
+
"indexed": true,
|
|
113
|
+
"internalType": "address"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "to",
|
|
117
|
+
"type": "address",
|
|
118
|
+
"indexed": true,
|
|
119
|
+
"internalType": "address"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "value",
|
|
123
|
+
"type": "uint256",
|
|
124
|
+
"indexed": false,
|
|
125
|
+
"internalType": "uint256"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"anonymous": false
|
|
129
|
+
}
|
|
130
|
+
]
|
package/addresses.json
CHANGED
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
"HyperliquidHandler": "0xE57F983f3F317b2feF5585E660ed24980Ba7C3dA",
|
|
6
6
|
"LeveragedTokenHelper": "0x9F53b119025733d174d514b13B6a061f1C482f8C",
|
|
7
7
|
"LeveragedTokenImplementation": "0x20132f1804Df40Acc9b5115F47191016a5258721",
|
|
8
|
-
"Referrals": "0xfD3A6323878Fc991447CcDd4c644ab419afC6f76"
|
|
8
|
+
"Referrals": "0xfD3A6323878Fc991447CcDd4c644ab419afC6f76",
|
|
9
|
+
"USDC": "0xb88339CB7199b77E23DB6E890353E22632Ba630f"
|
|
9
10
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const ALL_ADDRESSES: {
|
|
|
7
7
|
LeveragedTokenHelper: Address;
|
|
8
8
|
LeveragedTokenImplementation: Address;
|
|
9
9
|
Referrals: Address;
|
|
10
|
+
USDC: Address;
|
|
10
11
|
};
|
|
11
12
|
export declare const FACTORY_ADDRESS: `0x${string}`;
|
|
12
13
|
export declare const GLOBAL_STORAGE_ADDRESS: `0x${string}`;
|
|
@@ -15,6 +16,7 @@ export declare const HYPERLIQUID_HANDLER_ADDRESS: `0x${string}`;
|
|
|
15
16
|
export declare const LEVERAGED_TOKEN_HELPER_ADDRESS: `0x${string}`;
|
|
16
17
|
export declare const LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS: `0x${string}`;
|
|
17
18
|
export declare const REFERRALS_ADDRESS: `0x${string}`;
|
|
19
|
+
export declare const USDC_ADDRESS: `0x${string}`;
|
|
18
20
|
export declare const FACTORY_ABI: ({
|
|
19
21
|
type: string;
|
|
20
22
|
inputs: {
|
|
@@ -320,4 +322,32 @@ export declare const REFERRALS_ABI: ({
|
|
|
320
322
|
outputs?: undefined;
|
|
321
323
|
anonymous?: undefined;
|
|
322
324
|
})[];
|
|
325
|
+
export declare const USDC_ABI: ({
|
|
326
|
+
type: string;
|
|
327
|
+
name: string;
|
|
328
|
+
inputs: {
|
|
329
|
+
name: string;
|
|
330
|
+
type: string;
|
|
331
|
+
internalType: string;
|
|
332
|
+
}[];
|
|
333
|
+
outputs: {
|
|
334
|
+
name: string;
|
|
335
|
+
type: string;
|
|
336
|
+
internalType: string;
|
|
337
|
+
}[];
|
|
338
|
+
stateMutability: string;
|
|
339
|
+
anonymous?: undefined;
|
|
340
|
+
} | {
|
|
341
|
+
type: string;
|
|
342
|
+
name: string;
|
|
343
|
+
inputs: {
|
|
344
|
+
name: string;
|
|
345
|
+
type: string;
|
|
346
|
+
indexed: boolean;
|
|
347
|
+
internalType: string;
|
|
348
|
+
}[];
|
|
349
|
+
anonymous: boolean;
|
|
350
|
+
outputs?: undefined;
|
|
351
|
+
stateMutability?: undefined;
|
|
352
|
+
})[];
|
|
323
353
|
export default ALL_ADDRESSES;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.REFERRALS_ABI = exports.LEVERAGED_TOKEN_HELPER_ABI = exports.LEVERAGED_TOKEN_ABI = exports.HYPERLIQUID_HANDLER_ABI = exports.GLOBAL_STORAGE_HELPER_ABI = exports.GLOBAL_STORAGE_ABI = exports.FACTORY_ABI = exports.REFERRALS_ADDRESS = exports.LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = exports.LEVERAGED_TOKEN_HELPER_ADDRESS = exports.HYPERLIQUID_HANDLER_ADDRESS = exports.GLOBAL_STORAGE_HELPER_ADDRESS = exports.GLOBAL_STORAGE_ADDRESS = exports.FACTORY_ADDRESS = exports.ALL_ADDRESSES = void 0;
|
|
6
|
+
exports.USDC_ABI = exports.REFERRALS_ABI = exports.LEVERAGED_TOKEN_HELPER_ABI = exports.LEVERAGED_TOKEN_ABI = exports.HYPERLIQUID_HANDLER_ABI = exports.GLOBAL_STORAGE_HELPER_ABI = exports.GLOBAL_STORAGE_ABI = exports.FACTORY_ABI = exports.USDC_ADDRESS = exports.REFERRALS_ADDRESS = exports.LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = exports.LEVERAGED_TOKEN_HELPER_ADDRESS = exports.HYPERLIQUID_HANDLER_ADDRESS = exports.GLOBAL_STORAGE_HELPER_ADDRESS = exports.GLOBAL_STORAGE_ADDRESS = exports.FACTORY_ADDRESS = exports.ALL_ADDRESSES = void 0;
|
|
7
7
|
const addresses_json_1 = __importDefault(require("../addresses.json"));
|
|
8
8
|
const leveraged_token_abi_json_1 = __importDefault(require("../abis/leveraged-token-abi.json"));
|
|
9
9
|
const factory_abi_json_1 = __importDefault(require("../abis/factory-abi.json"));
|
|
@@ -12,6 +12,7 @@ const global_storage_helper_abi_json_1 = __importDefault(require("../abis/global
|
|
|
12
12
|
const hyperliquid_handler_abi_json_1 = __importDefault(require("../abis/hyperliquid-handler-abi.json"));
|
|
13
13
|
const leveraged_token_helper_abi_json_1 = __importDefault(require("../abis/leveraged-token-helper-abi.json"));
|
|
14
14
|
const referrals_abi_json_1 = __importDefault(require("../abis/referrals-abi.json"));
|
|
15
|
+
const erc20_abi_json_1 = __importDefault(require("../abis/erc20-abi.json"));
|
|
15
16
|
// Export all contract addresses
|
|
16
17
|
exports.ALL_ADDRESSES = addresses_json_1.default;
|
|
17
18
|
// Export individual addresses for convenience
|
|
@@ -22,6 +23,7 @@ exports.HYPERLIQUID_HANDLER_ADDRESS = exports.ALL_ADDRESSES.HyperliquidHandler;
|
|
|
22
23
|
exports.LEVERAGED_TOKEN_HELPER_ADDRESS = exports.ALL_ADDRESSES.LeveragedTokenHelper;
|
|
23
24
|
exports.LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = exports.ALL_ADDRESSES.LeveragedTokenImplementation;
|
|
24
25
|
exports.REFERRALS_ADDRESS = exports.ALL_ADDRESSES.Referrals;
|
|
26
|
+
exports.USDC_ADDRESS = exports.ALL_ADDRESSES.USDC;
|
|
25
27
|
// Export ABIs
|
|
26
28
|
exports.FACTORY_ABI = factory_abi_json_1.default;
|
|
27
29
|
exports.GLOBAL_STORAGE_ABI = global_storage_abi_json_1.default;
|
|
@@ -30,5 +32,6 @@ exports.HYPERLIQUID_HANDLER_ABI = hyperliquid_handler_abi_json_1.default;
|
|
|
30
32
|
exports.LEVERAGED_TOKEN_ABI = leveraged_token_abi_json_1.default;
|
|
31
33
|
exports.LEVERAGED_TOKEN_HELPER_ABI = leveraged_token_helper_abi_json_1.default;
|
|
32
34
|
exports.REFERRALS_ABI = referrals_abi_json_1.default;
|
|
35
|
+
exports.USDC_ABI = erc20_abi_json_1.default;
|
|
33
36
|
// Export addresses as default for convenience
|
|
34
37
|
exports.default = exports.ALL_ADDRESSES;
|
package/package.json
CHANGED