{"version":3,"sources":["../../src/types.ts"],"sourcesContent":["import { Network, AccountAddress, Signature, InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from '@endlesslab/endless-ts-sdk';\r\n\r\nexport type ColorMode = 'light' | 'dark';\r\n\r\nexport type EndlessWalletOptions = {\r\n\tcolorMode?: ColorMode;\r\n\tnetwork: Network;\r\n\tfullnode?: string;\r\n\tindexer?: string;\r\n\twalletUrl?: string;\r\n\tprover?: string;\r\n\twindowWidth?: number;\r\n};\r\n\r\nexport enum UserResponseStatus {\r\n\tAPPROVED = 'Approved',\r\n\tREJECTED = 'Rejected'\r\n}\r\n\r\nexport interface UserApproval<TResponseArgs> {\r\n\tstatus: UserResponseStatus.APPROVED;\r\n\targs: TResponseArgs;\r\n}\r\n\r\nexport interface UserRejection {\r\n\tstatus: UserResponseStatus.REJECTED;\r\n\tmessage?: string;\r\n}\r\n\r\nexport type UserResponse<TResponseArgs> = UserApproval<TResponseArgs> | UserRejection;\r\n\r\nexport interface AccountInfo {\r\n\taccount: string;\r\n\taddress: string;\r\n\tauthKey: string;\r\n\tansName?: string;\r\n}\r\n\r\nexport interface NetworkInfo {\r\n\tname: Network;\r\n\tchainId: number;\r\n\turl?: string;\r\n}\r\n\r\nexport type EndlessSignMessageInput = {\r\n\t// Should we include the address of the account in the message\r\n\taddress?: boolean;\r\n\t// Should we include the domain of the dapp\r\n\tapplication?: boolean;\r\n\t// Should we include the current chain id the wallet is connected to\r\n\tchainId?: boolean;\r\n\t// The message to be signed and displayed to the user\r\n\tmessage: string;\r\n\t// A nonce the dapp should generate\r\n\tnonce: string;\r\n};\r\n\r\nexport type EndlessSignMessageOutput = {\r\n\taddress?: string;\r\n\tapplication?: string;\r\n\tchainId?: number;\r\n\tfullMessage: string;\r\n\tpublicKey: string;\r\n\tmessage: string;\r\n\tnonce: string;\r\n\tprefix: 'Endless::Message';\r\n\tsignature: Signature;\r\n};\r\n\r\nexport interface EndlessSignAndSubmitTransactionInput {\r\n\tpayload: InputGenerateTransactionPayloadData; // the transaction payload\r\n\toptions?: InputGenerateTransactionOptions;\r\n}\r\n\r\nexport enum EndlessSendTransactionType {\r\n\tSIGNATURE_ONLY = 'signatureOnly',\r\n\tSIGN_AND_SUBMIT = 'signAndSubmit'\r\n}\r\n\r\nexport enum EndlessWalletTransactionType {\r\n\tSIMPLE = 'simple',\r\n\tMULTI_AGENT = 'multiAgent'\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tWeixinJSBridge: {\r\n\t\t\tinvoke(api: string, data: any, callback: (res: any) => void): void;\r\n\t\t\ton(api: string, callback: (res: any) => void): void;\r\n\t\t}\r\n\t}\r\n}\r\n"],"mappings":"AAcO,IAAKA,OACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WAFAA,OAAA,IA4DAC,OACXA,EAAA,eAAiB,gBACjBA,EAAA,gBAAkB,gBAFPA,OAAA,IAKAC,OACXA,EAAA,OAAS,SACTA,EAAA,YAAc,aAFHA,OAAA","names":["UserResponseStatus","EndlessSendTransactionType","EndlessWalletTransactionType"]}