@gnosis.pm/safe-apps-sdk
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5
{ | ||
"name": "@gnosis.pm/safe-apps-sdk", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.5", | ||
"description": "SDK developed to integrate third-party apps with Safe-Multisig app.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -1,2 +0,2 @@ | ||
import { Communicator, SafeInfo, SafeBalances } from '../types'; | ||
import { Communicator, SafeInfo, SafeBalances, GetBalanceParams } from '../types'; | ||
declare class Safe { | ||
@@ -6,4 +6,4 @@ private readonly communicator; | ||
getInfo(): Promise<SafeInfo>; | ||
getBalances(): Promise<SafeBalances>; | ||
getBalances({ currency }?: GetBalanceParams): Promise<SafeBalances>; | ||
} | ||
export { Safe }; |
@@ -16,4 +16,6 @@ "use strict"; | ||
} | ||
async getBalances() { | ||
const response = await this.communicator.send(methods_1.METHODS.getSafeBalances, undefined); | ||
async getBalances({ currency = 'usd' } = {}) { | ||
const response = await this.communicator.send(methods_1.METHODS.getSafeBalances, { | ||
currency, | ||
}); | ||
if (!response.success) { | ||
@@ -20,0 +22,0 @@ throw new Error(response.error); |
@@ -5,2 +5,3 @@ import { METHODS } from './communication/methods'; | ||
import { Eth } from './eth'; | ||
import { Safe } from './safe'; | ||
export declare type Networks = 'MAINNET' | 'MORDEN' | 'ROPSTEN' | 'RINKEBY' | 'GOERLI' | 'KOVAN' | 'XDAI' | 'ENERGY_WEB_CHAIN' | 'VOLTA' | 'UNKNOWN'; | ||
@@ -20,2 +21,5 @@ export interface Transaction { | ||
} | ||
export declare type GetBalanceParams = { | ||
currency?: string; | ||
}; | ||
export declare type SendTransactionsResponse = { | ||
@@ -27,2 +31,3 @@ safeTxHash: string; | ||
eth: Eth; | ||
safe: Safe; | ||
} | ||
@@ -156,19 +161,25 @@ export interface SafeInfo { | ||
}; | ||
export declare type EtherBalanceServiceModel = { | ||
tokenAddress: null; | ||
token: null; | ||
balance: string; | ||
}; | ||
export declare type TokenBalanceServiceModel = { | ||
tokenAddress: string; | ||
token: TokenServiceModel; | ||
balance: string; | ||
}; | ||
export declare type TokenServiceModel = { | ||
export declare type TokenType = 'ERC721' | 'ERC20' | 'ETHER'; | ||
export declare type TokenProps = { | ||
address: string; | ||
name: string; | ||
symbol: string; | ||
decimals: number; | ||
decimals: number | string; | ||
logoUri: string; | ||
type?: TokenType; | ||
}; | ||
export declare type SafeBalances = (EtherBalanceServiceModel | TokenBalanceServiceModel)[]; | ||
export declare type TokenBalance = { | ||
tokenInfo: TokenProps; | ||
balance: string; | ||
fiatBalance: string; | ||
fiatConversion: string; | ||
}; | ||
export declare type BalanceEndpoint = { | ||
fiatTotal: string; | ||
items: TokenBalance[]; | ||
}; | ||
export declare type SafeBalances = { | ||
fiatTotal: string; | ||
items: TokenBalance[]; | ||
}; | ||
export declare type RpcCallNames = keyof typeof RPC_CALLS; | ||
@@ -175,0 +186,0 @@ export interface Communicator { |
{ | ||
"name": "@gnosis.pm/safe-apps-sdk", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.5", | ||
"description": "SDK developed to integrate third-party apps with Safe-Multisig app.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53375
751