Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gnosis.pm/safe-react-gateway-sdk",
"version": "2.9.0",
"version": "2.10.0",
"main": "dist/index.min.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
21 changes: 20 additions & 1 deletion src/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { AddressEx, TokenInfo } from './transactions'
export type AddressEx = {
value: string
name: string | null
logoUri: string | null
}

export type SafeInfo = {
address: AddressEx
Expand All @@ -20,6 +24,21 @@ export type FiatCurrencies = string[]

export type OwnedSafes = { safes: string[] }

export enum TokenType {
ERC20 = 'ERC20',
ERC721 = 'ERC721',
NATIVE_TOKEN = 'NATIVE_TOKEN',
}

export type TokenInfo = {
type: TokenType
address: string
decimals: number
symbol: string
name: string
logoUri: string | null
}

export type SafeBalanceResponse = {
fiatTotal: string
items: Array<{
Expand Down
25 changes: 6 additions & 19 deletions src/types/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { AddressEx, TokenInfo } from './common'

export type ParamValue = string | ParamValue[]

export enum Operation {
Expand Down Expand Up @@ -27,12 +29,6 @@ export type DataDecoded = {
parameters: Parameter[] | null
}

export type AddressEx = {
value: string
name: string | null
logoUri: string | null
}

export enum TransactionStatus {
AWAITING_CONFIRMATIONS = 'AWAITING_CONFIRMATIONS',
AWAITING_EXECUTION = 'AWAITING_EXECUTION',
Expand All @@ -49,14 +45,14 @@ export enum TransferDirection {
UNKNOWN = 'UNKNOWN',
}

export enum TokenType {
export enum TransactionTokenType {
ERC20 = 'ERC20',
ERC721 = 'ERC721',
NATIVE_COIN = 'NATIVE_COIN',
}

export type Erc20Transfer = {
type: TokenType.ERC20
type: TransactionTokenType.ERC20
tokenAddress: string
tokenName: string | null
tokenSymbol: string | null
Expand All @@ -66,7 +62,7 @@ export type Erc20Transfer = {
}

export type Erc721Transfer = {
type: TokenType.ERC721
type: TransactionTokenType.ERC721
tokenAddress: string
tokenId: string
tokenName: string | null
Expand All @@ -75,7 +71,7 @@ export type Erc721Transfer = {
}

export type NativeCoinTransfer = {
type: TokenType.NATIVE_COIN
type: TransactionTokenType.NATIVE_COIN
value: string
}

Expand Down Expand Up @@ -278,15 +274,6 @@ export type MultisigConfirmation = {
submittedAt: number
}

export type TokenInfo = {
type: TokenType
address: string
decimals: number
symbol: string
name: string
logoUri: string | null
}

export type MultisigExecutionDetails = {
type: 'MULTISIG'
submittedAt: number
Expand Down