@alephium/web3 1.7.3 → 1.7.4
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 +114 -1
- package/dist/src/api/api-alephium.js +30 -1
- package/dist/src/api/api-explorer.d.ts +55 -0
- package/dist/src/api/api-explorer.js +28 -0
- package/dist/src/contract/contract.d.ts +3 -1
- package/dist/src/contract/contract.js +4 -2
- package/dist/src/utils/utils.d.ts +3 -0
- package/package.json +3 -3
- package/src/api/api-alephium.ts +144 -1
- package/src/api/api-explorer.ts +79 -0
- package/src/contract/contract.ts +5 -2
- package/src/utils/utils.ts +8 -0
|
@@ -818,6 +818,90 @@ export interface RevealMnemonic {
|
|
|
818
818
|
export interface RevealMnemonicResult {
|
|
819
819
|
mnemonic: string;
|
|
820
820
|
}
|
|
821
|
+
/** RichAssetInput */
|
|
822
|
+
export interface RichAssetInput {
|
|
823
|
+
/** @format int32 */
|
|
824
|
+
hint: number;
|
|
825
|
+
/** @format 32-byte-hash */
|
|
826
|
+
key: string;
|
|
827
|
+
/** @format hex-string */
|
|
828
|
+
unlockScript: string;
|
|
829
|
+
/** @format uint256 */
|
|
830
|
+
attoAlphAmount: string;
|
|
831
|
+
/** @format address */
|
|
832
|
+
address: string;
|
|
833
|
+
tokens: Token[];
|
|
834
|
+
}
|
|
835
|
+
/** RichBlockAndEvents */
|
|
836
|
+
export interface RichBlockAndEvents {
|
|
837
|
+
block: RichBlockEntry;
|
|
838
|
+
events: ContractEventByBlockHash[];
|
|
839
|
+
}
|
|
840
|
+
/** RichBlockEntry */
|
|
841
|
+
export interface RichBlockEntry {
|
|
842
|
+
/** @format block-hash */
|
|
843
|
+
hash: string;
|
|
844
|
+
/** @format int64 */
|
|
845
|
+
timestamp: number;
|
|
846
|
+
/** @format int32 */
|
|
847
|
+
chainFrom: number;
|
|
848
|
+
/** @format int32 */
|
|
849
|
+
chainTo: number;
|
|
850
|
+
/** @format int32 */
|
|
851
|
+
height: number;
|
|
852
|
+
deps: string[];
|
|
853
|
+
transactions: RichTransaction[];
|
|
854
|
+
/** @format hex-string */
|
|
855
|
+
nonce: string;
|
|
856
|
+
version: number;
|
|
857
|
+
/** @format 32-byte-hash */
|
|
858
|
+
depStateHash: string;
|
|
859
|
+
/** @format 32-byte-hash */
|
|
860
|
+
txsHash: string;
|
|
861
|
+
/** @format hex-string */
|
|
862
|
+
target: string;
|
|
863
|
+
ghostUncles: GhostUncleBlockEntry[];
|
|
864
|
+
}
|
|
865
|
+
/** RichBlocksAndEventsPerTimeStampRange */
|
|
866
|
+
export interface RichBlocksAndEventsPerTimeStampRange {
|
|
867
|
+
blocksAndEvents: RichBlockAndEvents[][];
|
|
868
|
+
}
|
|
869
|
+
/** RichContractInput */
|
|
870
|
+
export interface RichContractInput {
|
|
871
|
+
/** @format int32 */
|
|
872
|
+
hint: number;
|
|
873
|
+
/** @format 32-byte-hash */
|
|
874
|
+
key: string;
|
|
875
|
+
/** @format uint256 */
|
|
876
|
+
attoAlphAmount: string;
|
|
877
|
+
/** @format address */
|
|
878
|
+
address: string;
|
|
879
|
+
tokens: Token[];
|
|
880
|
+
}
|
|
881
|
+
/** RichTransaction */
|
|
882
|
+
export interface RichTransaction {
|
|
883
|
+
unsigned: RichUnsignedTx;
|
|
884
|
+
scriptExecutionOk: boolean;
|
|
885
|
+
contractInputs: RichContractInput[];
|
|
886
|
+
generatedOutputs: Output[];
|
|
887
|
+
inputSignatures: string[];
|
|
888
|
+
scriptSignatures: string[];
|
|
889
|
+
}
|
|
890
|
+
/** RichUnsignedTx */
|
|
891
|
+
export interface RichUnsignedTx {
|
|
892
|
+
/** @format 32-byte-hash */
|
|
893
|
+
txId: string;
|
|
894
|
+
version: number;
|
|
895
|
+
networkId: number;
|
|
896
|
+
/** @format script */
|
|
897
|
+
scriptOpt?: string;
|
|
898
|
+
/** @format int32 */
|
|
899
|
+
gasAmount: number;
|
|
900
|
+
/** @format uint256 */
|
|
901
|
+
gasPrice: string;
|
|
902
|
+
inputs: RichAssetInput[];
|
|
903
|
+
fixedOutputs: FixedAssetOutput[];
|
|
904
|
+
}
|
|
821
905
|
/** Script */
|
|
822
906
|
export interface Script {
|
|
823
907
|
code: string;
|
|
@@ -1205,7 +1289,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1205
1289
|
}
|
|
1206
1290
|
/**
|
|
1207
1291
|
* @title Alephium API
|
|
1208
|
-
* @version 3.
|
|
1292
|
+
* @version 3.7.0
|
|
1209
1293
|
* @baseUrl ../
|
|
1210
1294
|
*/
|
|
1211
1295
|
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
@@ -1562,6 +1646,26 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1562
1646
|
*/
|
|
1563
1647
|
toTs?: number;
|
|
1564
1648
|
}, params?: RequestParams) => Promise<BlocksAndEventsPerTimeStampRange>;
|
|
1649
|
+
/**
|
|
1650
|
+
* No description
|
|
1651
|
+
*
|
|
1652
|
+
* @tags Blockflow
|
|
1653
|
+
* @name GetBlockflowRichBlocks
|
|
1654
|
+
* @summary Given a time interval, list blocks containing events and transactions with enriched input information when node indexes are enabled.
|
|
1655
|
+
* @request GET:/blockflow/rich-blocks
|
|
1656
|
+
*/
|
|
1657
|
+
getBlockflowRichBlocks: (query: {
|
|
1658
|
+
/**
|
|
1659
|
+
* @format int64
|
|
1660
|
+
* @min 0
|
|
1661
|
+
*/
|
|
1662
|
+
fromTs: number;
|
|
1663
|
+
/**
|
|
1664
|
+
* @format int64
|
|
1665
|
+
* @min 0
|
|
1666
|
+
*/
|
|
1667
|
+
toTs?: number;
|
|
1668
|
+
}, params?: RequestParams) => Promise<RichBlocksAndEventsPerTimeStampRange>;
|
|
1565
1669
|
/**
|
|
1566
1670
|
* No description
|
|
1567
1671
|
*
|
|
@@ -1589,6 +1693,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1589
1693
|
* @request GET:/blockflow/blocks-with-events/{block_hash}
|
|
1590
1694
|
*/
|
|
1591
1695
|
getBlockflowBlocksWithEventsBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockAndEvents>;
|
|
1696
|
+
/**
|
|
1697
|
+
* No description
|
|
1698
|
+
*
|
|
1699
|
+
* @tags Blockflow
|
|
1700
|
+
* @name GetBlockflowRichBlocksBlockHash
|
|
1701
|
+
* @summary Get a block containing events and transactions with enriched input information when node indexes are enabled.
|
|
1702
|
+
* @request GET:/blockflow/rich-blocks/{block_hash}
|
|
1703
|
+
*/
|
|
1704
|
+
getBlockflowRichBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<RichBlockAndEvents>;
|
|
1592
1705
|
/**
|
|
1593
1706
|
* No description
|
|
1594
1707
|
*
|
|
@@ -151,7 +151,7 @@ class HttpClient {
|
|
|
151
151
|
exports.HttpClient = HttpClient;
|
|
152
152
|
/**
|
|
153
153
|
* @title Alephium API
|
|
154
|
-
* @version 3.
|
|
154
|
+
* @version 3.7.0
|
|
155
155
|
* @baseUrl ../
|
|
156
156
|
*/
|
|
157
157
|
class Api extends HttpClient {
|
|
@@ -661,6 +661,21 @@ class Api extends HttpClient {
|
|
|
661
661
|
format: 'json',
|
|
662
662
|
...params
|
|
663
663
|
}).then(utils_1.convertHttpResponse),
|
|
664
|
+
/**
|
|
665
|
+
* No description
|
|
666
|
+
*
|
|
667
|
+
* @tags Blockflow
|
|
668
|
+
* @name GetBlockflowRichBlocks
|
|
669
|
+
* @summary Given a time interval, list blocks containing events and transactions with enriched input information when node indexes are enabled.
|
|
670
|
+
* @request GET:/blockflow/rich-blocks
|
|
671
|
+
*/
|
|
672
|
+
getBlockflowRichBlocks: (query, params = {}) => this.request({
|
|
673
|
+
path: `/blockflow/rich-blocks`,
|
|
674
|
+
method: 'GET',
|
|
675
|
+
query: query,
|
|
676
|
+
format: 'json',
|
|
677
|
+
...params
|
|
678
|
+
}).then(utils_1.convertHttpResponse),
|
|
664
679
|
/**
|
|
665
680
|
* No description
|
|
666
681
|
*
|
|
@@ -703,6 +718,20 @@ class Api extends HttpClient {
|
|
|
703
718
|
format: 'json',
|
|
704
719
|
...params
|
|
705
720
|
}).then(utils_1.convertHttpResponse),
|
|
721
|
+
/**
|
|
722
|
+
* No description
|
|
723
|
+
*
|
|
724
|
+
* @tags Blockflow
|
|
725
|
+
* @name GetBlockflowRichBlocksBlockHash
|
|
726
|
+
* @summary Get a block containing events and transactions with enriched input information when node indexes are enabled.
|
|
727
|
+
* @request GET:/blockflow/rich-blocks/{block_hash}
|
|
728
|
+
*/
|
|
729
|
+
getBlockflowRichBlocksBlockHash: (blockHash, params = {}) => this.request({
|
|
730
|
+
path: `/blockflow/rich-blocks/${blockHash}`,
|
|
731
|
+
method: 'GET',
|
|
732
|
+
format: 'json',
|
|
733
|
+
...params
|
|
734
|
+
}).then(utils_1.convertHttpResponse),
|
|
706
735
|
/**
|
|
707
736
|
* No description
|
|
708
737
|
*
|
|
@@ -162,6 +162,7 @@ export interface AssetOutput {
|
|
|
162
162
|
}
|
|
163
163
|
/** NFT */
|
|
164
164
|
export interface NFT {
|
|
165
|
+
id: string;
|
|
165
166
|
type: string;
|
|
166
167
|
}
|
|
167
168
|
/** AcceptedTransaction */
|
|
@@ -187,6 +188,13 @@ export interface AcceptedTransaction {
|
|
|
187
188
|
/** @format int64 */
|
|
188
189
|
timestamp: number;
|
|
189
190
|
}
|
|
191
|
+
/** HolderInfo */
|
|
192
|
+
export interface HolderInfo {
|
|
193
|
+
/** @format address */
|
|
194
|
+
address: string;
|
|
195
|
+
/** @format uint256 */
|
|
196
|
+
balance: string;
|
|
197
|
+
}
|
|
190
198
|
/** TokenSupply */
|
|
191
199
|
export interface TokenSupply {
|
|
192
200
|
/** @format uint256 */
|
|
@@ -278,6 +286,8 @@ export declare enum TokenStdInterfaceId {
|
|
|
278
286
|
export interface ExplorerInfo {
|
|
279
287
|
releaseVersion: string;
|
|
280
288
|
commit: string;
|
|
289
|
+
/** @format int64 */
|
|
290
|
+
lastHoldersUpdate: number;
|
|
281
291
|
/** @format int32 */
|
|
282
292
|
migrationsVersion: number;
|
|
283
293
|
/** @format int64 */
|
|
@@ -323,6 +333,7 @@ export interface Transaction {
|
|
|
323
333
|
}
|
|
324
334
|
/** FungibleToken */
|
|
325
335
|
export interface FungibleToken {
|
|
336
|
+
id: string;
|
|
326
337
|
type: string;
|
|
327
338
|
}
|
|
328
339
|
/** GhostUncle */
|
|
@@ -1045,6 +1056,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1045
1056
|
*/
|
|
1046
1057
|
'interface-id'?: TokenStdInterfaceId | string;
|
|
1047
1058
|
}, params?: RequestParams) => Promise<TokenInfo[]>;
|
|
1059
|
+
/**
|
|
1060
|
+
* @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
|
|
1061
|
+
*
|
|
1062
|
+
* @tags Tokens
|
|
1063
|
+
* @name GetTokensHoldersTokenTokenId
|
|
1064
|
+
* @request GET:/tokens/holders/token/{token_id}
|
|
1065
|
+
*/
|
|
1066
|
+
getTokensHoldersTokenTokenId: (tokenId: string, query?: {
|
|
1067
|
+
/**
|
|
1068
|
+
* Page number
|
|
1069
|
+
* @format int32
|
|
1070
|
+
* @min 1
|
|
1071
|
+
*/
|
|
1072
|
+
page?: number;
|
|
1073
|
+
/**
|
|
1074
|
+
* Number of items per page
|
|
1075
|
+
* @format int32
|
|
1076
|
+
* @min 0
|
|
1077
|
+
* @max 100
|
|
1078
|
+
*/
|
|
1079
|
+
limit?: number;
|
|
1080
|
+
}, params?: RequestParams) => Promise<HolderInfo[]>;
|
|
1048
1081
|
/**
|
|
1049
1082
|
* @description List token transactions
|
|
1050
1083
|
*
|
|
@@ -1097,6 +1130,28 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1097
1130
|
*/
|
|
1098
1131
|
limit?: number;
|
|
1099
1132
|
}, params?: RequestParams) => Promise<string[]>;
|
|
1133
|
+
/**
|
|
1134
|
+
* @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
|
|
1135
|
+
*
|
|
1136
|
+
* @tags Tokens
|
|
1137
|
+
* @name GetTokensHoldersAlph
|
|
1138
|
+
* @request GET:/tokens/holders/alph
|
|
1139
|
+
*/
|
|
1140
|
+
getTokensHoldersAlph: (query?: {
|
|
1141
|
+
/**
|
|
1142
|
+
* Page number
|
|
1143
|
+
* @format int32
|
|
1144
|
+
* @min 1
|
|
1145
|
+
*/
|
|
1146
|
+
page?: number;
|
|
1147
|
+
/**
|
|
1148
|
+
* Number of items per page
|
|
1149
|
+
* @format int32
|
|
1150
|
+
* @min 0
|
|
1151
|
+
* @max 100
|
|
1152
|
+
*/
|
|
1153
|
+
limit?: number;
|
|
1154
|
+
}, params?: RequestParams) => Promise<HolderInfo[]>;
|
|
1100
1155
|
/**
|
|
1101
1156
|
* @description Return metadata for the given nft tokens, if metadata doesn't exist or token isn't a nft, it won't be in the output list
|
|
1102
1157
|
*
|
|
@@ -680,6 +680,20 @@ class Api extends HttpClient {
|
|
|
680
680
|
format: 'json',
|
|
681
681
|
...params
|
|
682
682
|
}).then(utils_1.convertHttpResponse),
|
|
683
|
+
/**
|
|
684
|
+
* @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
|
|
685
|
+
*
|
|
686
|
+
* @tags Tokens
|
|
687
|
+
* @name GetTokensHoldersTokenTokenId
|
|
688
|
+
* @request GET:/tokens/holders/token/{token_id}
|
|
689
|
+
*/
|
|
690
|
+
getTokensHoldersTokenTokenId: (tokenId, query, params = {}) => this.request({
|
|
691
|
+
path: `/tokens/holders/token/${tokenId}`,
|
|
692
|
+
method: 'GET',
|
|
693
|
+
query: query,
|
|
694
|
+
format: 'json',
|
|
695
|
+
...params
|
|
696
|
+
}).then(utils_1.convertHttpResponse),
|
|
683
697
|
/**
|
|
684
698
|
* @description List token transactions
|
|
685
699
|
*
|
|
@@ -723,6 +737,20 @@ class Api extends HttpClient {
|
|
|
723
737
|
format: 'json',
|
|
724
738
|
...params
|
|
725
739
|
}).then(utils_1.convertHttpResponse),
|
|
740
|
+
/**
|
|
741
|
+
* @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
|
|
742
|
+
*
|
|
743
|
+
* @tags Tokens
|
|
744
|
+
* @name GetTokensHoldersAlph
|
|
745
|
+
* @request GET:/tokens/holders/alph
|
|
746
|
+
*/
|
|
747
|
+
getTokensHoldersAlph: (query, params = {}) => this.request({
|
|
748
|
+
path: `/tokens/holders/alph`,
|
|
749
|
+
method: 'GET',
|
|
750
|
+
query: query,
|
|
751
|
+
format: 'json',
|
|
752
|
+
...params
|
|
753
|
+
}).then(utils_1.convertHttpResponse),
|
|
726
754
|
/**
|
|
727
755
|
* @description Return metadata for the given nft tokens, if metadata doesn't exist or token isn't a nft, it won't be in the output list
|
|
728
756
|
*
|
|
@@ -303,7 +303,9 @@ export declare function subscribeContractEvent<F extends Fields, M extends Contr
|
|
|
303
303
|
export declare function subscribeContractEvents(contract: Contract, instance: ContractInstance, options: EventSubscribeOptions<ContractEvent<any>>, fromCount?: number): EventSubscription;
|
|
304
304
|
export declare function callMethod<I extends ContractInstance, F extends Fields, A extends Arguments, R>(contract: ContractFactory<I, F>, instance: ContractInstance, methodName: string, params: Optional<CallContractParams<A>, 'args'>, getContractByCodeHash: (codeHash: string) => Contract): Promise<CallContractResult<R>>;
|
|
305
305
|
export declare function signExecuteMethod<I extends ContractInstance, F extends Fields, A extends Arguments, R>(contract: ContractFactory<I, F>, instance: ContractInstance, methodName: string, params: Optional<SignExecuteContractMethodParams<A>, 'args'>): Promise<SignExecuteScriptTxResult>;
|
|
306
|
-
|
|
306
|
+
type Calls = Record<string, Optional<CallContractParams<any>, 'args'>>;
|
|
307
|
+
export declare function multicallMethods<I extends ContractInstance, F extends Fields>(contract: ContractFactory<I, F>, instance: ContractInstance, _callss: Calls | Calls[], getContractByCodeHash: (codeHash: string) => Contract): Promise<Record<string, CallContractResult<any>>[] | Record<string, CallContractResult<any>>>;
|
|
307
308
|
export declare function getContractEventsCurrentCount(contractAddress: Address): Promise<number>;
|
|
308
309
|
export declare const getContractIdFromUnsignedTx: (nodeProvider: NodeProvider, unsignedTx: string) => Promise<HexString>;
|
|
309
310
|
export declare const getTokenIdFromUnsignedTx: (nodeProvider: NodeProvider, unsignedTx: string) => Promise<HexString>;
|
|
311
|
+
export {};
|
|
@@ -1328,7 +1328,8 @@ function toFieldsSig(contractName, functionSig) {
|
|
|
1328
1328
|
isMutable: [false].concat(functionSig.paramIsMutable)
|
|
1329
1329
|
};
|
|
1330
1330
|
}
|
|
1331
|
-
async function multicallMethods(contract, instance,
|
|
1331
|
+
async function multicallMethods(contract, instance, _callss, getContractByCodeHash) {
|
|
1332
|
+
const callss = Array.isArray(_callss) ? _callss : [_callss];
|
|
1332
1333
|
const callEntries = callss.map((calls) => Object.entries(calls));
|
|
1333
1334
|
const callsParams = callEntries.map((entries) => {
|
|
1334
1335
|
return entries.map((entry) => {
|
|
@@ -1340,7 +1341,7 @@ async function multicallMethods(contract, instance, callss, getContractByCodeHas
|
|
|
1340
1341
|
});
|
|
1341
1342
|
const result = await (0, global_1.getCurrentNodeProvider)().contracts.postContractsMulticallContract({ calls: callsParams.flat() });
|
|
1342
1343
|
let callResultIndex = 0;
|
|
1343
|
-
|
|
1344
|
+
const results = callsParams.map((calls, index0) => {
|
|
1344
1345
|
const callsResult = {};
|
|
1345
1346
|
const entries = callEntries[`${index0}`];
|
|
1346
1347
|
calls.forEach((call, index1) => {
|
|
@@ -1352,6 +1353,7 @@ async function multicallMethods(contract, instance, callss, getContractByCodeHas
|
|
|
1352
1353
|
});
|
|
1353
1354
|
return callsResult;
|
|
1354
1355
|
});
|
|
1356
|
+
return Array.isArray(_callss) ? results : results[0];
|
|
1355
1357
|
}
|
|
1356
1358
|
exports.multicallMethods = multicallMethods;
|
|
1357
1359
|
async function getContractEventsCurrentCount(contractAddress) {
|
|
@@ -33,4 +33,7 @@ export type Eq<X, Y> = _Eq<{
|
|
|
33
33
|
}>;
|
|
34
34
|
export declare function assertType<T extends true>(): void;
|
|
35
35
|
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
36
|
+
export type Narrow<type> = (unknown extends type ? unknown : never) | (type extends Function ? type : never) | (type extends bigint | boolean | number | string ? type : never) | (type extends [] ? [] : never) | {
|
|
37
|
+
[K in keyof type]: Narrow<type[K]>;
|
|
38
|
+
};
|
|
36
39
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/web3",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.4",
|
|
4
4
|
"description": "A JS/TS library to interact with the Alephium platform",
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"author": "Alephium dev <dev@alephium.org>",
|
|
35
35
|
"config": {
|
|
36
|
-
"alephium_version": "3.
|
|
37
|
-
"explorer_backend_version": "2.
|
|
36
|
+
"alephium_version": "3.7.0",
|
|
37
|
+
"explorer_backend_version": "2.2.3"
|
|
38
38
|
},
|
|
39
39
|
"type": "commonjs",
|
|
40
40
|
"dependencies": {
|
package/src/api/api-alephium.ts
CHANGED
|
@@ -926,6 +926,97 @@ export interface RevealMnemonicResult {
|
|
|
926
926
|
mnemonic: string
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
+
/** RichAssetInput */
|
|
930
|
+
export interface RichAssetInput {
|
|
931
|
+
/** @format int32 */
|
|
932
|
+
hint: number
|
|
933
|
+
/** @format 32-byte-hash */
|
|
934
|
+
key: string
|
|
935
|
+
/** @format hex-string */
|
|
936
|
+
unlockScript: string
|
|
937
|
+
/** @format uint256 */
|
|
938
|
+
attoAlphAmount: string
|
|
939
|
+
/** @format address */
|
|
940
|
+
address: string
|
|
941
|
+
tokens: Token[]
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/** RichBlockAndEvents */
|
|
945
|
+
export interface RichBlockAndEvents {
|
|
946
|
+
block: RichBlockEntry
|
|
947
|
+
events: ContractEventByBlockHash[]
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/** RichBlockEntry */
|
|
951
|
+
export interface RichBlockEntry {
|
|
952
|
+
/** @format block-hash */
|
|
953
|
+
hash: string
|
|
954
|
+
/** @format int64 */
|
|
955
|
+
timestamp: number
|
|
956
|
+
/** @format int32 */
|
|
957
|
+
chainFrom: number
|
|
958
|
+
/** @format int32 */
|
|
959
|
+
chainTo: number
|
|
960
|
+
/** @format int32 */
|
|
961
|
+
height: number
|
|
962
|
+
deps: string[]
|
|
963
|
+
transactions: RichTransaction[]
|
|
964
|
+
/** @format hex-string */
|
|
965
|
+
nonce: string
|
|
966
|
+
version: number
|
|
967
|
+
/** @format 32-byte-hash */
|
|
968
|
+
depStateHash: string
|
|
969
|
+
/** @format 32-byte-hash */
|
|
970
|
+
txsHash: string
|
|
971
|
+
/** @format hex-string */
|
|
972
|
+
target: string
|
|
973
|
+
ghostUncles: GhostUncleBlockEntry[]
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/** RichBlocksAndEventsPerTimeStampRange */
|
|
977
|
+
export interface RichBlocksAndEventsPerTimeStampRange {
|
|
978
|
+
blocksAndEvents: RichBlockAndEvents[][]
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** RichContractInput */
|
|
982
|
+
export interface RichContractInput {
|
|
983
|
+
/** @format int32 */
|
|
984
|
+
hint: number
|
|
985
|
+
/** @format 32-byte-hash */
|
|
986
|
+
key: string
|
|
987
|
+
/** @format uint256 */
|
|
988
|
+
attoAlphAmount: string
|
|
989
|
+
/** @format address */
|
|
990
|
+
address: string
|
|
991
|
+
tokens: Token[]
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/** RichTransaction */
|
|
995
|
+
export interface RichTransaction {
|
|
996
|
+
unsigned: RichUnsignedTx
|
|
997
|
+
scriptExecutionOk: boolean
|
|
998
|
+
contractInputs: RichContractInput[]
|
|
999
|
+
generatedOutputs: Output[]
|
|
1000
|
+
inputSignatures: string[]
|
|
1001
|
+
scriptSignatures: string[]
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/** RichUnsignedTx */
|
|
1005
|
+
export interface RichUnsignedTx {
|
|
1006
|
+
/** @format 32-byte-hash */
|
|
1007
|
+
txId: string
|
|
1008
|
+
version: number
|
|
1009
|
+
networkId: number
|
|
1010
|
+
/** @format script */
|
|
1011
|
+
scriptOpt?: string
|
|
1012
|
+
/** @format int32 */
|
|
1013
|
+
gasAmount: number
|
|
1014
|
+
/** @format uint256 */
|
|
1015
|
+
gasPrice: string
|
|
1016
|
+
inputs: RichAssetInput[]
|
|
1017
|
+
fixedOutputs: FixedAssetOutput[]
|
|
1018
|
+
}
|
|
1019
|
+
|
|
929
1020
|
/** Script */
|
|
930
1021
|
export interface Script {
|
|
931
1022
|
code: string
|
|
@@ -1512,7 +1603,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
1512
1603
|
|
|
1513
1604
|
/**
|
|
1514
1605
|
* @title Alephium API
|
|
1515
|
-
* @version 3.
|
|
1606
|
+
* @version 3.7.0
|
|
1516
1607
|
* @baseUrl ../
|
|
1517
1608
|
*/
|
|
1518
1609
|
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
@@ -2169,6 +2260,40 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
2169
2260
|
...params
|
|
2170
2261
|
}).then(convertHttpResponse),
|
|
2171
2262
|
|
|
2263
|
+
/**
|
|
2264
|
+
* No description
|
|
2265
|
+
*
|
|
2266
|
+
* @tags Blockflow
|
|
2267
|
+
* @name GetBlockflowRichBlocks
|
|
2268
|
+
* @summary Given a time interval, list blocks containing events and transactions with enriched input information when node indexes are enabled.
|
|
2269
|
+
* @request GET:/blockflow/rich-blocks
|
|
2270
|
+
*/
|
|
2271
|
+
getBlockflowRichBlocks: (
|
|
2272
|
+
query: {
|
|
2273
|
+
/**
|
|
2274
|
+
* @format int64
|
|
2275
|
+
* @min 0
|
|
2276
|
+
*/
|
|
2277
|
+
fromTs: number
|
|
2278
|
+
/**
|
|
2279
|
+
* @format int64
|
|
2280
|
+
* @min 0
|
|
2281
|
+
*/
|
|
2282
|
+
toTs?: number
|
|
2283
|
+
},
|
|
2284
|
+
params: RequestParams = {}
|
|
2285
|
+
) =>
|
|
2286
|
+
this.request<
|
|
2287
|
+
RichBlocksAndEventsPerTimeStampRange,
|
|
2288
|
+
BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
|
|
2289
|
+
>({
|
|
2290
|
+
path: `/blockflow/rich-blocks`,
|
|
2291
|
+
method: 'GET',
|
|
2292
|
+
query: query,
|
|
2293
|
+
format: 'json',
|
|
2294
|
+
...params
|
|
2295
|
+
}).then(convertHttpResponse),
|
|
2296
|
+
|
|
2172
2297
|
/**
|
|
2173
2298
|
* No description
|
|
2174
2299
|
*
|
|
@@ -2217,6 +2342,24 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
2217
2342
|
...params
|
|
2218
2343
|
}).then(convertHttpResponse),
|
|
2219
2344
|
|
|
2345
|
+
/**
|
|
2346
|
+
* No description
|
|
2347
|
+
*
|
|
2348
|
+
* @tags Blockflow
|
|
2349
|
+
* @name GetBlockflowRichBlocksBlockHash
|
|
2350
|
+
* @summary Get a block containing events and transactions with enriched input information when node indexes are enabled.
|
|
2351
|
+
* @request GET:/blockflow/rich-blocks/{block_hash}
|
|
2352
|
+
*/
|
|
2353
|
+
getBlockflowRichBlocksBlockHash: (blockHash: string, params: RequestParams = {}) =>
|
|
2354
|
+
this.request<RichBlockAndEvents, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>(
|
|
2355
|
+
{
|
|
2356
|
+
path: `/blockflow/rich-blocks/${blockHash}`,
|
|
2357
|
+
method: 'GET',
|
|
2358
|
+
format: 'json',
|
|
2359
|
+
...params
|
|
2360
|
+
}
|
|
2361
|
+
).then(convertHttpResponse),
|
|
2362
|
+
|
|
2220
2363
|
/**
|
|
2221
2364
|
* No description
|
|
2222
2365
|
*
|
package/src/api/api-explorer.ts
CHANGED
|
@@ -190,6 +190,7 @@ export interface AssetOutput {
|
|
|
190
190
|
|
|
191
191
|
/** NFT */
|
|
192
192
|
export interface NFT {
|
|
193
|
+
id: string
|
|
193
194
|
type: string
|
|
194
195
|
}
|
|
195
196
|
|
|
@@ -217,6 +218,14 @@ export interface AcceptedTransaction {
|
|
|
217
218
|
timestamp: number
|
|
218
219
|
}
|
|
219
220
|
|
|
221
|
+
/** HolderInfo */
|
|
222
|
+
export interface HolderInfo {
|
|
223
|
+
/** @format address */
|
|
224
|
+
address: string
|
|
225
|
+
/** @format uint256 */
|
|
226
|
+
balance: string
|
|
227
|
+
}
|
|
228
|
+
|
|
220
229
|
/** TokenSupply */
|
|
221
230
|
export interface TokenSupply {
|
|
222
231
|
/** @format uint256 */
|
|
@@ -317,6 +326,8 @@ export enum TokenStdInterfaceId {
|
|
|
317
326
|
export interface ExplorerInfo {
|
|
318
327
|
releaseVersion: string
|
|
319
328
|
commit: string
|
|
329
|
+
/** @format int64 */
|
|
330
|
+
lastHoldersUpdate: number
|
|
320
331
|
/** @format int32 */
|
|
321
332
|
migrationsVersion: number
|
|
322
333
|
/** @format int64 */
|
|
@@ -367,6 +378,7 @@ export interface Transaction {
|
|
|
367
378
|
|
|
368
379
|
/** FungibleToken */
|
|
369
380
|
export interface FungibleToken {
|
|
381
|
+
id: string
|
|
370
382
|
type: string
|
|
371
383
|
}
|
|
372
384
|
|
|
@@ -1588,6 +1600,40 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1588
1600
|
...params
|
|
1589
1601
|
}).then(convertHttpResponse),
|
|
1590
1602
|
|
|
1603
|
+
/**
|
|
1604
|
+
* @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
|
|
1605
|
+
*
|
|
1606
|
+
* @tags Tokens
|
|
1607
|
+
* @name GetTokensHoldersTokenTokenId
|
|
1608
|
+
* @request GET:/tokens/holders/token/{token_id}
|
|
1609
|
+
*/
|
|
1610
|
+
getTokensHoldersTokenTokenId: (
|
|
1611
|
+
tokenId: string,
|
|
1612
|
+
query?: {
|
|
1613
|
+
/**
|
|
1614
|
+
* Page number
|
|
1615
|
+
* @format int32
|
|
1616
|
+
* @min 1
|
|
1617
|
+
*/
|
|
1618
|
+
page?: number
|
|
1619
|
+
/**
|
|
1620
|
+
* Number of items per page
|
|
1621
|
+
* @format int32
|
|
1622
|
+
* @min 0
|
|
1623
|
+
* @max 100
|
|
1624
|
+
*/
|
|
1625
|
+
limit?: number
|
|
1626
|
+
},
|
|
1627
|
+
params: RequestParams = {}
|
|
1628
|
+
) =>
|
|
1629
|
+
this.request<HolderInfo[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
1630
|
+
path: `/tokens/holders/token/${tokenId}`,
|
|
1631
|
+
method: 'GET',
|
|
1632
|
+
query: query,
|
|
1633
|
+
format: 'json',
|
|
1634
|
+
...params
|
|
1635
|
+
}).then(convertHttpResponse),
|
|
1636
|
+
|
|
1591
1637
|
/**
|
|
1592
1638
|
* @description List token transactions
|
|
1593
1639
|
*
|
|
@@ -1676,6 +1722,39 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
|
|
|
1676
1722
|
...params
|
|
1677
1723
|
}).then(convertHttpResponse),
|
|
1678
1724
|
|
|
1725
|
+
/**
|
|
1726
|
+
* @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
|
|
1727
|
+
*
|
|
1728
|
+
* @tags Tokens
|
|
1729
|
+
* @name GetTokensHoldersAlph
|
|
1730
|
+
* @request GET:/tokens/holders/alph
|
|
1731
|
+
*/
|
|
1732
|
+
getTokensHoldersAlph: (
|
|
1733
|
+
query?: {
|
|
1734
|
+
/**
|
|
1735
|
+
* Page number
|
|
1736
|
+
* @format int32
|
|
1737
|
+
* @min 1
|
|
1738
|
+
*/
|
|
1739
|
+
page?: number
|
|
1740
|
+
/**
|
|
1741
|
+
* Number of items per page
|
|
1742
|
+
* @format int32
|
|
1743
|
+
* @min 0
|
|
1744
|
+
* @max 100
|
|
1745
|
+
*/
|
|
1746
|
+
limit?: number
|
|
1747
|
+
},
|
|
1748
|
+
params: RequestParams = {}
|
|
1749
|
+
) =>
|
|
1750
|
+
this.request<HolderInfo[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
|
|
1751
|
+
path: `/tokens/holders/alph`,
|
|
1752
|
+
method: 'GET',
|
|
1753
|
+
query: query,
|
|
1754
|
+
format: 'json',
|
|
1755
|
+
...params
|
|
1756
|
+
}).then(convertHttpResponse),
|
|
1757
|
+
|
|
1679
1758
|
/**
|
|
1680
1759
|
* @description Return metadata for the given nft tokens, if metadata doesn't exist or token isn't a nft, it won't be in the output list
|
|
1681
1760
|
*
|