@venly/connect
Version:
Venly Connect SDK
52 lines (51 loc) • 2.64 kB
TypeScript
import { SecretType } from '../models/SecretType';
import { Wallet, WalletType } from '../models/wallet/Wallet';
import { Profile } from '../models/profile/Profile';
import { WalletBalance } from '../models/wallet/WalletBalance';
import { TokenBalance } from '../models/wallet/TokenBalance';
import { NFT, WalletItems } from '../models/wallet/NFT';
import { TransactionRequest } from '..';
import { ContractReadRequest } from '../models/contract/ContractReadRequest';
import { ContractReadResult } from '../models/contract/ContractReadResult';
import { RestApiResponseTxStatus } from '../models/transaction/status/RestApiResponseTxStatus';
export declare class Api {
private _baseUrl;
private _tokenProvider;
constructor(baseURL: string, tokenProvider?: any);
private fetchGet;
private fetchPost;
private fetchDelete;
getAvailableSecretTypes: () => Promise<SecretType[]>;
getWallets: (params?: {
secretType?: SecretType | undefined;
walletType?: WalletType | undefined;
includeBalance?: boolean | undefined;
} | undefined) => Promise<Wallet[]>;
getWallet: (walletId: string) => Promise<Wallet>;
getBalance: (walletId: string) => Promise<WalletBalance>;
getBalanceByAddress: (secretType: SecretType, walletAddress: string) => Promise<WalletBalance>;
getTokenBalances: (walletId: string) => Promise<TokenBalance[]>;
getTokenBalancesByAddress: (secretType: SecretType, walletAddress: string) => Promise<TokenBalance[]>;
getTokenBalance: (walletId: string, tokenAddress: string) => Promise<TokenBalance>;
getTokenBalanceByAddress: (secretType: SecretType, walletAddress: string, tokenAddress: string) => Promise<TokenBalance>;
getNonfungibles: (walletId: string) => Promise<NFT[]>;
getNonfungiblesByAddress: (secretType: SecretType, walletAddress: string) => Promise<NFT[]>;
getAllNonfungibles: (secretTypes?: SecretType[] | undefined) => Promise<WalletItems[]>;
unlink: (walletId: string) => Promise<void>;
getProfile: () => Promise<Profile>;
private processResponse;
getPendingTransactions: () => Promise<TransactionRequest[]>;
deleteTransaction: (transactionId: string) => Promise<any>;
getTransactionStatus: (transactionHash: string, secretType: SecretType) => Promise<RestApiResponseTxStatus>;
private mapTransactionData;
readContract: (contractReadRequest: ContractReadRequest) => Promise<ContractReadResult>;
}
export interface RestApiResponseError {
code: string;
message: string;
}
export interface RestApiResponse<T> {
success: boolean;
errors: RestApiResponseError[];
result: T;
}