@alephium/web3 0.7.0 → 0.8.0
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/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/api-alephium.d.ts +1 -1
- package/dist/src/api/api-alephium.js +1 -1
- package/dist/src/api/api-explorer.d.ts +40 -0
- package/dist/src/api/api-explorer.js +29 -0
- package/package.json +3 -3
- package/src/api/api-alephium.ts +1 -1
- package/src/api/api-explorer.ts +60 -0
- package/std/{token_interface.ral → fungible_token_interface.ral} +1 -1
- package/std/nft_collection_interface.ral +8 -0
- package/std/nft_interface.ral +3 -0
|
@@ -928,7 +928,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
928
928
|
}
|
|
929
929
|
/**
|
|
930
930
|
* @title Alephium API
|
|
931
|
-
* @version
|
|
931
|
+
* @version 2.0.1
|
|
932
932
|
* @baseUrl ../
|
|
933
933
|
*/
|
|
934
934
|
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
@@ -11,6 +11,7 @@ export interface AcceptedTransaction {
|
|
|
11
11
|
gasAmount: number;
|
|
12
12
|
/** @format uint256 */
|
|
13
13
|
gasPrice: string;
|
|
14
|
+
scriptExecutionOk: boolean;
|
|
14
15
|
coinbase: boolean;
|
|
15
16
|
type: string;
|
|
16
17
|
}
|
|
@@ -80,6 +81,10 @@ export interface ContractOutput {
|
|
|
80
81
|
spent?: string;
|
|
81
82
|
type: string;
|
|
82
83
|
}
|
|
84
|
+
export interface ContractParent {
|
|
85
|
+
/** @format address */
|
|
86
|
+
parent?: string;
|
|
87
|
+
}
|
|
83
88
|
export interface Event {
|
|
84
89
|
/** @format block-hash */
|
|
85
90
|
blockHash: string;
|
|
@@ -211,6 +216,9 @@ export interface PerChainTimedCount {
|
|
|
211
216
|
export interface ServiceUnavailable {
|
|
212
217
|
detail: string;
|
|
213
218
|
}
|
|
219
|
+
export interface SubContracts {
|
|
220
|
+
subContracts?: string[];
|
|
221
|
+
}
|
|
214
222
|
export interface TimedCount {
|
|
215
223
|
/** @format int64 */
|
|
216
224
|
timestamp: number;
|
|
@@ -250,6 +258,7 @@ export interface Transaction {
|
|
|
250
258
|
gasAmount: number;
|
|
251
259
|
/** @format uint256 */
|
|
252
260
|
gasPrice: string;
|
|
261
|
+
scriptExecutionOk: boolean;
|
|
253
262
|
coinbase: boolean;
|
|
254
263
|
}
|
|
255
264
|
export declare type TransactionLike = AcceptedTransaction | PendingTransaction;
|
|
@@ -853,6 +862,37 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
853
862
|
reverse?: boolean;
|
|
854
863
|
}, params?: RequestParams) => Promise<Event[]>;
|
|
855
864
|
};
|
|
865
|
+
contracts: {
|
|
866
|
+
/**
|
|
867
|
+
* @description Get contract parent address if exist
|
|
868
|
+
*
|
|
869
|
+
* @tags Contracts
|
|
870
|
+
* @name GetContractsContractParent
|
|
871
|
+
* @request GET:/contracts/{contract}/parent
|
|
872
|
+
*/
|
|
873
|
+
getContractsContractParent: (contract: string, params?: RequestParams) => Promise<ContractParent>;
|
|
874
|
+
/**
|
|
875
|
+
* @description Get sub contract addresses
|
|
876
|
+
*
|
|
877
|
+
* @tags Contracts
|
|
878
|
+
* @name GetContractsContractSubContracts
|
|
879
|
+
* @request GET:/contracts/{contract}/sub-contracts
|
|
880
|
+
*/
|
|
881
|
+
getContractsContractSubContracts: (contract: string, query?: {
|
|
882
|
+
/**
|
|
883
|
+
* Page number
|
|
884
|
+
* @format int32
|
|
885
|
+
*/
|
|
886
|
+
page?: number;
|
|
887
|
+
/**
|
|
888
|
+
* Number of items per page
|
|
889
|
+
* @format int32
|
|
890
|
+
*/
|
|
891
|
+
limit?: number;
|
|
892
|
+
/** Reverse pagination */
|
|
893
|
+
reverse?: boolean;
|
|
894
|
+
}, params?: RequestParams) => Promise<SubContracts>;
|
|
895
|
+
};
|
|
856
896
|
utils: {
|
|
857
897
|
/**
|
|
858
898
|
* @description Perform a sanity check
|
|
@@ -636,6 +636,35 @@ class Api extends HttpClient {
|
|
|
636
636
|
...params
|
|
637
637
|
}).then(utils_1.convertHttpResponse)
|
|
638
638
|
};
|
|
639
|
+
this.contracts = {
|
|
640
|
+
/**
|
|
641
|
+
* @description Get contract parent address if exist
|
|
642
|
+
*
|
|
643
|
+
* @tags Contracts
|
|
644
|
+
* @name GetContractsContractParent
|
|
645
|
+
* @request GET:/contracts/{contract}/parent
|
|
646
|
+
*/
|
|
647
|
+
getContractsContractParent: (contract, params = {}) => this.request({
|
|
648
|
+
path: `/contracts/${contract}/parent`,
|
|
649
|
+
method: 'GET',
|
|
650
|
+
format: 'json',
|
|
651
|
+
...params
|
|
652
|
+
}).then(utils_1.convertHttpResponse),
|
|
653
|
+
/**
|
|
654
|
+
* @description Get sub contract addresses
|
|
655
|
+
*
|
|
656
|
+
* @tags Contracts
|
|
657
|
+
* @name GetContractsContractSubContracts
|
|
658
|
+
* @request GET:/contracts/{contract}/sub-contracts
|
|
659
|
+
*/
|
|
660
|
+
getContractsContractSubContracts: (contract, query, params = {}) => this.request({
|
|
661
|
+
path: `/contracts/${contract}/sub-contracts`,
|
|
662
|
+
method: 'GET',
|
|
663
|
+
query: query,
|
|
664
|
+
format: 'json',
|
|
665
|
+
...params
|
|
666
|
+
}).then(utils_1.convertHttpResponse)
|
|
667
|
+
};
|
|
639
668
|
this.utils = {
|
|
640
669
|
/**
|
|
641
670
|
* @description Perform a sanity check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/web3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"author": "Alephium dev <dev@alephium.org>",
|
|
29
29
|
"config": {
|
|
30
|
-
"alephium_version": "
|
|
31
|
-
"explorer_backend_version": "1.13.
|
|
30
|
+
"alephium_version": "2.0.1",
|
|
31
|
+
"explorer_backend_version": "1.13.3"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rm -rf dist/* && npx tsc --build . && webpack",
|
package/src/api/api-alephium.ts
CHANGED
|
@@ -1216,7 +1216,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
1216
1216
|
|
|
1217
1217
|
/**
|
|
1218
1218
|
* @title Alephium API
|
|
1219
|
-
* @version
|
|
1219
|
+
* @version 2.0.1
|
|
1220
1220
|
* @baseUrl ../
|
|
1221
1221
|
*/
|
|
1222
1222
|
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
package/src/api/api-explorer.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface AcceptedTransaction {
|
|
|
22
22
|
gasAmount: number
|
|
23
23
|
/** @format uint256 */
|
|
24
24
|
gasPrice: string
|
|
25
|
+
scriptExecutionOk: boolean
|
|
25
26
|
coinbase: boolean
|
|
26
27
|
type: string
|
|
27
28
|
}
|
|
@@ -98,6 +99,11 @@ export interface ContractOutput {
|
|
|
98
99
|
type: string
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
export interface ContractParent {
|
|
103
|
+
/** @format address */
|
|
104
|
+
parent?: string
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
export interface Event {
|
|
102
108
|
/** @format block-hash */
|
|
103
109
|
blockHash: string
|
|
@@ -247,6 +253,10 @@ export interface ServiceUnavailable {
|
|
|
247
253
|
detail: string
|
|
248
254
|
}
|
|
249
255
|
|
|
256
|
+
export interface SubContracts {
|
|
257
|
+
subContracts?: string[]
|
|
258
|
+
}
|
|
259
|
+
|
|
250
260
|
export interface TimedCount {
|
|
251
261
|
/** @format int64 */
|
|
252
262
|
timestamp: number
|
|
@@ -289,6 +299,7 @@ export interface Transaction {
|
|
|
289
299
|
gasAmount: number
|
|
290
300
|
/** @format uint256 */
|
|
291
301
|
gasPrice: string
|
|
302
|
+
scriptExecutionOk: boolean
|
|
292
303
|
coinbase: boolean
|
|
293
304
|
}
|
|
294
305
|
|
|
@@ -1369,6 +1380,55 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1369
1380
|
...params
|
|
1370
1381
|
}).then(convertHttpResponse)
|
|
1371
1382
|
}
|
|
1383
|
+
contracts = {
|
|
1384
|
+
/**
|
|
1385
|
+
* @description Get contract parent address if exist
|
|
1386
|
+
*
|
|
1387
|
+
* @tags Contracts
|
|
1388
|
+
* @name GetContractsContractParent
|
|
1389
|
+
* @request GET:/contracts/{contract}/parent
|
|
1390
|
+
*/
|
|
1391
|
+
getContractsContractParent: (contract: string, params: RequestParams = {}) =>
|
|
1392
|
+
this.request<ContractParent, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
1393
|
+
path: `/contracts/${contract}/parent`,
|
|
1394
|
+
method: 'GET',
|
|
1395
|
+
format: 'json',
|
|
1396
|
+
...params
|
|
1397
|
+
}).then(convertHttpResponse),
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* @description Get sub contract addresses
|
|
1401
|
+
*
|
|
1402
|
+
* @tags Contracts
|
|
1403
|
+
* @name GetContractsContractSubContracts
|
|
1404
|
+
* @request GET:/contracts/{contract}/sub-contracts
|
|
1405
|
+
*/
|
|
1406
|
+
getContractsContractSubContracts: (
|
|
1407
|
+
contract: string,
|
|
1408
|
+
query?: {
|
|
1409
|
+
/**
|
|
1410
|
+
* Page number
|
|
1411
|
+
* @format int32
|
|
1412
|
+
*/
|
|
1413
|
+
page?: number
|
|
1414
|
+
/**
|
|
1415
|
+
* Number of items per page
|
|
1416
|
+
* @format int32
|
|
1417
|
+
*/
|
|
1418
|
+
limit?: number
|
|
1419
|
+
/** Reverse pagination */
|
|
1420
|
+
reverse?: boolean
|
|
1421
|
+
},
|
|
1422
|
+
params: RequestParams = {}
|
|
1423
|
+
) =>
|
|
1424
|
+
this.request<SubContracts, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
1425
|
+
path: `/contracts/${contract}/sub-contracts`,
|
|
1426
|
+
method: 'GET',
|
|
1427
|
+
query: query,
|
|
1428
|
+
format: 'json',
|
|
1429
|
+
...params
|
|
1430
|
+
}).then(convertHttpResponse)
|
|
1431
|
+
}
|
|
1372
1432
|
utils = {
|
|
1373
1433
|
/**
|
|
1374
1434
|
* @description Perform a sanity check
|