Skip to content

Commit

Permalink
Update node&explorer version
Browse files Browse the repository at this point in the history
  • Loading branch information
polarker committed Oct 1, 2024
1 parent b2e6cbd commit 96ec2b4
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
condition: service_healthy

alephium:
image: alephium/alephium:v3.6.2
image: alephium/alephium:v3.7.0
restart: unless-stopped
ports:
- 19973:19973/tcp
Expand Down
4 changes: 2 additions & 2 deletions packages/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
},
"author": "Alephium dev <dev@alephium.org>",
"config": {
"alephium_version": "3.6.2",
"explorer_backend_version": "2.0.0"
"alephium_version": "3.7.0",
"explorer_backend_version": "2.2.3"
},
"scripts": {
"build": "rm -rf dist/* && npx tsc --build . && webpack",
Expand Down
145 changes: 144 additions & 1 deletion packages/web3/src/api/api-alephium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,97 @@ export interface RevealMnemonicResult {
mnemonic: string
}

/** RichAssetInput */
export interface RichAssetInput {
/** @format int32 */
hint: number
/** @format 32-byte-hash */
key: string
/** @format hex-string */
unlockScript: string
/** @format uint256 */
attoAlphAmount: string
/** @format address */
address: string
tokens: Token[]
}

/** RichBlockAndEvents */
export interface RichBlockAndEvents {
block: RichBlockEntry
events: ContractEventByBlockHash[]
}

/** RichBlockEntry */
export interface RichBlockEntry {
/** @format block-hash */
hash: string
/** @format int64 */
timestamp: number
/** @format int32 */
chainFrom: number
/** @format int32 */
chainTo: number
/** @format int32 */
height: number
deps: string[]
transactions: RichTransaction[]
/** @format hex-string */
nonce: string
version: number
/** @format 32-byte-hash */
depStateHash: string
/** @format 32-byte-hash */
txsHash: string
/** @format hex-string */
target: string
ghostUncles: GhostUncleBlockEntry[]
}

/** RichBlocksAndEventsPerTimeStampRange */
export interface RichBlocksAndEventsPerTimeStampRange {
blocksAndEvents: RichBlockAndEvents[][]
}

/** RichContractInput */
export interface RichContractInput {
/** @format int32 */
hint: number
/** @format 32-byte-hash */
key: string
/** @format uint256 */
attoAlphAmount: string
/** @format address */
address: string
tokens: Token[]
}

/** RichTransaction */
export interface RichTransaction {
unsigned: RichUnsignedTx
scriptExecutionOk: boolean
contractInputs: RichContractInput[]
generatedOutputs: Output[]
inputSignatures: string[]
scriptSignatures: string[]
}

/** RichUnsignedTx */
export interface RichUnsignedTx {
/** @format 32-byte-hash */
txId: string
version: number
networkId: number
/** @format script */
scriptOpt?: string
/** @format int32 */
gasAmount: number
/** @format uint256 */
gasPrice: string
inputs: RichAssetInput[]
fixedOutputs: FixedAssetOutput[]
}

/** Script */
export interface Script {
code: string
Expand Down Expand Up @@ -1512,7 +1603,7 @@ export class HttpClient<SecurityDataType = unknown> {

/**
* @title Alephium API
* @version 3.6.2
* @version 3.7.0
* @baseUrl ../
*/
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
Expand Down Expand Up @@ -2169,6 +2260,40 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params
}).then(convertHttpResponse),

/**
* No description
*
* @tags Blockflow
* @name GetBlockflowRichBlocks
* @summary Given a time interval, list blocks containing events and transactions with enriched input information when node indexes are enabled.
* @request GET:/blockflow/rich-blocks
*/
getBlockflowRichBlocks: (
query: {
/**
* @format int64
* @min 0
*/
fromTs: number
/**
* @format int64
* @min 0
*/
toTs?: number
},
params: RequestParams = {}
) =>
this.request<
RichBlocksAndEventsPerTimeStampRange,
BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
>({
path: `/blockflow/rich-blocks`,
method: 'GET',
query: query,
format: 'json',
...params
}).then(convertHttpResponse),

/**
* No description
*
Expand Down Expand Up @@ -2217,6 +2342,24 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params
}).then(convertHttpResponse),

/**
* No description
*
* @tags Blockflow
* @name GetBlockflowRichBlocksBlockHash
* @summary Get a block containing events and transactions with enriched input information when node indexes are enabled.
* @request GET:/blockflow/rich-blocks/{block_hash}
*/
getBlockflowRichBlocksBlockHash: (blockHash: string, params: RequestParams = {}) =>
this.request<RichBlockAndEvents, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>(
{
path: `/blockflow/rich-blocks/${blockHash}`,
method: 'GET',
format: 'json',
...params
}
).then(convertHttpResponse),

/**
* No description
*
Expand Down
79 changes: 79 additions & 0 deletions packages/web3/src/api/api-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export interface AssetOutput {

/** NFT */
export interface NFT {
id: string
type: string
}

Expand Down Expand Up @@ -217,6 +218,14 @@ export interface AcceptedTransaction {
timestamp: number
}

/** HolderInfo */
export interface HolderInfo {
/** @format address */
address: string
/** @format uint256 */
balance: string
}

/** TokenSupply */
export interface TokenSupply {
/** @format uint256 */
Expand Down Expand Up @@ -317,6 +326,8 @@ export enum TokenStdInterfaceId {
export interface ExplorerInfo {
releaseVersion: string
commit: string
/** @format int64 */
lastHoldersUpdate: number
/** @format int32 */
migrationsVersion: number
/** @format int64 */
Expand Down Expand Up @@ -367,6 +378,7 @@ export interface Transaction {

/** FungibleToken */
export interface FungibleToken {
id: string
type: string
}

Expand Down Expand Up @@ -1588,6 +1600,40 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params
}).then(convertHttpResponse),

/**
* @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
*
* @tags Tokens
* @name GetTokensHoldersTokenTokenId
* @request GET:/tokens/holders/token/{token_id}
*/
getTokensHoldersTokenTokenId: (
tokenId: string,
query?: {
/**
* Page number
* @format int32
* @min 1
*/
page?: number
/**
* Number of items per page
* @format int32
* @min 0
* @max 100
*/
limit?: number
},
params: RequestParams = {}
) =>
this.request<HolderInfo[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
path: `/tokens/holders/token/${tokenId}`,
method: 'GET',
query: query,
format: 'json',
...params
}).then(convertHttpResponse),

/**
* @description List token transactions
*
Expand Down Expand Up @@ -1676,6 +1722,39 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
...params
}).then(convertHttpResponse),

/**
* @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
*
* @tags Tokens
* @name GetTokensHoldersAlph
* @request GET:/tokens/holders/alph
*/
getTokensHoldersAlph: (
query?: {
/**
* Page number
* @format int32
* @min 1
*/
page?: number
/**
* Number of items per page
* @format int32
* @min 0
* @max 100
*/
limit?: number
},
params: RequestParams = {}
) =>
this.request<HolderInfo[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
path: `/tokens/holders/alph`,
method: 'GET',
query: query,
format: 'json',
...params
}).then(convertHttpResponse),

/**
* @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
*
Expand Down

0 comments on commit 96ec2b4

Please sign in to comment.