import type { AppInfo, GatewayConfig, PermissionType } from 'arconnect'; import { ArweaveInterface } from 'arweave-wallet-connector/lib/Arweave'; // note: arconnect works natively with the APIs of window.arweaveWallet export type supportedWallets = | 'arconnect' | 'arweave.app' | 'window.arweaveWallet'; export type AlgorithmInterface = | AlgorithmIdentifier | RsaPssParams | EcdsaParams; export interface options { algorithm: string; hash: string; salt?: string; } export interface ANS { address_color: string; currentLabel: string; avatar: string; } export type BufferEncoding = | 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; export type createSignatureInterface = ( data: Uint8Array, signatureParams?: AlgorithmInterface, returnType?: 'Uint8Array' | BufferEncoding, sigType?: 'new' | 'old' ) => Promise; export type encryptInterface = ( options: { name: string; hash?: string; salt?: string; }, data: BufferSource ) => Promise; export type decryptInterface = ( data: Uint8Array, algorithm: options ) => Promise; export type arconnectConnectInterface = ( permissions: PermissionType[], AppInfo?: AppInfo, gatewayConfig?: GatewayConfig, walletChoice?: supportedWallets ) => Promise; export interface ArconnectContextInterface { api: any | ArweaveInterface; walletPermissions: PermissionType[]; walletConnected: boolean; walletType: supportedWallets | undefined; address: string; ANS: ANS | undefined; arconnectConnect: arconnectConnectInterface; arconnectDisconnect: () => Promise; getPublicKey: () => Promise; createSignature: createSignatureInterface; } export { PermissionType }; export interface ProviderOptions { AppInfo?: AppInfo; gatewayConfig?: GatewayConfig; defaultWallet?: supportedWallets; } export type ArconnectProviderProps = { children: any; params: ProviderOptions; };