@alephium/web3 0.2.0-rc.2 → 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.
@@ -20,8 +20,8 @@ export declare function addressFromContractId(contractId: string): string;
20
20
  export declare function contractIdFromTx(txId: string, outputIndex: number): string;
21
21
  export declare function subContractId(parentContractId: string, pathInHex: string): string;
22
22
  export declare function stringToHex(str: string): string;
23
- export declare function hexToString(str: any): string;
24
- export declare function timeout(ms: number): Promise<unknown>;
23
+ export declare function hexToString(str: string): string;
24
+ export declare function timeout(ms: number): Promise<void>;
25
25
  declare type _Eq<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
26
26
  export declare type Eq<X, Y> = _Eq<{
27
27
  [P in keyof X]: X[P];
@@ -195,7 +195,7 @@ function stringToHex(str) {
195
195
  }
196
196
  exports.stringToHex = stringToHex;
197
197
  function hexToString(str) {
198
- return buffer_1.Buffer.from(str.toString(), 'hex').toString();
198
+ return buffer_1.Buffer.from(str, 'hex').toString();
199
199
  }
200
200
  exports.hexToString = hexToString;
201
201
  function timeout(ms) {
package/gitignore CHANGED
@@ -7,4 +7,3 @@ web/
7
7
  coverage/
8
8
  /dev/
9
9
  !dev/user.conf
10
- /artifacts/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.2.0-rc.2",
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-rc2",
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",
@@ -429,12 +429,19 @@ export interface CompileContractResult {
429
429
  fields: FieldsSig
430
430
  functions: FunctionSig[]
431
431
  events: EventSig[]
432
+ warnings: string[]
433
+ }
434
+
435
+ export interface CompileProjectResult {
436
+ contracts: CompileContractResult[]
437
+ scripts: CompileScriptResult[]
432
438
  }
433
439
 
434
440
  export interface CompileScriptResult {
435
441
  bytecodeTemplate: string
436
442
  fields: FieldsSig
437
443
  functions: FunctionSig[]
444
+ warnings: string[]
438
445
  }
439
446
 
440
447
  export interface Confirmed {
@@ -561,7 +568,6 @@ export type DiscoveryAction = Reachable | Unreachable
561
568
 
562
569
  export interface EventSig {
563
570
  name: string
564
- signature: string
565
571
  fieldNames: string[]
566
572
  fieldTypes: string[]
567
573
  }
@@ -571,9 +577,9 @@ export interface FetchResponse {
571
577
  }
572
578
 
573
579
  export interface FieldsSig {
574
- signature: string
575
580
  names: string[]
576
581
  types: string[]
582
+ isMutable: boolean[]
577
583
  }
578
584
 
579
585
  export interface FixedAssetOutput {
@@ -599,9 +605,12 @@ export interface FixedAssetOutput {
599
605
 
600
606
  export interface FunctionSig {
601
607
  name: string
602
- signature: string
603
- argNames: string[]
604
- argTypes: string[]
608
+ usePreapprovedAssets: boolean
609
+ useAssetsInContract: boolean
610
+ isPublic: boolean
611
+ paramNames: string[]
612
+ paramTypes: string[]
613
+ paramIsMutable: boolean[]
605
614
  returnTypes: string[]
606
615
  }
607
616
 
@@ -703,6 +712,10 @@ export interface Penalty {
703
712
  type: string
704
713
  }
705
714
 
715
+ export interface Project {
716
+ code: string
717
+ }
718
+
706
719
  export interface Reachable {
707
720
  peers: string[]
708
721
  type: string
@@ -2160,6 +2173,27 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
2160
2173
  ...params
2161
2174
  }).then(convertHttpResponse),
2162
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
+
2163
2197
  /**
2164
2198
  * No description
2165
2199
  *