diff --git a/.changelog/737.internal.md b/.changelog/737.internal.md new file mode 100644 index 000000000..172d16f79 --- /dev/null +++ b/.changelog/737.internal.md @@ -0,0 +1 @@ +Follow Nexus API changes diff --git a/src/app/components/Account/__tests__/ShowMoreTokensLink.test.tsx b/src/app/components/Account/__tests__/ShowMoreTokensLink.test.tsx index 860c990ac..828b93944 100644 --- a/src/app/components/Account/__tests__/ShowMoreTokensLink.test.tsx +++ b/src/app/components/Account/__tests__/ShowMoreTokensLink.test.tsx @@ -13,6 +13,7 @@ const mockedAccount = { const mockedToken1: Token = { balance: '1123.5', token_contract_addr: 'oasis1qrg90d4qlelg5zg4q4sd4y0z8j2lpjpvuspzjly1', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD1', token_name: 'ROSE', token_symbol: 'ROSE', token_type: EvmTokenType.ERC20, @@ -22,6 +23,7 @@ const mockedToken1: Token = { const mockedToken2: Token = { balance: '65913.17', token_contract_addr: 'oasis1qrg90d4qlelg5zg4q4sd4y0z8j2lpjpvuspzjly2', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD2', token_name: 'USDT', token_symbol: 'USDT', token_type: EvmTokenType.ERC20, @@ -31,6 +33,7 @@ const mockedToken2: Token = { const mockedToken3: Token = { balance: '0.012345', token_contract_addr: 'oasis1qrg90d4qlelg5zg4q4sd4y0z8j2lpjpvuspzjly3', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD3', token_name: 'ERC721', token_symbol: 'ERC721', token_type: EvmTokenType.ERC721, @@ -40,6 +43,7 @@ const mockedToken3: Token = { const mockedToken4: Token = { balance: '1123.5', token_contract_addr: 'oasis1qrg90d4qlelg5zg4q4sd4y0z8j2lpjpvuspzjly4', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD4', token_name: 'ROSE', token_symbol: 'ROSE', token_type: EvmTokenType.ERC20, diff --git a/src/app/utils/test-fixtures.ts b/src/app/utils/test-fixtures.ts index 21a7c25a4..4a3c3f2ad 100644 --- a/src/app/utils/test-fixtures.ts +++ b/src/app/utils/test-fixtures.ts @@ -40,6 +40,7 @@ export const suggestedParsedAccount: RuntimeAccount = groupAccountTokenBalances( { balance: '337325.438367711264207872', token_contract_addr: 'oasis1qpssvkplnlpzdvwxpgmrhf9j5lkyvaylcvujhjhg', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD1', token_decimals: 18, token_name: 'FTP', token_symbol: 'FTP', @@ -48,6 +49,7 @@ export const suggestedParsedAccount: RuntimeAccount = groupAccountTokenBalances( { balance: '-3372955.09999999999999995', token_contract_addr: 'oasis1qqz8706pmf38wmptl6dkcaec8yykw0rvfv7ql6fc', + token_contract_addr_eth: '0xF8E3DE55D24D13607A12628E0A113B66BA578bD2', token_decimals: 18, token_name: 'YUZU', token_symbol: 'YUZU', diff --git a/src/oasis-nexus/generated/api.ts b/src/oasis-nexus/generated/api.ts index 3830a2300..9620bb790 100644 --- a/src/oasis-nexus/generated/api.ts +++ b/src/oasis-nexus/generated/api.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.16.0 🍺 + * Generated by orval v6.17.0 🍺 * Do not edit manually. * Oasis Nexus API V1 * An API for accessing indexed data from the Oasis Network. @@ -606,7 +606,7 @@ export interface EvmToken { /** The Oasis address of this token's contract. */ contract_addr: string; /** The Ethereum address of this token's contract. */ - eth_contract_addr?: string; + eth_contract_addr: string; /** Name of the token, as provided by token contract's `name()` method. */ name?: string; /** Symbol of the token, as provided by token contract's `symbol()` method. */ @@ -627,6 +627,11 @@ detected or is not supported, this field will be null/absent. /** The number of addresses that have a nonzero balance of this token. */ num_holders: number; + /** Whether the contract has been successfully verified by Sourcify. +Additional information on verified contracts is available via +the `/{runtime}/accounts/{address}` endpoint. + */ + is_verified: boolean; } /** @@ -857,6 +862,21 @@ contracts that have been verified successfully by Sourcify. verification?: RuntimeEvmContractVerification; } +/** + * Details about the EVM token involved in the event, if any. + + */ +export interface EvmEventToken { + type?: EvmTokenType; + /** Symbol of the token, as provided by token contract's `symbol()` method. */ + symbol?: string; + /** The number of least significant digits in base units that should be displayed as +decimals when displaying tokens. `tokens = base_units / (10**decimals)`. +Affects display only. Often equals 18, to match ETH. + */ + decimals?: number; +} + /** * A decoded parameter of an event emitted from an EVM runtime. Values of EVM type `int128`, `uint128`, `int256`, `uint256`, `fixed`, and `ufixed` are represented as strings. @@ -916,6 +936,9 @@ Absent if the event did not originate from a transaction. Absent if the event did not originate from an EVM transaction. */ eth_tx_hash?: string; + /** The second-granular consensus time of this event's block. + */ + timestamp: string; /** The type of the event. */ type: RuntimeEventType; /** The decoded event contents. This spec does not encode the many possible types; @@ -935,6 +958,7 @@ and `Approve`. Absent if the event type is not `evm.log`. */ evm_log_params?: EvmEventParam[]; + evm_token?: EvmEventToken; } /** @@ -974,8 +998,6 @@ export type RuntimeBlockListAllOf = { blocks: RuntimeBlock[]; }; -export type RuntimeBlockList = List & RuntimeBlockListAllOf; - export interface ProposalVote { /** The staking address casting this vote. */ address: string; @@ -1132,8 +1154,10 @@ export type TokenHolderList = List & TokenHolderListAllOf; export interface RuntimeEvmBalance { /** Number of tokens held, in base units. */ balance: string; - /** The EVM address of this token's contract. Encoded as a lowercase hex string. */ + /** The oasis address of this token's contract. */ token_contract_addr: string; + /** The EVM address of this token's contract. */ + token_contract_addr_eth: string; /** The token ticker symbol. Not guaranteed to be unique across distinct EVM tokens. */ token_symbol?: string; /** The name of the token. Not guaranteed to be unique across distinct EVM tokens. */ @@ -1444,7 +1468,7 @@ export interface Transaction { block: number; /** 0-based index of this transaction in its block */ index: number; - /** The second-granular consensus time this tx's block, i.e. roughly when the + /** The second-granular consensus time of this tx's block, i.e. roughly when the [block was proposed](https://github.com/tendermint/tendermint/blob/v0.34.x/spec/core/data_structures.md#header). */ timestamp: string; @@ -1557,6 +1581,8 @@ the query would return with limit=infinity. is_total_count_clipped: boolean; } +export type RuntimeBlockList = List & RuntimeBlockListAllOf; + /** * A list of consensus blocks.