/*** * Copyright of React Scripts */ /// declare namespace NodeJS { interface ProcessEnv { readonly NODE_ENV: 'development' | 'production' | 'test'; readonly PUBLIC_URL: string; } } declare module '*.avif' { const src: string; export default src; } declare module '*.bmp' { const src: string; export default src; } declare module '*.gif' { const src: string; export default src; } declare module '*.jpg' { const src: string; export default src; } declare module '*.jpeg' { const src: string; export default src; } declare module '*.png' { const src: string; export default src; } declare module '*.webp' { const src: string; export default src; } declare module '*.svg' { import * as React from 'react'; export const ReactComponent: React.FunctionComponent & { title?: string; }>; const src: string; export default src; } declare module '*.module.css' { const classes: { readonly [key: string]: string; }; export default classes; } declare module '*.module.scss' { const classes: { readonly [key: string]: string; }; export default classes; } declare module '*.module.sass' { const classes: { readonly [key: string]: string; }; export default classes; } /** * Copyright of Senhub */ declare type SentreNotification = { type: 'error' | 'warning' | 'success' | 'info'; description: string; onClick?: () => void; }; declare type SentreMessage = { type: 'error' | 'warning' | 'success' | 'info' | 'loading'; description: string; onClick?: () => void; }; interface Window { sentre: { solana: WalletInterface; }; notify: ({ type, description, onClick }: SentreNotification) => void; message: ({ type, description, onClick }: SentreMessage) => void; coin98: any; solana: any; Slope: any; solflare: any; clover_solana: any; exodus: any; phantom: any; } interface BigInt { toJSON: (this: bigint) => string; } declare type AppIds = Array; declare type ComponentManifest = { url: string; appId: string; name: string; author: { name: string; email: string; }; tags: string[]; description: string; verified: boolean; }; declare type DAppManifest = ComponentManifest & { author: { walletAddress: string; }; createdAt: string; updatedAt: string; }; declare type SenReg = Record; declare type CgkData = { icon: any; symbol: any; name: any; address: any; rank: any; price: any; priceChange: any; totalVolume: any; }; declare module '*.md'; interface WalletProvider { disconnect: () => void; } declare type SignedMessage = { address: string; signature: string; message: string; }; interface WalletInterface { /** * Any string that you can recognize your wallet type. For example: PrivateKey, Phantom, Sollet, ... */ walletType: string; /** * Async public key */ publicKey: import('@solana/web3.js').PublicKey | null; /** * Wallet providers are varied from the original wallet (Coin98, Slope, ...). * Seems there is no single common standard, thus we only require `disconnect` method for the returned `provider`. * @return Provider */ getProvider(): Promise; /** * Return wallet address * @returns Wallet address (base58) */ getAddress(): Promise; /** * Sign the input transaction and return signed transaction * @param transaction - The transaction that needs to be signed * @returns The signed transaction */ signTransaction(transaction: import('@solana/web3.js').Transaction): Promise; /** * Sign the input transactions and return signed transactions * @param transaction - The transaction that needs to be signed * @returns The signed transactions */ signAllTransactions(transactions: import('@solana/web3.js').Transaction[]): Promise; /** * Sign a message and return a signed messaged * @param message - String needs to be signed * @returns SignedMessage */ signMessage(message: string): Promise; /** * Verify a singed message * @param signature - Signature (`signedMessage.signature`) * @param message - The original message (or `signedMessage.message`) * @param address - Optional. The address that signed the message. If not provided, the `address` will be fetched by `this.getAddress()`. */ verifySignature(signature: string, message: string, address?: string): Promise; /** * Call the `disconnect` method from `provider` returned by `getProvider` */ disconnect(): Promise; }