@alephium/web3 0.2.0-rc.11 → 0.2.0-rc.13
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 +72 -11
- package/dist/src/api/api-alephium.js +130 -80
- package/dist/src/api/api-explorer.js +24 -33
- package/dist/src/api/utils.d.ts +6 -0
- package/dist/{scripts/stop-devnet.js → src/api/utils.js} +9 -12
- package/dist/src/contract/contract.d.ts +6 -4
- package/dist/src/contract/contract.js +32 -30
- package/dist/src/utils/utils.d.ts +0 -7
- package/dist/src/utils/utils.js +1 -10
- package/package.json +6 -15
- package/src/api/api-alephium.ts +113 -25
- package/src/api/api-explorer.ts +1 -11
- package/{scripts/stop-devnet.js → src/api/utils.ts} +5 -12
- package/src/contract/contract.ts +43 -40
- package/src/utils/utils.ts +0 -12
- package/contracts/greeter/greeter.ral +0 -7
- package/contracts/greeter/greeter_interface.ral +0 -4
- package/contracts/greeter_main.ral +0 -7
- package/dev/user.conf +0 -29
- package/dist/scripts/create-project.d.ts +0 -2
- package/dist/scripts/create-project.js +0 -125
- package/dist/scripts/start-devnet.d.ts +0 -1
- package/dist/scripts/start-devnet.js +0 -131
- package/dist/scripts/stop-devnet.d.ts +0 -1
- package/scripts/create-project.ts +0 -137
- package/scripts/start-devnet.js +0 -141
- package/templates/base/README.md +0 -34
- package/templates/base/package.json +0 -35
- package/templates/base/src/greeter.ts +0 -42
- package/templates/base/tsconfig.json +0 -19
- package/templates/react/README.md +0 -34
- package/templates/react/config-overrides.js +0 -18
- package/templates/react/package.json +0 -66
- package/templates/react/src/App.tsx +0 -42
- package/templates/react/src/artifacts/greeter.ral.json +0 -26
- package/templates/react/src/artifacts/greeter_main.ral.json +0 -22
- package/templates/shared/.eslintrc.json +0 -12
- package/templates/shared/scripts/header.js +0 -0
|
@@ -85,6 +85,10 @@ export interface Banned {
|
|
|
85
85
|
until: number;
|
|
86
86
|
type: string;
|
|
87
87
|
}
|
|
88
|
+
export interface BlockAndEvents {
|
|
89
|
+
block: BlockEntry;
|
|
90
|
+
events: ContractEventByBlockHash[];
|
|
91
|
+
}
|
|
88
92
|
export interface BlockEntry {
|
|
89
93
|
/** @format block-hash */
|
|
90
94
|
hash: string;
|
|
@@ -121,6 +125,12 @@ export interface BlockHeaderEntry {
|
|
|
121
125
|
height: number;
|
|
122
126
|
deps: string[];
|
|
123
127
|
}
|
|
128
|
+
export interface BlocksAndEventsPerTimeStampRange {
|
|
129
|
+
blocksAndEvents: BlockAndEvents[][];
|
|
130
|
+
}
|
|
131
|
+
export interface BlocksPerTimeStampRange {
|
|
132
|
+
blocks: BlockEntry[][];
|
|
133
|
+
}
|
|
124
134
|
export interface BrokerInfo {
|
|
125
135
|
/** @format clique-id */
|
|
126
136
|
cliqueId: string;
|
|
@@ -359,6 +369,15 @@ export interface ContractEvent {
|
|
|
359
369
|
eventIndex: number;
|
|
360
370
|
fields: Val[];
|
|
361
371
|
}
|
|
372
|
+
export interface ContractEventByBlockHash {
|
|
373
|
+
/** @format 32-byte-hash */
|
|
374
|
+
txId: string;
|
|
375
|
+
/** @format address */
|
|
376
|
+
contractAddress: string;
|
|
377
|
+
/** @format int32 */
|
|
378
|
+
eventIndex: number;
|
|
379
|
+
fields: Val[];
|
|
380
|
+
}
|
|
362
381
|
export interface ContractEventByTxId {
|
|
363
382
|
/** @format block-hash */
|
|
364
383
|
blockHash: string;
|
|
@@ -373,10 +392,11 @@ export interface ContractEvents {
|
|
|
373
392
|
/** @format int32 */
|
|
374
393
|
nextStart: number;
|
|
375
394
|
}
|
|
395
|
+
export interface ContractEventsByBlockHash {
|
|
396
|
+
events: ContractEventByBlockHash[];
|
|
397
|
+
}
|
|
376
398
|
export interface ContractEventsByTxId {
|
|
377
399
|
events: ContractEventByTxId[];
|
|
378
|
-
/** @format int32 */
|
|
379
|
-
nextStart: number;
|
|
380
400
|
}
|
|
381
401
|
export interface ContractOutput {
|
|
382
402
|
/** @format int32 */
|
|
@@ -429,9 +449,6 @@ export interface EventSig {
|
|
|
429
449
|
fieldNames: string[];
|
|
430
450
|
fieldTypes: string[];
|
|
431
451
|
}
|
|
432
|
-
export interface FetchResponse {
|
|
433
|
-
blocks: BlockEntry[][];
|
|
434
|
-
}
|
|
435
452
|
export interface FieldsSig {
|
|
436
453
|
names: string[];
|
|
437
454
|
types: string[];
|
|
@@ -1178,14 +1195,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1178
1195
|
* No description
|
|
1179
1196
|
*
|
|
1180
1197
|
* @tags Blockflow
|
|
1181
|
-
* @name
|
|
1198
|
+
* @name GetBlockflowBlocks
|
|
1182
1199
|
* @summary List blocks on the given time interval
|
|
1183
|
-
* @request GET:/blockflow
|
|
1200
|
+
* @request GET:/blockflow/blocks
|
|
1184
1201
|
*/
|
|
1185
|
-
|
|
1202
|
+
getBlockflowBlocks: (query: {
|
|
1186
1203
|
fromTs: number;
|
|
1187
1204
|
toTs?: number;
|
|
1188
|
-
}, params?: RequestParams) => Promise<
|
|
1205
|
+
}, params?: RequestParams) => Promise<BlocksPerTimeStampRange>;
|
|
1206
|
+
/**
|
|
1207
|
+
* No description
|
|
1208
|
+
*
|
|
1209
|
+
* @tags Blockflow
|
|
1210
|
+
* @name GetBlockflowBlocksWithEvents
|
|
1211
|
+
* @summary List blocks with events on the given time interval
|
|
1212
|
+
* @request GET:/blockflow/blocks-with-events
|
|
1213
|
+
*/
|
|
1214
|
+
getBlockflowBlocksWithEvents: (query: {
|
|
1215
|
+
fromTs: number;
|
|
1216
|
+
toTs?: number;
|
|
1217
|
+
}, params?: RequestParams) => Promise<BlocksAndEventsPerTimeStampRange>;
|
|
1189
1218
|
/**
|
|
1190
1219
|
* No description
|
|
1191
1220
|
*
|
|
@@ -1195,6 +1224,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1195
1224
|
* @request GET:/blockflow/blocks/{block_hash}
|
|
1196
1225
|
*/
|
|
1197
1226
|
getBlockflowBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockEntry>;
|
|
1227
|
+
/**
|
|
1228
|
+
* No description
|
|
1229
|
+
*
|
|
1230
|
+
* @tags Blockflow
|
|
1231
|
+
* @name GetBlockflowBlocksWithEventsBlockHash
|
|
1232
|
+
* @summary Get a block and events with hash
|
|
1233
|
+
* @request GET:/blockflow/blocks-with-events/{block_hash}
|
|
1234
|
+
*/
|
|
1235
|
+
getBlockflowBlocksWithEventsBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockAndEvents>;
|
|
1198
1236
|
/**
|
|
1199
1237
|
* No description
|
|
1200
1238
|
*
|
|
@@ -1467,6 +1505,18 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1467
1505
|
postMinersCpuMining: (query: {
|
|
1468
1506
|
action: string;
|
|
1469
1507
|
}, params?: RequestParams) => Promise<boolean>;
|
|
1508
|
+
/**
|
|
1509
|
+
* No description
|
|
1510
|
+
*
|
|
1511
|
+
* @tags Miners
|
|
1512
|
+
* @name PostMinersCpuMiningMineOneBlock
|
|
1513
|
+
* @summary Mine a block on CPU miner. !!! for test only !!!
|
|
1514
|
+
* @request POST:/miners/cpu-mining/mine-one-block
|
|
1515
|
+
*/
|
|
1516
|
+
postMinersCpuMiningMineOneBlock: (query: {
|
|
1517
|
+
fromGroup: number;
|
|
1518
|
+
toGroup: number;
|
|
1519
|
+
}, params?: RequestParams) => Promise<boolean>;
|
|
1470
1520
|
/**
|
|
1471
1521
|
* No description
|
|
1472
1522
|
*
|
|
@@ -1497,7 +1547,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1497
1547
|
*/
|
|
1498
1548
|
getEventsContractContractaddress: (contractAddress: string, query: {
|
|
1499
1549
|
start: number;
|
|
1500
|
-
|
|
1550
|
+
limit?: number;
|
|
1501
1551
|
group?: number;
|
|
1502
1552
|
}, params?: RequestParams) => Promise<ContractEvents>;
|
|
1503
1553
|
/**
|
|
@@ -1514,12 +1564,23 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1514
1564
|
*
|
|
1515
1565
|
* @tags Events
|
|
1516
1566
|
* @name GetEventsTxIdTxid
|
|
1517
|
-
* @summary Get events for a
|
|
1567
|
+
* @summary Get contract events for a transaction
|
|
1518
1568
|
* @request GET:/events/tx-id/{txId}
|
|
1519
1569
|
*/
|
|
1520
1570
|
getEventsTxIdTxid: (txId: string, query?: {
|
|
1521
1571
|
group?: number;
|
|
1522
1572
|
}, params?: RequestParams) => Promise<ContractEventsByTxId>;
|
|
1573
|
+
/**
|
|
1574
|
+
* No description
|
|
1575
|
+
*
|
|
1576
|
+
* @tags Events
|
|
1577
|
+
* @name GetEventsBlockHashBlockhash
|
|
1578
|
+
* @summary Get contract events for a block
|
|
1579
|
+
* @request GET:/events/block-hash/{blockHash}
|
|
1580
|
+
*/
|
|
1581
|
+
getEventsBlockHashBlockhash: (blockHash: string, query?: {
|
|
1582
|
+
group?: number;
|
|
1583
|
+
}, params?: RequestParams) => Promise<ContractEventsByBlockHash>;
|
|
1523
1584
|
};
|
|
1524
1585
|
}
|
|
1525
1586
|
export {};
|