UNPKG

@stoar/sdk

Version:

JavaScript/TypeScript SDK for STOAR - Decentralized file storage on Arweave

43 lines 1.96 kB
import type { WalletInterface } from '../types'; export { WalletError } from '../types'; export type { WalletInterface }; export declare abstract class BaseBrowserWallet<TArweave> implements WalletInterface { protected arweave: TArweave; address: string; protected constructor(arweave: TArweave); protected connect(): Promise<void>; sign(data: Uint8Array): Promise<Uint8Array>; getPublicKey(): Promise<string>; encrypt(data: Uint8Array, publicKey: string): Promise<Uint8Array>; decrypt(data: Uint8Array): Promise<Uint8Array>; } export declare abstract class BaseJSONWallet<TArweave> implements WalletInterface { protected arweave: TArweave; readonly jwk: any; address: string; protected constructor(arweave: TArweave, jwk: any); protected abstract jwkToAddress(jwk: any): Promise<string>; protected abstract cryptoSign(jwk: any, data: Uint8Array): Promise<Uint8Array>; protected abstract cryptoEncrypt(data: Uint8Array, publicKey: string): Promise<Uint8Array>; protected abstract cryptoDecrypt(jwk: any, data: Uint8Array): Promise<Uint8Array>; sign(data: Uint8Array): Promise<Uint8Array>; getPublicKey(): Promise<string>; encrypt(data: Uint8Array, publicKey: string): Promise<Uint8Array>; decrypt(data: Uint8Array): Promise<Uint8Array>; } declare global { interface Window { arweaveWallet?: { connect(permissions: string[]): Promise<void>; disconnect(): Promise<void>; getActiveAddress(): Promise<string>; getActivePublicKey(): Promise<string>; getAllAddresses(): Promise<string[]>; signature(data: Uint8Array, algorithm: any): Promise<ArrayBuffer>; encrypt(data: Uint8Array, publicKey: string): Promise<ArrayBuffer>; decrypt(data: Uint8Array): Promise<ArrayBuffer>; sign(transaction: any): Promise<any>; }; } } //# sourceMappingURL=base.d.ts.map