@autonomys/contracts 1.4.17
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/LICENSE +18 -0
- package/README.md +19 -0
- package/dist/abi/WAI3.json +286 -0
- package/dist/abi/index.d.ts +3 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/abi/index.js +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/contract.d.ts +4 -0
- package/dist/utils/contract.d.ts.map +1 -0
- package/dist/utils/contract.js +12 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Autonomys Network (autonomys.xyz)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
1. **Attribution**: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
2. **No Warranty**: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
15
|
+
|
|
16
|
+
3. **Limitation of Liability**: IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
+
|
|
18
|
+
---
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Autonomys Contracts
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://github.com/autonomys/auto-sdk/tags)
|
|
6
|
+
[](https://github.com/autonomys/auto-sdk/actions/workflows/build.yaml)
|
|
7
|
+
[](https://badge.fury.io/js/@autonomys%2Fauto-utils)
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
The **Autonomys Contracts** (`@autonomys/contracts`) provides a few basic Smart Contracts, ABI and helper functions to use them.
|
|
12
|
+
|
|
13
|
+
## Autonomys Taurus Testnet
|
|
14
|
+
|
|
15
|
+
### WAI3 (Equivalent of WETH)
|
|
16
|
+
|
|
17
|
+
> 0x205E735a2C73228fA13EeB70720C7841BDf65EDB
|
|
18
|
+
|
|
19
|
+
https://blockscout.taurus.autonomys.xyz/address/0x205E735a2C73228fA13EeB70720C7841BDf65EDB?tab=contract
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "receive",
|
|
4
|
+
"stateMutability": "payable"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"type": "function",
|
|
8
|
+
"name": "allowance",
|
|
9
|
+
"inputs": [
|
|
10
|
+
{
|
|
11
|
+
"name": "",
|
|
12
|
+
"type": "address",
|
|
13
|
+
"internalType": "address"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "",
|
|
17
|
+
"type": "address",
|
|
18
|
+
"internalType": "address"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"outputs": [
|
|
22
|
+
{
|
|
23
|
+
"name": "",
|
|
24
|
+
"type": "uint256",
|
|
25
|
+
"internalType": "uint256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"stateMutability": "view"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "function",
|
|
32
|
+
"name": "approve",
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"name": "guy",
|
|
36
|
+
"type": "address",
|
|
37
|
+
"internalType": "address"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "wad",
|
|
41
|
+
"type": "uint256",
|
|
42
|
+
"internalType": "uint256"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"outputs": [
|
|
46
|
+
{
|
|
47
|
+
"name": "",
|
|
48
|
+
"type": "bool",
|
|
49
|
+
"internalType": "bool"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"stateMutability": "nonpayable"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "function",
|
|
56
|
+
"name": "balanceOf",
|
|
57
|
+
"inputs": [
|
|
58
|
+
{
|
|
59
|
+
"name": "",
|
|
60
|
+
"type": "address",
|
|
61
|
+
"internalType": "address"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"outputs": [
|
|
65
|
+
{
|
|
66
|
+
"name": "",
|
|
67
|
+
"type": "uint256",
|
|
68
|
+
"internalType": "uint256"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"stateMutability": "view"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "function",
|
|
75
|
+
"name": "decimals",
|
|
76
|
+
"inputs": [],
|
|
77
|
+
"outputs": [
|
|
78
|
+
{
|
|
79
|
+
"name": "",
|
|
80
|
+
"type": "uint8",
|
|
81
|
+
"internalType": "uint8"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"stateMutability": "view"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "function",
|
|
88
|
+
"name": "deposit",
|
|
89
|
+
"inputs": [],
|
|
90
|
+
"outputs": [],
|
|
91
|
+
"stateMutability": "payable"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "function",
|
|
95
|
+
"name": "name",
|
|
96
|
+
"inputs": [],
|
|
97
|
+
"outputs": [
|
|
98
|
+
{
|
|
99
|
+
"name": "",
|
|
100
|
+
"type": "string",
|
|
101
|
+
"internalType": "string"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"stateMutability": "view"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "function",
|
|
108
|
+
"name": "symbol",
|
|
109
|
+
"inputs": [],
|
|
110
|
+
"outputs": [
|
|
111
|
+
{
|
|
112
|
+
"name": "",
|
|
113
|
+
"type": "string",
|
|
114
|
+
"internalType": "string"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"stateMutability": "view"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "function",
|
|
121
|
+
"name": "totalSupply",
|
|
122
|
+
"inputs": [],
|
|
123
|
+
"outputs": [
|
|
124
|
+
{
|
|
125
|
+
"name": "",
|
|
126
|
+
"type": "uint256",
|
|
127
|
+
"internalType": "uint256"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"stateMutability": "view"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "function",
|
|
134
|
+
"name": "transfer",
|
|
135
|
+
"inputs": [
|
|
136
|
+
{
|
|
137
|
+
"name": "dst",
|
|
138
|
+
"type": "address",
|
|
139
|
+
"internalType": "address"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "wad",
|
|
143
|
+
"type": "uint256",
|
|
144
|
+
"internalType": "uint256"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"outputs": [
|
|
148
|
+
{
|
|
149
|
+
"name": "",
|
|
150
|
+
"type": "bool",
|
|
151
|
+
"internalType": "bool"
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"stateMutability": "nonpayable"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "function",
|
|
158
|
+
"name": "transferFrom",
|
|
159
|
+
"inputs": [
|
|
160
|
+
{
|
|
161
|
+
"name": "src",
|
|
162
|
+
"type": "address",
|
|
163
|
+
"internalType": "address"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "dst",
|
|
167
|
+
"type": "address",
|
|
168
|
+
"internalType": "address"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "wad",
|
|
172
|
+
"type": "uint256",
|
|
173
|
+
"internalType": "uint256"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"outputs": [
|
|
177
|
+
{
|
|
178
|
+
"name": "",
|
|
179
|
+
"type": "bool",
|
|
180
|
+
"internalType": "bool"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"stateMutability": "nonpayable"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "function",
|
|
187
|
+
"name": "withdraw",
|
|
188
|
+
"inputs": [
|
|
189
|
+
{
|
|
190
|
+
"name": "wad",
|
|
191
|
+
"type": "uint256",
|
|
192
|
+
"internalType": "uint256"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"outputs": [],
|
|
196
|
+
"stateMutability": "nonpayable"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"type": "event",
|
|
200
|
+
"name": "Approval",
|
|
201
|
+
"inputs": [
|
|
202
|
+
{
|
|
203
|
+
"name": "src",
|
|
204
|
+
"type": "address",
|
|
205
|
+
"indexed": true,
|
|
206
|
+
"internalType": "address"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "guy",
|
|
210
|
+
"type": "address",
|
|
211
|
+
"indexed": true,
|
|
212
|
+
"internalType": "address"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "wad",
|
|
216
|
+
"type": "uint256",
|
|
217
|
+
"indexed": false,
|
|
218
|
+
"internalType": "uint256"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"anonymous": false
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "event",
|
|
225
|
+
"name": "Deposit",
|
|
226
|
+
"inputs": [
|
|
227
|
+
{
|
|
228
|
+
"name": "dst",
|
|
229
|
+
"type": "address",
|
|
230
|
+
"indexed": true,
|
|
231
|
+
"internalType": "address"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "wad",
|
|
235
|
+
"type": "uint256",
|
|
236
|
+
"indexed": false,
|
|
237
|
+
"internalType": "uint256"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"anonymous": false
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"type": "event",
|
|
244
|
+
"name": "Transfer",
|
|
245
|
+
"inputs": [
|
|
246
|
+
{
|
|
247
|
+
"name": "src",
|
|
248
|
+
"type": "address",
|
|
249
|
+
"indexed": true,
|
|
250
|
+
"internalType": "address"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "dst",
|
|
254
|
+
"type": "address",
|
|
255
|
+
"indexed": true,
|
|
256
|
+
"internalType": "address"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "wad",
|
|
260
|
+
"type": "uint256",
|
|
261
|
+
"indexed": false,
|
|
262
|
+
"internalType": "uint256"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"anonymous": false
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"type": "event",
|
|
269
|
+
"name": "Withdrawal",
|
|
270
|
+
"inputs": [
|
|
271
|
+
{
|
|
272
|
+
"name": "src",
|
|
273
|
+
"type": "address",
|
|
274
|
+
"indexed": true,
|
|
275
|
+
"internalType": "address"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "wad",
|
|
279
|
+
"type": "uint256",
|
|
280
|
+
"indexed": false,
|
|
281
|
+
"internalType": "uint256"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"anonymous": false
|
|
285
|
+
}
|
|
286
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WAI3ABI = void 0;
|
|
7
|
+
const WAI3_json_1 = __importDefault(require("./WAI3.json"));
|
|
8
|
+
exports.WAI3ABI = WAI3_json_1.default;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./abi"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/utils/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,QAAQ,CAAA;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,eAAO,MAAM,YAAY,GAAI,SAAS,eAAe,aAOpD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAI3Contract = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const abi_1 = require("../abi");
|
|
6
|
+
const WAI3Contract = (options) => {
|
|
7
|
+
const { address, privateKey, rpcUrl } = options;
|
|
8
|
+
const provider = new ethers_1.JsonRpcProvider(rpcUrl);
|
|
9
|
+
const wallet = new ethers_1.Wallet(privateKey, provider);
|
|
10
|
+
return new ethers_1.Contract(address, abi_1.WAI3ABI, wallet);
|
|
11
|
+
};
|
|
12
|
+
exports.WAI3Contract = WAI3Contract;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAI3Contract = void 0;
|
|
4
|
+
const contract_1 = require("./contract");
|
|
5
|
+
Object.defineProperty(exports, "WAI3Contract", { enumerable: true, get: function () { return contract_1.WAI3Contract; } });
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@autonomys/contracts",
|
|
3
|
+
"version": "1.4.17",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/autonomys/auto-sdk"
|
|
9
|
+
},
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Autonomys",
|
|
12
|
+
"url": "https://www.autonomys.xyz"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/autonomys/auto-sdk/issues"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"generate-abi": "ts-node scripts/index.ts",
|
|
20
|
+
"clean": "rm -rf dist",
|
|
21
|
+
"format": "prettier --write \"src/**/*.ts\""
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"eslint": "^9.23.0",
|
|
29
|
+
"prettier": "^3.5.3",
|
|
30
|
+
"ts-node": "^10.9.2",
|
|
31
|
+
"typescript": "^5.4.5"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"ethers": "6.13.5"
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "d921e7787652cf71e47a9785303a41c7f4f8d0fd"
|
|
37
|
+
}
|