@alephium/web3 0.2.0-rc.4 → 0.2.0-rc.5
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/contracts/add/add.ral +5 -6
- package/contracts/greeter/greeter.ral +2 -2
- package/contracts/greeter/greeter_interface.ral +1 -0
- package/contracts/greeter_main.ral +0 -2
- package/contracts/main.ral +0 -2
- package/contracts/sub/sub.ral +1 -0
- package/contracts/test/metadata.ral +1 -0
- package/contracts/test/warnings.ral +1 -0
- package/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/api-alephium.d.ts +16 -0
- package/dist/src/api/api-alephium.js +16 -0
- package/dist/src/contract/contract.d.ts +65 -47
- package/dist/src/contract/contract.js +296 -234
- package/gitignore +0 -1
- package/package.json +2 -4
- package/src/api/api-alephium.ts +30 -0
- package/src/contract/contract.ts +377 -350
- package/templates/base/package.json +2 -2
- package/templates/react/package.json +2 -2
- package/test/contract.test.ts +32 -19
- package/test/events.test.ts +13 -8
- package/test/transaction.test.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/web3",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.5",
|
|
4
4
|
"description": "A JS/TS library to interact with the Alephium platform",
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"author": "Alephium dev <dev@alephium.org>",
|
|
29
29
|
"config": {
|
|
30
|
-
"alephium_version": "1.5.0-
|
|
30
|
+
"alephium_version": "1.5.0-rc5",
|
|
31
31
|
"explorer_backend_version": "1.7.1"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
@@ -88,7 +88,6 @@
|
|
|
88
88
|
"eslint-config-prettier": "^8.5.0",
|
|
89
89
|
"eslint-plugin-header": "^3.1.1",
|
|
90
90
|
"eslint-plugin-prettier": "^4.0.0",
|
|
91
|
-
"eslint-plugin-react": "^7.29.4",
|
|
92
91
|
"eslint-plugin-security": "1.4.0",
|
|
93
92
|
"html-webpack-plugin": "5.5.0",
|
|
94
93
|
"jest": "^28.1.0",
|
|
@@ -98,7 +97,6 @@
|
|
|
98
97
|
"mock-socket": "^9.0.8",
|
|
99
98
|
"prettier": "^2.3.2",
|
|
100
99
|
"process": "^0.11.10",
|
|
101
|
-
"react-app-rewired": "^2.2.1",
|
|
102
100
|
"rewire": "^6.0.0",
|
|
103
101
|
"shelljs": "^0.8.5",
|
|
104
102
|
"stream-browserify": "^3.0.0",
|
package/src/api/api-alephium.ts
CHANGED
|
@@ -432,6 +432,11 @@ export interface CompileContractResult {
|
|
|
432
432
|
warnings: string[]
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
export interface CompileProjectResult {
|
|
436
|
+
contracts: CompileContractResult[]
|
|
437
|
+
scripts: CompileScriptResult[]
|
|
438
|
+
}
|
|
439
|
+
|
|
435
440
|
export interface CompileScriptResult {
|
|
436
441
|
bytecodeTemplate: string
|
|
437
442
|
fields: FieldsSig
|
|
@@ -707,6 +712,10 @@ export interface Penalty {
|
|
|
707
712
|
type: string
|
|
708
713
|
}
|
|
709
714
|
|
|
715
|
+
export interface Project {
|
|
716
|
+
code: string
|
|
717
|
+
}
|
|
718
|
+
|
|
710
719
|
export interface Reachable {
|
|
711
720
|
peers: string[]
|
|
712
721
|
type: string
|
|
@@ -2164,6 +2173,27 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
2164
2173
|
...params
|
|
2165
2174
|
}).then(convertHttpResponse),
|
|
2166
2175
|
|
|
2176
|
+
/**
|
|
2177
|
+
* No description
|
|
2178
|
+
*
|
|
2179
|
+
* @tags Contracts
|
|
2180
|
+
* @name PostContractsCompileProject
|
|
2181
|
+
* @summary Compile a project
|
|
2182
|
+
* @request POST:/contracts/compile-project
|
|
2183
|
+
*/
|
|
2184
|
+
postContractsCompileProject: (data: Project, params: RequestParams = {}) =>
|
|
2185
|
+
this.request<
|
|
2186
|
+
CompileProjectResult,
|
|
2187
|
+
BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
|
|
2188
|
+
>({
|
|
2189
|
+
path: `/contracts/compile-project`,
|
|
2190
|
+
method: 'POST',
|
|
2191
|
+
body: data,
|
|
2192
|
+
type: ContentType.Json,
|
|
2193
|
+
format: 'json',
|
|
2194
|
+
...params
|
|
2195
|
+
}).then(convertHttpResponse),
|
|
2196
|
+
|
|
2167
2197
|
/**
|
|
2168
2198
|
* No description
|
|
2169
2199
|
*
|