-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Noves integration (#1398)
* noves integration * code refactored * PR changes added * Code set up for new proxy 'describeTxs' * minor fix * Rename Novestranslate.ts to NovesTranslate.ts * some quick stuff * partial fixes and commit for changing how useDescribeTxs and txsContent work (new GET endpoint) * Pending PR fixes * tx asset flows pageSize of 50 * PR comments fixes * rename expected api endpoint for the describe_txs endpoint, more accurate and descriptive * one final re-name for api endpoint (make it clear it's an object vs an action) * scrollRef fix * build error fix * design fixes * sub heading fix * Removed pagination in account history * remove duplicate route * updated table theme and icon gap * Removed wrong color in table * removed null validation in page params * updated margin * margin fix * add icons to contracts * Sub-heading interpretation simplified * token alignment fix * tests added for new functions * margin fix * remove divider on mobile asset flows --------- Co-authored-by: NahuelNoves <[email protected]> Co-authored-by: francisco-noves <[email protected]>
- workflow-test
- v1.37.5
- v1.37.5-alpha
- v1.37.4
- v1.37.4-alpha
- v1.37.3
- v1.37.2
- v1.37.1
- v1.37.0
- v1.37.0-alpha.2
- v1.37.0-alpha.1
- v1.37.0-alpha
- v1.36.4
- v1.36.3
- v1.36.3-alpha.1
- v1.36.3-alpha
- v1.36.2
- v1.36.2-alpha
- v1.36.1
- v1.36.1-alpha.2
- v1.36.1-alpha.1
- v1.36.1-alpha
- v1.36.0
- v1.36.0-alpha.3
- v1.36.0-alpha.2
- v1.36.0-alpha.1
- v1.36.0-alpha
- v1.35.2
- v1.35.1
- v1.35.0
- v1.35.0-alpha-1
- v1.35.0-alpha
- v1.34.2
- v1.34.1
- v1.34.1-alpha
- v1.34.0
- v1.34.0-alpha.3
- v1.34.0-alpha.2
- v1.34.0-alpha.1
- v1.34.0-alpha
- v1.33.2
- v1.33.2-alpha
- v1.33.1
- v1.33.1-alpha
- v1.33.0
- v1.33.0-alpha.3
- v1.33.0-alpha.2
- v1.33.0-alpha
- v1.32.1
- v1.32.1-alpha
- v1.32.0
- v1.32.0-alpha.2
- v1.32.0-alpha.1
- v1.32.0-alpha
- v1.31.1
- v1.31.0
- v1.31.0-alpha
- v1.30.1
- v1.30.0
- v1.30.0-alpha.1
- v1.30.0-alpha
- v1.29.2
- v1.29.1
- v1.29.0
- v.1.29.0-alpha.1
- v1.29.0-alpha.1
- v1.29.0-alpha
- v1.28.1
- v1.28.0
- v1.28.0-alpha.3
- v1.28.0-alpha.2
- v1.28.0-alpha
- v1.0.0
- rollbar-fix-v2
- rollbar-fix-v1
- rollbar
- account-v2.4
- account-v2.3
- account-v2.2
- account-v2.1
1 parent
9cdbf6d
commit cc9cb36
Showing
40 changed files
with
1,840 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import type { NovesResponseData } from 'types/api/noves'; | ||
|
||
import type { TokensData } from 'ui/tx/assetFlows/utils/getTokensData'; | ||
|
||
export const hash = '0x380400d04ebb4179a35b1d7fdef260776915f015e978f8587ef2704b843d4e53'; | ||
|
||
export const transaction: NovesResponseData = { | ||
accountAddress: '0xef6595A423c99f3f2821190A4d96fcE4DcD89a80', | ||
chain: 'eth-goerli', | ||
classificationData: { | ||
description: 'Called function \'stake\' on contract 0xef326CdAdA59D3A740A76bB5f4F88Fb2.', | ||
protocol: { | ||
name: null, | ||
}, | ||
received: [], | ||
sent: [ | ||
{ | ||
action: 'sent', | ||
actionFormatted: 'Sent', | ||
amount: '3000', | ||
from: { | ||
address: '0xef6595A423c99f3f2821190A4d96fcE4DcD89a80', | ||
name: 'This wallet', | ||
}, | ||
to: { | ||
address: '0xdD15D2650387Fb6FEDE27ae7392C402a393F8A37', | ||
name: null, | ||
}, | ||
token: { | ||
address: '0x1bfe4298796198f8664b18a98640cec7c89b5baa', | ||
decimals: 18, | ||
name: 'PQR-Test', | ||
symbol: 'PQR', | ||
}, | ||
}, | ||
{ | ||
action: 'paidGas', | ||
actionFormatted: 'Paid Gas', | ||
amount: '0.000395521502109448', | ||
from: { | ||
address: '0xef6595A423c99f3f2821190A4d96fcE4DcD89a80', | ||
name: 'This wallet', | ||
}, | ||
to: { | ||
address: null, | ||
name: 'Validators', | ||
}, | ||
token: { | ||
address: 'ETH', | ||
decimals: 18, | ||
name: 'ETH', | ||
symbol: 'ETH', | ||
}, | ||
}, | ||
], | ||
source: { | ||
type: null, | ||
}, | ||
type: 'unclassified', | ||
typeFormatted: 'Unclassified', | ||
}, | ||
rawTransactionData: { | ||
blockNumber: 10388918, | ||
fromAddress: '0xef6595A423c99f3f2821190A4d96fcE4DcD89a80', | ||
gas: 275079, | ||
gasPrice: 1500000008, | ||
timestamp: 1705488588, | ||
toAddress: '0xef326CdAdA59D3A740A76bB5f4F88Fb2f1076164', | ||
transactionFee: { | ||
amount: '395521502109448', | ||
token: { | ||
decimals: 18, | ||
symbol: 'ETH', | ||
}, | ||
}, | ||
transactionHash: '0x380400d04ebb4179a35b1d7fdef260776915f015e978f8587ef2704b843d4e53', | ||
}, | ||
txTypeVersion: 2, | ||
}; | ||
|
||
export const tokenData: TokensData = { | ||
nameList: [ 'PQR-Test', 'ETH' ], | ||
symbolList: [ 'PQR' ], | ||
idList: [], | ||
byName: { | ||
'PQR-Test': { | ||
name: 'PQR-Test', | ||
symbol: 'PQR', | ||
address: '0x1bfe4298796198f8664b18a98640cec7c89b5baa', | ||
id: undefined, | ||
}, | ||
ETH: { name: 'ETH', symbol: null, address: '', id: undefined }, | ||
}, | ||
bySymbol: { | ||
PQR: { | ||
name: 'PQR-Test', | ||
symbol: 'PQR', | ||
address: '0x1bfe4298796198f8664b18a98640cec7c89b5baa', | ||
id: undefined, | ||
}, | ||
'null': { name: 'ETH', symbol: null, address: '', id: undefined }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { NovesResponseData, NovesClassificationData, NovesRawTransactionData } from 'types/api/noves'; | ||
|
||
const NOVES_TRANSLATE_CLASSIFIED: NovesClassificationData = { | ||
description: 'Sent 0.04 ETH', | ||
received: [ { | ||
action: 'Sent Token', | ||
actionFormatted: 'Sent Token', | ||
amount: '45', | ||
from: { name: '', address: '0xa0393A76b132526a70450273CafeceB45eea6dEE' }, | ||
to: { name: '', address: '0xa0393A76b132526a70450273CafeceB45eea6dEE' }, | ||
token: { | ||
address: '', | ||
name: 'ETH', | ||
symbol: 'ETH', | ||
decimals: 18, | ||
}, | ||
} ], | ||
sent: [], | ||
source: { | ||
type: '', | ||
}, | ||
type: '0x2', | ||
typeFormatted: 'Send NFT', | ||
}; | ||
|
||
const NOVES_TRANSLATE_RAW: NovesRawTransactionData = { | ||
blockNumber: 1, | ||
fromAddress: '0xCFC123a23dfeD71bDAE054e487989d863C525C73', | ||
gas: 2, | ||
gasPrice: 3, | ||
timestamp: 20000, | ||
toAddress: '0xCFC123a23dfeD71bDAE054e487989d863C525C73', | ||
transactionFee: 2, | ||
transactionHash: '0x128b79937a0eDE33258992c9668455f997f1aF24', | ||
}; | ||
|
||
export const NOVES_TRANSLATE: NovesResponseData = { | ||
accountAddress: '0x2b824349b320cfa72f292ab26bf525adb00083ba9fa097141896c3c8c74567cc', | ||
chain: 'base', | ||
txTypeVersion: 2, | ||
rawTransactionData: NOVES_TRANSLATE_RAW, | ||
classificationData: NOVES_TRANSLATE_CLASSIFIED, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
export interface NovesResponseData { | ||
txTypeVersion: number; | ||
chain: string; | ||
accountAddress: string; | ||
classificationData: NovesClassificationData; | ||
rawTransactionData: NovesRawTransactionData; | ||
} | ||
|
||
export interface NovesClassificationData { | ||
type: string; | ||
typeFormatted?: string; | ||
description: string; | ||
sent: Array<NovesSentReceived>; | ||
received: Array<NovesSentReceived>; | ||
approved?: Approved; | ||
protocol?: { | ||
name: string | null; | ||
}; | ||
source: { | ||
type: string | null; | ||
}; | ||
message?: string; | ||
} | ||
|
||
export interface Approved { | ||
amount: string; | ||
spender: string; | ||
token?: NovesToken; | ||
nft?: NovesNft; | ||
} | ||
|
||
export interface NovesSentReceived { | ||
action: string; | ||
actionFormatted?: string; | ||
amount: string; | ||
to: NovesTo; | ||
from: NovesFrom; | ||
token?: NovesToken; | ||
nft?: NovesNft; | ||
} | ||
|
||
export interface NovesToken { | ||
symbol: string; | ||
name: string; | ||
decimals: number; | ||
address: string; | ||
id?: string; | ||
} | ||
|
||
export interface NovesNft { | ||
name: string; | ||
id: string; | ||
symbol: string; | ||
address: string; | ||
} | ||
|
||
export interface NovesFrom { | ||
name: string | null; | ||
address: string; | ||
} | ||
|
||
export interface NovesTo { | ||
name: string | null; | ||
address: string | null; | ||
} | ||
|
||
export interface NovesRawTransactionData { | ||
transactionHash: string; | ||
fromAddress: string; | ||
toAddress: string; | ||
blockNumber: number; | ||
gas: number; | ||
gasPrice: number; | ||
transactionFee: NovesTransactionFee | number; | ||
timestamp: number; | ||
} | ||
|
||
export interface NovesTransactionFee { | ||
amount: string; | ||
currency?: string; | ||
token?: { | ||
decimals: number; | ||
symbol: string; | ||
}; | ||
} | ||
|
||
export interface NovesAccountHistoryResponse { | ||
hasNextPage: boolean; | ||
items: Array<NovesResponseData>; | ||
pageNumber: number; | ||
pageSize: number; | ||
next_page_params?: { | ||
startBlock: string; | ||
endBlock: string; | ||
pageNumber: number; | ||
pageSize: number; | ||
ignoreTransactions: string; | ||
viewAsAccountAddress: string; | ||
}; | ||
} | ||
|
||
export const NovesHistoryFilterValues = [ 'received', 'sent' ] as const; | ||
|
||
export type NovesHistoryFilterValue = typeof NovesHistoryFilterValues[number] | undefined; | ||
|
||
export interface NovesHistoryFilters { | ||
filter?: NovesHistoryFilterValue; | ||
} | ||
|
||
export interface NovesDescribeResponse { | ||
type: string; | ||
description: string; | ||
} | ||
|
||
export interface NovesDescribeTxsResponse { | ||
txHash: string; | ||
type: string; | ||
description: string; | ||
}[]; | ||
|
||
export interface NovesTxTranslation { | ||
data?: NovesDescribeTxsResponse; | ||
isLoading: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.