@bouncetech/contracts 1.0.2 → 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 CHANGED
@@ -34,7 +34,15 @@ const leveragedTokenAddress = LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS;
34
34
  ### Import Contract ABIs
35
35
 
36
36
  ```typescript
37
- import { FACTORY_ABI, LEVERAGED_TOKEN_ABI } from "@bouncetech/contracts";
37
+ import {
38
+ FACTORY_ABI,
39
+ LEVERAGED_TOKEN_ABI,
40
+ GLOBAL_STORAGE_ABI,
41
+ GLOBAL_STORAGE_HELPER_ABI,
42
+ HYPERLIQUID_HANDLER_ABI,
43
+ LEVERAGED_TOKEN_HELPER_ABI,
44
+ REFERRALS_ABI,
45
+ } from "@bouncetech/contracts";
38
46
 
39
47
  // Use with ethers.js
40
48
  import { Contract } from "ethers";
@@ -55,18 +63,52 @@ const result = await client.readContract({
55
63
 
56
64
  ### Available Contracts
57
65
 
58
- - **Factory**: `0xeD8bCDe433EB7c4B69DB1235483bf0Edb726Fc1B`
59
- - **GlobalStorage**: `0xa07d06383c1863c8A54d427aC890643d76cc03ff`
60
- - **GlobalStorageHelper**: `0x99836aCBD207d5BCa57E3Fe0448bD1AB0A4BDf5C`
61
- - **HyperliquidHandler**: `0xE57F983f3F317b2feF5585E660ed24980Ba7C3dA`
62
- - **LeveragedTokenHelper**: `0x74dd1ecdA4fA350Ee67Ab4103C8728d8C2983802`
63
- - **LeveragedTokenImplementation**: `0x20132f1804Df40Acc9b5115F47191016a5258721`
64
- - **Referrals**: `0xfD3A6323878Fc991447CcDd4c644ab419afC6f76`
66
+ The following contracts are available through this package:
67
+
68
+ - **Factory**
69
+ - **GlobalStorage**
70
+ - **GlobalStorageHelper**
71
+ - **HyperliquidHandler**
72
+ - **LeveragedTokenHelper**
73
+ - **LeveragedTokenImplementation**
74
+ - **Referrals**
75
+
76
+ For the latest contract addresses, see `addresses.json` in the package or import them programmatically using the exported address constants.
65
77
 
66
78
  ### Available ABIs
67
79
 
80
+ The following ABIs are available:
81
+
68
82
  - `FACTORY_ABI` - Factory contract ABI
83
+ - `GLOBAL_STORAGE_ABI` - GlobalStorage contract ABI
84
+ - `GLOBAL_STORAGE_HELPER_ABI` - GlobalStorageHelper contract ABI
85
+ - `HYPERLIQUID_HANDLER_ABI` - HyperliquidHandler contract ABI
69
86
  - `LEVERAGED_TOKEN_ABI` - Leveraged Token contract ABI
87
+ - `LEVERAGED_TOKEN_HELPER_ABI` - LeveragedTokenHelper contract ABI
88
+ - `REFERRALS_ABI` - Referrals contract ABI
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.
70
112
 
71
113
  ## Updating
72
114
 
@@ -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,150 @@ 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}`;
20
+ export declare const FACTORY_ABI: ({
21
+ type: string;
22
+ inputs: {
23
+ name: string;
24
+ type: string;
25
+ internalType: string;
26
+ }[];
27
+ stateMutability: string;
28
+ name?: undefined;
29
+ outputs?: undefined;
30
+ anonymous?: undefined;
31
+ } | {
32
+ type: string;
33
+ name: string;
34
+ inputs: {
35
+ name: string;
36
+ type: string;
37
+ internalType: string;
38
+ }[];
39
+ outputs: {
40
+ name: string;
41
+ type: string;
42
+ internalType: string;
43
+ }[];
44
+ stateMutability: string;
45
+ anonymous?: undefined;
46
+ } | {
47
+ type: string;
48
+ name: string;
49
+ inputs: {
50
+ name: string;
51
+ type: string;
52
+ indexed: boolean;
53
+ internalType: string;
54
+ }[];
55
+ anonymous: boolean;
56
+ stateMutability?: undefined;
57
+ outputs?: undefined;
58
+ } | {
59
+ type: string;
60
+ name: string;
61
+ inputs: {
62
+ name: string;
63
+ type: string;
64
+ internalType: string;
65
+ }[];
66
+ stateMutability?: undefined;
67
+ outputs?: undefined;
68
+ anonymous?: undefined;
69
+ })[];
70
+ export declare const GLOBAL_STORAGE_ABI: ({
71
+ type: string;
72
+ inputs: never[];
73
+ stateMutability: string;
74
+ name?: undefined;
75
+ outputs?: undefined;
76
+ anonymous?: undefined;
77
+ } | {
78
+ type: string;
79
+ name: string;
80
+ inputs: {
81
+ name: string;
82
+ type: string;
83
+ internalType: string;
84
+ }[];
85
+ outputs: {
86
+ name: string;
87
+ type: string;
88
+ internalType: string;
89
+ }[];
90
+ stateMutability: string;
91
+ anonymous?: undefined;
92
+ } | {
93
+ type: string;
94
+ name: string;
95
+ inputs: {
96
+ name: string;
97
+ type: string;
98
+ indexed: boolean;
99
+ internalType: string;
100
+ }[];
101
+ anonymous: boolean;
102
+ stateMutability?: undefined;
103
+ outputs?: undefined;
104
+ } | {
105
+ type: string;
106
+ name: string;
107
+ inputs: {
108
+ name: string;
109
+ type: string;
110
+ internalType: string;
111
+ }[];
112
+ stateMutability?: undefined;
113
+ outputs?: undefined;
114
+ anonymous?: undefined;
115
+ })[];
116
+ export declare const GLOBAL_STORAGE_HELPER_ABI: ({
117
+ type: string;
118
+ inputs: {
119
+ name: string;
120
+ type: string;
121
+ internalType: string;
122
+ }[];
123
+ stateMutability: string;
124
+ name?: undefined;
125
+ outputs?: undefined;
126
+ } | {
127
+ type: string;
128
+ name: string;
129
+ inputs: never[];
130
+ outputs: {
131
+ name: string;
132
+ type: string;
133
+ internalType: string;
134
+ components: {
135
+ name: string;
136
+ type: string;
137
+ internalType: string;
138
+ }[];
139
+ }[];
140
+ stateMutability: string;
141
+ })[];
142
+ export declare const HYPERLIQUID_HANDLER_ABI: ({
143
+ type: string;
144
+ name: string;
145
+ inputs: {
146
+ name: string;
147
+ type: string;
148
+ internalType: string;
149
+ }[];
150
+ outputs: {
151
+ name: string;
152
+ type: string;
153
+ internalType: string;
154
+ }[];
155
+ stateMutability: string;
156
+ } | {
157
+ type: string;
158
+ name: string;
159
+ inputs: never[];
160
+ outputs?: undefined;
161
+ stateMutability?: undefined;
162
+ })[];
18
163
  export declare const LEVERAGED_TOKEN_ABI: ({
19
164
  type: string;
20
165
  inputs: never[];
@@ -81,7 +226,53 @@ export declare const LEVERAGED_TOKEN_ABI: ({
81
226
  outputs?: undefined;
82
227
  anonymous?: undefined;
83
228
  })[];
84
- export declare const FACTORY_ABI: ({
229
+ export declare const LEVERAGED_TOKEN_HELPER_ABI: ({
230
+ type: string;
231
+ inputs: {
232
+ name: string;
233
+ type: string;
234
+ internalType: string;
235
+ }[];
236
+ stateMutability: string;
237
+ name?: undefined;
238
+ outputs?: undefined;
239
+ } | {
240
+ type: string;
241
+ name: string;
242
+ inputs: {
243
+ name: string;
244
+ type: string;
245
+ internalType: string;
246
+ }[];
247
+ outputs: {
248
+ name: string;
249
+ type: string;
250
+ internalType: string;
251
+ components: ({
252
+ name: string;
253
+ type: string;
254
+ internalType: string;
255
+ components?: undefined;
256
+ } | {
257
+ name: string;
258
+ type: string;
259
+ internalType: string;
260
+ components: {
261
+ name: string;
262
+ type: string;
263
+ internalType: string;
264
+ }[];
265
+ })[];
266
+ }[];
267
+ stateMutability: string;
268
+ } | {
269
+ type: string;
270
+ name: string;
271
+ inputs: never[];
272
+ stateMutability?: undefined;
273
+ outputs?: undefined;
274
+ })[];
275
+ export declare const REFERRALS_ABI: ({
85
276
  type: string;
86
277
  inputs: {
87
278
  name: string;
@@ -131,4 +322,32 @@ export declare const FACTORY_ABI: ({
131
322
  outputs?: undefined;
132
323
  anonymous?: undefined;
133
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
+ })[];
134
353
  export default ALL_ADDRESSES;
package/dist/index.js CHANGED
@@ -3,10 +3,16 @@ 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.FACTORY_ABI = exports.LEVERAGED_TOKEN_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"));
10
+ const global_storage_abi_json_1 = __importDefault(require("../abis/global-storage-abi.json"));
11
+ const global_storage_helper_abi_json_1 = __importDefault(require("../abis/global-storage-helper-abi.json"));
12
+ const hyperliquid_handler_abi_json_1 = __importDefault(require("../abis/hyperliquid-handler-abi.json"));
13
+ const leveraged_token_helper_abi_json_1 = __importDefault(require("../abis/leveraged-token-helper-abi.json"));
14
+ const referrals_abi_json_1 = __importDefault(require("../abis/referrals-abi.json"));
15
+ const erc20_abi_json_1 = __importDefault(require("../abis/erc20-abi.json"));
10
16
  // Export all contract addresses
11
17
  exports.ALL_ADDRESSES = addresses_json_1.default;
12
18
  // Export individual addresses for convenience
@@ -17,8 +23,15 @@ exports.HYPERLIQUID_HANDLER_ADDRESS = exports.ALL_ADDRESSES.HyperliquidHandler;
17
23
  exports.LEVERAGED_TOKEN_HELPER_ADDRESS = exports.ALL_ADDRESSES.LeveragedTokenHelper;
18
24
  exports.LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = exports.ALL_ADDRESSES.LeveragedTokenImplementation;
19
25
  exports.REFERRALS_ADDRESS = exports.ALL_ADDRESSES.Referrals;
26
+ exports.USDC_ADDRESS = exports.ALL_ADDRESSES.USDC;
20
27
  // Export ABIs
21
- exports.LEVERAGED_TOKEN_ABI = leveraged_token_abi_json_1.default;
22
28
  exports.FACTORY_ABI = factory_abi_json_1.default;
29
+ exports.GLOBAL_STORAGE_ABI = global_storage_abi_json_1.default;
30
+ exports.GLOBAL_STORAGE_HELPER_ABI = global_storage_helper_abi_json_1.default;
31
+ exports.HYPERLIQUID_HANDLER_ABI = hyperliquid_handler_abi_json_1.default;
32
+ exports.LEVERAGED_TOKEN_ABI = leveraged_token_abi_json_1.default;
33
+ exports.LEVERAGED_TOKEN_HELPER_ABI = leveraged_token_helper_abi_json_1.default;
34
+ exports.REFERRALS_ABI = referrals_abi_json_1.default;
35
+ exports.USDC_ABI = erc20_abi_json_1.default;
23
36
  // Export addresses as default for convenience
24
37
  exports.default = exports.ALL_ADDRESSES;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bouncetech/contracts",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Smart contract addresses and ABIs for Bounce Tech - DeFi Leveraged Token Protocol on HyperEVM",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",