import { grpc } from "@improbable-eng/grpc-web"; import { AddressesResponse, BalanceResponse, NewAddressResponse, SendFilResponse, SignMessageResponse, VerifyMessageResponse } from "@textile/grpc-powergate-client/dist/powergate/user/v1/user_pb"; import { Config } from "../types"; export interface Wallet { /** * Get the balance for a wallet address. * @param address The address to get the balance for. * @returns The address balance. */ balance: (address: string) => Promise; /** * Create a new wallet address associates with the current user. * @param name A human readable name for the address. * @param type Address type, defaults to bls. * @param makeDefault Specify if the new address should become the default address for this user, defaults to false. * @returns Information about the newly created address. */ newAddress: (name: string, type?: "bls" | "secp256k1" | undefined, makeDefault?: boolean | undefined) => Promise; /** * Get all wallet addresses associated with the current user. * @returns A list of wallet addresses. */ addresses: () => Promise; /** * Send FIL from an address associated with the current user to any other address. * @param from The address to send FIL from. * @param to The address to send FIL to. * @param amount The amount of FIL to send. */ sendFil: (from: string, to: string, amount: bigint) => Promise; /** * Sign a message with the specified address. * @param address The address used to sign the message. * @param message The message to sign. * @returns The signature. */ signMessage: (address: string, message: Uint8Array) => Promise; /** * Verify a signed message. * @param address The address that should have signed the message. * @param message The message to verify. * @param signatre The signature to verify. * @returns Whether or not the signature is valid for the provided address and message. */ verifyMessage: (address: string, message: Uint8Array, signature: Uint8Array | string) => Promise; } /** * @ignore */ export declare const createWallet: (config: Config, getMeta: () => grpc.Metadata) => Wallet;