@ultraos/wallet-sdk 0.3.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +19 -8
  3. package/dist/index.mjs +559 -0
  4. package/dist/index.mjs.map +7 -0
  5. package/package.json +18 -3
  6. package/src/lib/interfaces/connect-params.interface.d.ts +12 -0
  7. package/src/lib/interfaces/connect-params.interface.d.ts.map +1 -1
  8. package/src/lib/interfaces/connect-params.interface.js.map +1 -1
  9. package/src/lib/interfaces/index.d.ts +0 -1
  10. package/src/lib/interfaces/index.d.ts.map +1 -1
  11. package/src/lib/interfaces/index.js +0 -1
  12. package/src/lib/interfaces/index.js.map +1 -1
  13. package/src/lib/interfaces/wallet-provider-response.interface.d.ts +84 -27
  14. package/src/lib/interfaces/wallet-provider-response.interface.d.ts.map +1 -1
  15. package/src/lib/interfaces/wallet-provider-response.interface.js.map +1 -1
  16. package/src/lib/interfaces/wallet-provider.interface.d.ts +1 -17
  17. package/src/lib/interfaces/wallet-provider.interface.d.ts.map +1 -1
  18. package/src/lib/interfaces/wallet-provider.interface.js.map +1 -1
  19. package/src/lib/providers/extension-provider/extension.provider.d.ts +1 -7
  20. package/src/lib/providers/extension-provider/extension.provider.d.ts.map +1 -1
  21. package/src/lib/providers/extension-provider/extension.provider.js +0 -6
  22. package/src/lib/providers/extension-provider/extension.provider.js.map +1 -1
  23. package/src/lib/providers/web-provider/web.provider.d.ts +1 -7
  24. package/src/lib/providers/web-provider/web.provider.d.ts.map +1 -1
  25. package/src/lib/providers/web-provider/web.provider.js +0 -10
  26. package/src/lib/providers/web-provider/web.provider.js.map +1 -1
  27. package/src/lib/ultra-wallet-sdk.d.ts +1 -7
  28. package/src/lib/ultra-wallet-sdk.d.ts.map +1 -1
  29. package/src/lib/ultra-wallet-sdk.js +0 -6
  30. package/src/lib/ultra-wallet-sdk.js.map +1 -1
  31. package/src/lib/interfaces/purchase-item.interface.d.ts +0 -8
  32. package/src/lib/interfaces/purchase-item.interface.d.ts.map +0 -1
  33. package/src/lib/interfaces/purchase-item.interface.js +0 -9
  34. package/src/lib/interfaces/purchase-item.interface.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../libs/wallet-sdk/src/lib/interfaces/error-enum.ts", "../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider-response.interface.ts", "../../../../libs/wallet-sdk/src/lib/config/ultra-wallet-sdk.config.ts", "../../../../libs/wallet-sdk/src/lib/utils/chain-validator.ts", "../../../../libs/wallet-sdk/src/lib/providers/extension-provider/extension.provider.ts", "../../../../libs/wallet-sdk/src/lib/common/client-messenger.ts", "../../../../libs/wallet-sdk/src/lib/common/client-error.ts", "../../../../libs/wallet-sdk/src/lib/common/window-manager.ts", "../../../../libs/wallet-sdk/src/lib/providers/web-provider/web.provider.ts", "../../../../libs/wallet-sdk/src/lib/utils/detection.ts", "../../../../libs/wallet-sdk/src/lib/ultra-wallet-sdk.ts"],
4
+ "sourcesContent": ["export enum SdkErrorCode {\n USER_REJECTED_REQUEST = 4001,\n WALLET_HANDSHAKE_TIMEOUT = 4300,\n WALLET_WINDOW_UNAVAILABLE = 4301,\n REQUESTED_RESOURCE_NOT_AVAILABLE = 32002,\n UNKNOWN_ERROR = -32604,\n}\n\nexport const SDK_ERROR_MESSAGE: { [key in SdkErrorCode]: string } = {\n [SdkErrorCode.USER_REJECTED_REQUEST]: 'The user rejected the request.',\n [SdkErrorCode.WALLET_HANDSHAKE_TIMEOUT]: 'Timeout to connect with the web wallet.',\n [SdkErrorCode.WALLET_WINDOW_UNAVAILABLE]: 'Wallet window blocked by browser or failed to open.',\n [SdkErrorCode.REQUESTED_RESOURCE_NOT_AVAILABLE]: 'Requested resource not available.',\n [SdkErrorCode.UNKNOWN_ERROR]: 'Unknown error occurred.',\n};\n", "/**\n * A generic wrapper for all Ultra Wallet SDK responses.\n * Encapsulates the status, data payload, and optional error messaging or codes.\n *\n * @template T The type of the data payload contained in the response.\n */\nexport interface UltraResponse<T = any> {\n /**\n * The status of the response, e.g., success, fail, or error.\n */\n status: ResponseStatus;\n /**\n * The actual response data payload.\n */\n data: T;\n /**\n * Optional end-user-readable message, explaining what went wrong (if applicable).\n */\n message?: string;\n /**\n * Optional error or status code.\n */\n code?: number;\n}\n\n/**\n * Enumeration of possible response statuses returned by the Ultra Wallet SDK.\n */\nexport enum ResponseStatus {\n SUCCESS = 'success',\n FAIL = 'fail',\n ERROR = 'error',\n}\n\n/**\n * Represents the result of a disconnect request.\n * A boolean indicating whether the disconnection was successful.\n */\nexport type DisconnectResponse = boolean;\n\n/**\n * Represents a single permission entry associated with a blockchain account.\n */\nexport interface PermissionInfo {\n /**\n * The permission level name (e.g., \"active\", \"owner\").\n */\n name: string;\n /**\n * The public keys associated with this permission.\n */\n publicKeys: string[];\n}\n\n/**\n * Represents a blockchain account with its associated permissions.\n */\nexport interface AccountInfo {\n /**\n * The blockchain account name.\n */\n accountName: string;\n /**\n * The list of permissions associated with this account.\n */\n permissions: PermissionInfo[];\n}\n\n/**\n * Represents information about the connected blockchain network.\n */\nexport interface NetworkInfo {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n}\n\n/**\n * Extended network information including connection details.\n * Returned by getNetwork and getNetworks.\n */\nexport interface NetworkDetails {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n /**\n * The RPC node URL for the network.\n */\n nodeUrl: string;\n /**\n * Whether this is a user-defined custom network.\n */\n isCustom?: boolean;\n}\n\n/**\n * One account the wallet currently holds signing keys for, plus the permission\n * names whose keys it controls. Sourced from the same set the wallet exposes via\n * `ConnectResult.accounts` — never an FE-supplied (spoofable) list (RFC §2.1 / §5.6).\n */\nexport interface SignableAccount {\n /** The blockchain account name. */\n account: string;\n /** The permission names the wallet holds the signing key for (e.g. `active`). */\n permissions: string[];\n}\n\n/**\n * The signed payload of a connect-time identity attestation (RFC §2.1). The canonical\n * form — JSON with sorted keys, UTF-8 encoded, SHA-256 hashed — is what the wallet signs.\n */\nexport interface AttestationPayload {\n /** Attestation format version. */\n v: 1;\n /** The signing public key (e.g. `EOS...` / `UTR...`). */\n pubkey: string;\n /** The primary account name (the one signing). */\n account: string;\n /** The permission used to sign (e.g. `active`, `owner`). */\n permission: string;\n /** The dApp origin the attestation is bound to (e.g. `http://localhost:5172`). */\n origin: string;\n /** The chain identifier the attestation is scoped to. */\n chainId: string;\n /** Issued-at, unix seconds. */\n iat: number;\n /** Expiry, unix seconds. */\n exp: number;\n /** 32-byte random value, hex-encoded. */\n nonce: string;\n /**\n * The full set of accounts the wallet currently holds signing keys for, each with\n * the permission names it controls. Lets a backend reason about the user's real\n * account set without trusting an FE-supplied (spoofable) list. Omitted when the\n * wallet doesn't enumerate additional accounts — backends MUST fall back to the\n * primary `account` field on absence.\n */\n signableAccounts?: SignableAccount[];\n}\n\n/**\n * A connect-time identity attestation, optionally produced by the wallet when the\n * user approves a `connect()`. Rides the existing connect consent — no extra popup.\n *\n * Present only if the connected wallet vendor supports silent attestation; absent\n * otherwise. dApps treat absence as \"fall back to whatever auth this dApp uses\n * without attestation\". The SDK does not verify or transform this value — it is\n * passed through verbatim from the wallet. Verification is the consumer backend's\n * responsibility (see RFC §2.4 / §5).\n *\n * @see https://github.com/ultraio/ultra-tool-kit/blob/feature/ai-enhancement/docs/proposals/wallet-native-attestation.md\n *\n * @experimental Issued only by the browser-extension wallet and not yet consumed by any\n * Ultra service; the shape may change before it is stabilised.\n */\nexport interface ConnectAttestation {\n /** The signed identity payload. */\n payload: AttestationPayload;\n /** Signature over the canonical hash of `payload` (e.g. `SIG_K1_...`). */\n signature: string;\n}\n\n/**\n * Represents the result of a successful connection request, containing the user's account details.\n * Backward-compatible: legacy fields `blockchainid` and `publicKey` are preserved alongside\n * the new multi-account fields.\n */\nexport type ConnectResult = {\n /**\n * The connected (selected) account name, e.g. `aa1aa2aa3aa4` — not a chain id.\n * Equals `selectedAccount.accountName` when the wallet returns `selectedAccount`;\n * the Web Wallet returns only this legacy field.\n * @deprecated Use `selectedAccount.accountName` when present.\n */\n blockchainid: string;\n /**\n * The public key associated with the user's account.\n * @deprecated Use `selectedAccount.permissions[n].publicKeys` instead.\n */\n publicKey: string;\n /**\n * All accounts available in the connected wallet.\n */\n accounts?: AccountInfo[];\n /**\n * The currently selected account.\n */\n selectedAccount?: AccountInfo;\n /**\n * Information about the connected blockchain network.\n */\n network?: NetworkInfo;\n /**\n * The nonce passed to `connect({ nonce })`, echoed back. Present only when a nonce was sent.\n */\n nonce?: string;\n /**\n * The wallet's signature over `nonce` (same scheme as `signMessage`). Present only when a nonce was sent.\n */\n signedNonce?: string;\n /**\n * An optional connect-time identity attestation. Present only when the connected\n * wallet vendor supports silent attestation; `undefined` otherwise. Passed through\n * verbatim from the wallet — the SDK does not verify or transform it.\n * @experimental See {@link ConnectAttestation}.\n */\n attestation?: ConnectAttestation;\n};\n\n/**\n * Represents the result returned after signing a message with the Ultra Wallet.\n */\nexport interface SignMessageResult {\n signature: string;\n}\n\n/**\n * Represents the result returned after signing a blockchain transaction with the Ultra Wallet.\n */\nexport interface SignTransactionResult {\n /**\n * The hash of the signed blockchain transaction.\n */\n transactionHash?: string;\n /**\n * Authorizations that couldn't be signed because the wallet lacks the keys.\n * Format: [\"account@permission\", ...]\n * Absent or empty means all authorizations were signed.\n */\n unsignedAuth?: string[];\n processed?: {\n id: string;\n block_num: number;\n block_time: string; // ISO timestamp\n producer_block_id: string | null;\n receipt: {\n status: string;\n cpu_usage_us: number;\n net_usage_words: number;\n };\n elapsed: number;\n net_usage: number;\n scheduled: boolean;\n action_traces: ActionTrace[];\n account_ram_delta: any | null;\n except: any | null;\n error_code: number | null;\n };\n}\n\nexport interface ActionTrace {\n action_ordinal: number;\n creator_action_ordinal: number;\n closest_unnotified_ancestor_action_ordinal: number;\n receipt: {\n receiver: string;\n act_digest: string;\n global_sequence: number;\n recv_sequence: number;\n auth_sequence: [string, number][];\n code_sequence: number;\n abi_sequence: number;\n };\n receiver: string;\n act: {\n account: string;\n name: string;\n authorization: {\n actor: string;\n permission: string;\n }[];\n data: {\n from: string;\n to: string;\n quantity: string;\n memo: string;\n };\n hex_data: string;\n };\n context_free: boolean;\n elapsed: number;\n console: string;\n trx_id: string;\n block_num: number;\n block_time: string;\n producer_block_id: string | null;\n account_ram_deltas: any[];\n except: any | null;\n error_code: number | null;\n return_value_hex_data: string;\n inline_traces: ActionTrace[];\n}\n", "interface UltraWalletSdkConfig {\n width: number;\n height: number;\n walletUrls: {\n mainnet: string;\n testnet: string;\n };\n checkWindowInterval: number;\n handshakeTimeout: number;\n networkInfo: Record<\n 'mainnet' | 'testnet',\n {\n chainId: string;\n }\n >;\n}\n\nconst UltraWalletSdkConfig: UltraWalletSdkConfig = Object.freeze({\n width: 420,\n height: 815,\n walletUrls: {\n mainnet: 'https://web-wallet.ultra.io',\n testnet: 'https://web-wallet.staging.ultra.io',\n },\n networkInfo: {\n mainnet: {\n chainId: 'a9c481dfbc7d9506dc7e87e9a137c931b0a9303f64fd7a1d08b8230133920097',\n },\n testnet: {\n chainId: '7fc56be645bb76ab9d747b53089f132dcb7681db06f0852cfa03eaf6f7ac80e9',\n },\n },\n checkWindowInterval: 500,\n handshakeTimeout: 10_000,\n});\n\nexport default UltraWalletSdkConfig;\n", "import UltraWalletSdkConfig from '../config/ultra-wallet-sdk.config';\n\nexport function isValidChain(targetNetwork: string, walletChainId: string): boolean {\n const { chainId } = UltraWalletSdkConfig.networkInfo[targetNetwork] || {};\n return !chainId || chainId === walletChainId;\n}\n", "import {\n AccountInfo,\n AvailableAuth,\n BlockchainTransaction,\n ConnectParams,\n ConnectResult,\n NetworkDetails,\n SignMessageResult,\n SignTransactionOptions,\n SignTransactionResult,\n UltraResponse,\n UltraWalletProvider,\n UltraWalletSdkOptions,\n WalletEventType,\n} from '../../interfaces';\nimport { isValidChain } from '../../utils/chain-validator';\n\n/**\n * Internal extension-only API exposed by the wallet's content-script-injected\n * `window.ultra` proxy. Not part of the public `UltraWalletProvider`\n * interface — the SDK calls these to manage listener registration with the\n * extension's background service worker.\n */\ninterface ExtensionListenerAPI {\n addExtensionListener?(event: WalletEventType, listenerId: string): Promise<unknown> | unknown;\n removeExtensionListener?(event: WalletEventType, listenerId: string): Promise<unknown> | unknown;\n}\n\nconst HEARTBEAT_INTERVAL_MS = 2_000;\n\nexport class ExtensionProvider implements UltraWalletProvider {\n private readonly eventListeners = new Map<WalletEventType, Array<(data: any) => void>>();\n private readonly listenerIds = new Map<WalletEventType, string>();\n private heartbeatTimer: ReturnType<typeof setInterval> | null = null;\n private messageHandler: ((event: MessageEvent) => void) | null = null;\n\n /**\n * Access window.ultra typed as UltraWalletProvider.\n * At runtime, window.ultra is a Proxy that handles all SDK method calls.\n * We cast here rather than declaring a global Window augmentation to avoid\n * conflicting with the app-level window.d.ts which types window.ultra as IUltraInternalAPI.\n */\n private get walletProvider(): UltraWalletProvider & ExtensionListenerAPI {\n return (window as any).ultra as UltraWalletProvider & ExtensionListenerAPI;\n }\n\n constructor(private readonly options?: UltraWalletSdkOptions) {\n this.initWindowEventListener();\n }\n\n /**\n * Wire-format match: the BG's MessageType.EVENT serialises as the uppercase\n * string 'EVENT'. We uppercase the incoming type so a future SDK build that\n * emits lowercase (or any case variant) still dispatches. Payload shape:\n * `{ event, origin, data }`.\n */\n private initWindowEventListener(): void {\n if (typeof window === 'undefined') return;\n if (this.messageHandler) return;\n this.messageHandler = (event: MessageEvent) => {\n if (event.source !== window || !event.data) return;\n const msg = event.data;\n const msgType = typeof msg.type === 'string' ? msg.type.toUpperCase() : '';\n if (msgType !== 'EVENT' || !msg.payload) return;\n const eventName = msg.payload.event as WalletEventType;\n if (!eventName) return;\n const cbs = this.eventListeners.get(eventName);\n if (cbs) cbs.forEach((cb) => cb(msg.payload.data));\n };\n window.addEventListener('message', this.messageHandler);\n }\n\n async connect(params?: ConnectParams): Promise<UltraResponse<ConnectResult>> {\n const { data: chainId } = await this.walletProvider.getChainId();\n if (!isValidChain(this.options?.environment, chainId)) {\n throw new Error(\n `Wallet environment mismatch: expected \"${this.options?.environment}\" chain, but received \"${chainId}\". Please verify the SDK configuration and the connected network.`,\n );\n }\n const result = await this.walletProvider.connect(params);\n // After connect() succeeds, the origin is now trusted in the BG. Any\n // pre-connect on() calls registered listener-ids that the BG silently\n // dropped (untrusted-origin no-op). Clear and re-register so the heartbeat\n // observes the fresh state.\n if (result?.status === 'success') {\n this.listenerIds.clear();\n for (const event of this.eventListeners.keys()) {\n void this.registerListenerWithExtension(event);\n }\n }\n return result;\n }\n\n disconnect(): Promise<UltraResponse<boolean>> {\n return this.walletProvider.disconnect();\n }\n\n signMessage(message: string): Promise<UltraResponse<SignMessageResult>> {\n return this.walletProvider.signMessage(message);\n }\n\n signTransaction(\n transaction: BlockchainTransaction | BlockchainTransaction[],\n options?: SignTransactionOptions,\n ): Promise<UltraResponse<SignTransactionResult>> {\n return this.walletProvider.signTransaction(transaction, options);\n }\n\n getChainId(): Promise<UltraResponse<string>> {\n return this.walletProvider.getChainId();\n }\n\n getAccounts(): Promise<UltraResponse<AccountInfo[]>> {\n return this.walletProvider.getAccounts();\n }\n\n getSelectedAccount(): Promise<UltraResponse<AccountInfo>> {\n return this.walletProvider.getSelectedAccount();\n }\n\n getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>> {\n return this.walletProvider.getAvailableAuthorizations();\n }\n\n on(event: WalletEventType, callback: (data: any) => void): void {\n this.initWindowEventListener();\n const cbs = this.eventListeners.get(event) ?? [];\n cbs.push(callback);\n this.eventListeners.set(event, cbs);\n // Idempotent re-register: every on() call refreshes the BG's record of\n // this listener-id. Defends against extension-reload wipe and the\n // pre-connect untrusted-origin no-op race.\n void this.registerListenerWithExtension(event);\n this.ensureHeartbeat();\n }\n\n off(event: WalletEventType, callback: (data: any) => void): void {\n const cbs = this.eventListeners.get(event);\n if (!cbs) return;\n const idx = cbs.indexOf(callback);\n if (idx >= 0) cbs.splice(idx, 1);\n if (cbs.length === 0) {\n this.eventListeners.delete(event);\n void this.deregisterListenerWithExtension(event);\n }\n }\n\n switchNetwork(chainId: string): Promise<UltraResponse<void>> {\n return this.walletProvider.switchNetwork(chainId);\n }\n\n getNetwork(): Promise<UltraResponse<NetworkDetails>> {\n return this.walletProvider.getNetwork();\n }\n\n getNetworks(): Promise<UltraResponse<NetworkDetails[]>> {\n return this.walletProvider.getNetworks();\n }\n\n /**\n * Detach the window message listener and clear timers + maps. Safe to call\n * multiple times. Does NOT deregister each listener on the BG — the BG\n * GCs on tab close (verified via the S5(b) dedup work + tab-close cleanup\n * in `EventsService.removeTabListeners`). Calling N RPCs at dispose-time\n * would slow the page-unload path for no benefit.\n */\n dispose(): void {\n if (this.heartbeatTimer != null) {\n clearInterval(this.heartbeatTimer);\n this.heartbeatTimer = null;\n }\n if (this.messageHandler && typeof window !== 'undefined') {\n window.removeEventListener('message', this.messageHandler);\n this.messageHandler = null;\n }\n this.eventListeners.clear();\n this.listenerIds.clear();\n }\n\n private async registerListenerWithExtension(event: WalletEventType): Promise<void> {\n if (!this.isExtensionAvailable()) return;\n const id = this.listenerIds.get(event) ?? this.generateListenerId();\n this.listenerIds.set(event, id);\n try {\n const result = this.walletProvider.addExtensionListener?.(event, id);\n if (result && typeof (result as Promise<unknown>).catch === 'function') {\n // Don't drop the id on rejection — heartbeat will retry.\n (result as Promise<unknown>).catch(() => undefined);\n }\n } catch {\n // Swallow: heartbeat retry will pick this up.\n }\n }\n\n private async deregisterListenerWithExtension(event: WalletEventType): Promise<void> {\n if (!this.isExtensionAvailable()) return;\n const id = this.listenerIds.get(event);\n if (!id) return;\n this.listenerIds.delete(event);\n try {\n const result = this.walletProvider.removeExtensionListener?.(event, id);\n if (result && typeof (result as Promise<unknown>).catch === 'function') {\n (result as Promise<unknown>).catch(() => undefined);\n }\n } catch {\n // Ignore — extension may have been removed.\n }\n }\n\n private ensureHeartbeat(): void {\n if (this.heartbeatTimer != null || typeof window === 'undefined') return;\n // Cadence matches the toolkit's prior workaround. Lower = BG storage-write\n // overhead; higher = wider post-reload event-drop window.\n this.heartbeatTimer = setInterval(() => this.heartbeatTick(), HEARTBEAT_INTERVAL_MS);\n }\n\n private heartbeatTick(): void {\n if (!this.isExtensionAvailable()) return;\n let hasAny = false;\n for (const cbs of this.eventListeners.values()) {\n if (cbs.length > 0) {\n hasAny = true;\n break;\n }\n }\n if (!hasAny) return;\n for (const event of this.eventListeners.keys()) {\n void this.registerListenerWithExtension(event);\n }\n }\n\n private isExtensionAvailable(): boolean {\n return typeof window !== 'undefined' && !!(window as any).ultra;\n }\n\n private generateListenerId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return Math.random().toString(36).slice(2) + Date.now().toString(36);\n }\n}\n", "import { JSONRPCClient } from 'json-rpc-2.0';\n\nimport UltraWalletSdkConfig from '../config/ultra-wallet-sdk.config';\nimport { JsonRpcMessage, ResponseStatus, SdkErrorCode, UltraResponse } from '../interfaces';\n\nimport { ClientError } from './client-error';\nimport { WindowManager } from './window-manager';\n\nexport class ClientMessenger {\n private windowManager: WindowManager;\n private rpcClient: JSONRPCClient;\n private pendingRequest = false;\n\n constructor(windowManager: WindowManager) {\n this.windowManager = windowManager;\n this.initializeRpcClient();\n this.setupMessageListener();\n }\n\n private initializeRpcClient(): void {\n this.rpcClient = new JSONRPCClient((request) => {\n const walletWindow = this.windowManager.getWalletWindow();\n if (!walletWindow) {\n return Promise.reject(new ClientError(SdkErrorCode.WALLET_WINDOW_UNAVAILABLE));\n }\n walletWindow.postMessage(request, this.windowManager.walletUrl);\n return Promise.resolve();\n });\n }\n\n private setupMessageListener(): void {\n window.addEventListener('message', (event) => {\n if (event.origin === this.windowManager.walletUrl && event.data?.jsonrpc === '2.0') {\n this.rpcClient.receive(event.data);\n }\n });\n }\n\n async sendRequest<T>(requestMethod: string, requestParams: Record<string, unknown>): Promise<UltraResponse<T>> {\n if (this.pendingRequest && !this.isWalletWindowClosed()) {\n throw this.createErrorResponse(SdkErrorCode.REQUESTED_RESOURCE_NOT_AVAILABLE);\n }\n\n this.pendingRequest = true;\n\n try {\n this.windowManager.openOrReuseWallet();\n const walletWindow = this.ensureWalletWindow();\n\n return await this.executeRequest<T>(walletWindow, requestMethod, requestParams);\n } finally {\n this.pendingRequest = false;\n }\n }\n\n private isWalletWindowClosed(): boolean {\n return this.windowManager.getWalletWindow()?.closed === true;\n }\n\n private ensureWalletWindow(): Window {\n const walletWindow = this.windowManager.getWalletWindow();\n if (!walletWindow) {\n throw this.createErrorResponse(SdkErrorCode.WALLET_WINDOW_UNAVAILABLE);\n }\n return walletWindow;\n }\n\n private async executeRequest<T>(\n walletWindow: Window,\n requestMethod: string,\n requestParams: Record<string, unknown>,\n ): Promise<UltraResponse<T>> {\n // Wait for wallet handshake first\n await this.waitForWalletReady(walletWindow);\n\n // Then execute the RPC request with window monitoring\n return this.processRpcRequest<T>(walletWindow, requestMethod, requestParams);\n }\n\n private async waitForWalletReady(walletWindow: Window): Promise<void> {\n return this.withWindowMonitoring(walletWindow, () => {\n return new Promise<void>((resolve, reject) => {\n let isResolved = false;\n let timeoutId: any;\n\n const cleanup = () => {\n if (isResolved) return;\n isResolved = true;\n clearTimeout(timeoutId);\n window.removeEventListener('message', handleWalletHandshake);\n };\n\n const handleWalletHandshake = (event: MessageEvent) => {\n if (!this.isValidReadyMessage(event)) return;\n cleanup();\n resolve();\n };\n\n const handleTimeout = () => {\n cleanup();\n walletWindow.close();\n reject(this.createErrorResponse(SdkErrorCode.WALLET_HANDSHAKE_TIMEOUT));\n };\n\n window.addEventListener('message', handleWalletHandshake);\n timeoutId = setTimeout(handleTimeout, UltraWalletSdkConfig.handshakeTimeout);\n });\n });\n }\n\n private async processRpcRequest<T>(\n walletWindow: Window,\n requestMethod: string,\n requestParams: Record<string, unknown>,\n ): Promise<UltraResponse<T>> {\n return this.withWindowMonitoring(walletWindow, async () => {\n let result: UltraResponse<T>;\n\n try {\n result = await this.rpcClient.request(requestMethod, requestParams);\n } catch (error) {\n const clientError = new ClientError(SdkErrorCode.UNKNOWN_ERROR, error);\n throw {\n status: ResponseStatus.ERROR,\n ...clientError,\n };\n } finally {\n if (result?.status === ResponseStatus.SUCCESS) {\n return result;\n } else {\n throw result;\n }\n }\n });\n }\n\n private async withWindowMonitoring<T>(walletWindow: Window, operation: () => Promise<T>): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const intervalId = setInterval(() => {\n if (walletWindow.closed) {\n clearInterval(intervalId);\n reject(this.createErrorResponse(SdkErrorCode.USER_REJECTED_REQUEST));\n }\n }, UltraWalletSdkConfig.checkWindowInterval);\n\n operation()\n .then((result) => {\n clearInterval(intervalId);\n resolve(result);\n })\n .catch((error) => {\n clearInterval(intervalId);\n reject(error);\n });\n });\n }\n\n private isValidReadyMessage(event: MessageEvent): boolean {\n if (event.origin !== this.windowManager.walletUrl) return false;\n\n const msg: JsonRpcMessage = event.data;\n return msg?.jsonrpc === '2.0' && msg.method === 'ready';\n }\n\n private createErrorResponse(errorCode: SdkErrorCode): UltraResponse<never> {\n const { code, message } = new ClientError(errorCode);\n return { status: ResponseStatus.ERROR, code, message, data: null as never };\n }\n}\n", "import { SDK_ERROR_MESSAGE, SdkErrorCode } from '../interfaces';\n\nexport class ClientError extends Error {\n override message: string;\n\n constructor(\n public code: SdkErrorCode,\n public data?,\n ) {\n super();\n this.message = SDK_ERROR_MESSAGE[code];\n this.name = this.constructor.name;\n }\n}\n", "import UltraWalletSdkConfig from '../config/ultra-wallet-sdk.config';\n\nexport class WindowManager {\n private currentWindow: Window;\n private walletWindow: Window | null = null;\n public readonly walletUrl: string;\n\n constructor(walletUrl: string) {\n this.currentWindow = window;\n this.walletUrl = walletUrl;\n }\n\n openOrReuseWallet() {\n if (this.walletWindow == null || this.walletWindow.closed) {\n const height = UltraWalletSdkConfig.height;\n const width = UltraWalletSdkConfig.width;\n const top = this.currentWindow.top;\n const left = this.currentWindow.screenLeft + this.currentWindow.innerWidth - width;\n\n this.walletWindow = window.open(\n this.walletUrl,\n '_blank',\n `width=${width},height=${height},top=${top},left=${left},resizable=0`,\n );\n } else {\n this.walletWindow.focus();\n }\n }\n\n // Provides a reference to the wallet window\n getWalletWindow(): Window | null {\n return this.walletWindow;\n }\n}\n", "import { ClientMessenger } from '../../common/client-messenger';\nimport { WindowManager } from '../../common/window-manager';\nimport UltraWalletSdkConfig from '../../config/ultra-wallet-sdk.config';\nimport {\n AccountInfo,\n AvailableAuth,\n BlockchainTransaction,\n ConnectParams,\n ConnectResult,\n NetworkDetails,\n ResponseStatus,\n SignMessageResult,\n SignTransactionOptions,\n SignTransactionResult,\n UltraResponse,\n UltraWalletProvider,\n UltraWalletSdkOptions,\n WalletEventType,\n} from '../../interfaces';\n\nexport class WebProvider implements UltraWalletProvider {\n private readonly windowManager: WindowManager;\n private readonly clientMessenger: ClientMessenger;\n\n constructor(private readonly options?: UltraWalletSdkOptions) {\n this.windowManager = new WindowManager(this.resolveWalletUrl());\n this.clientMessenger = new ClientMessenger(this.windowManager);\n }\n\n connect(options?: ConnectParams): Promise<UltraResponse<ConnectResult>> {\n return this.clientMessenger.sendRequest<ConnectResult>('connect', { options });\n }\n\n disconnect(): Promise<UltraResponse<boolean>> {\n return this.clientMessenger.sendRequest<boolean>('disconnect', {});\n }\n\n signMessage(message: string): Promise<UltraResponse<SignMessageResult>> {\n return this.clientMessenger.sendRequest<SignMessageResult>('signMessage', { message });\n }\n\n signTransaction(\n transaction: BlockchainTransaction | BlockchainTransaction[],\n options?: SignTransactionOptions,\n ): Promise<UltraResponse<SignTransactionResult>> {\n return this.clientMessenger.sendRequest<SignTransactionResult>('signTransaction', { transaction, options });\n }\n\n async getChainId(): Promise<UltraResponse<string>> {\n const environment = this.options?.environment || 'mainnet';\n\n switch (environment) {\n case 'mainnet':\n const mainnetChainId = UltraWalletSdkConfig.networkInfo.mainnet.chainId;\n return {\n status: ResponseStatus.SUCCESS,\n data: mainnetChainId,\n };\n\n case 'testnet':\n const testnetChainId = UltraWalletSdkConfig.networkInfo.testnet.chainId;\n return {\n status: ResponseStatus.SUCCESS,\n data: testnetChainId,\n };\n\n default:\n return this.clientMessenger.sendRequest<string>('getChainId', {});\n }\n }\n\n getAccounts(): Promise<UltraResponse<AccountInfo[]>> {\n return this.clientMessenger.sendRequest<AccountInfo[]>('getAccounts', {});\n }\n\n getSelectedAccount(): Promise<UltraResponse<AccountInfo>> {\n return this.clientMessenger.sendRequest<AccountInfo>('getSelectedAccount', {});\n }\n\n getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>> {\n return this.clientMessenger.sendRequest<AvailableAuth[]>('getAvailableAuthorizations', {});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n on(_event: WalletEventType, _callback: (data: any) => void): void {\n // The Web Wallet provider communicates via postMessage through a popup window.\n // Long-lived event subscriptions are not supported in this transport model.\n // Consumers requiring real-time events should use the Extension provider.\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n off(_event: WalletEventType, _callback: (data: any) => void): void {\n // Not supported in web provider — see on() above.\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n switchNetwork(_chainId: string): Promise<UltraResponse<void>> {\n throw new Error('Not supported in web provider');\n }\n\n getNetwork(): Promise<UltraResponse<NetworkDetails>> {\n throw new Error('Not supported in web provider');\n }\n\n getNetworks(): Promise<UltraResponse<NetworkDetails[]>> {\n throw new Error('Not supported in web provider');\n }\n\n dispose(): void {\n // Web provider holds no long-lived timers/listeners — the popup-based\n // postMessage transport is request/response only.\n }\n\n private resolveWalletUrl(): string {\n const env = UltraWalletSdkConfig.walletUrls[this.options?.environment || 'mainnet'];\n return env || this.options.environment;\n }\n}\n", "export function isExtensionAvailable(): boolean {\n return typeof window !== 'undefined' && 'ultra' in window;\n}\n", "import {\n AccountInfo,\n AvailableAuth,\n BlockchainTransaction,\n ConnectParams,\n ConnectResult,\n NetworkDetails,\n SignMessageResult,\n SignTransactionOptions,\n SignTransactionResult,\n UltraResponse,\n UltraWalletProvider,\n UltraWalletSdkOptions,\n UltraWalletSdkProvider,\n WalletEventType,\n} from './interfaces';\nimport { ExtensionProvider, WebProvider } from './providers';\nimport { isExtensionAvailable } from './utils/detection';\n\n/**\n * UltraWalletClient acts as a Facade for interacting with the Ultra Wallet.\n * It provides a unified API regardless of the underlying provider implementation (Extension or Web).\n */\nexport class UltraWalletSDK {\n private provider: UltraWalletProvider;\n\n /**\n * Constructs an UltraWalletClient instance.\n * If the Ultra Wallet Extension is available (window.ultra), it will be used automatically.\n * If the Extension is not available, the Web Wallet provider will be initialized using the given network options.\n *\n * @param {UltraWalletSdkOptions} [options] - Configuration options for the Web Wallet fallback (environment or custom URL).\n */\n constructor(private readonly options?: UltraWalletSdkOptions) {\n this.provider = this.resolveWalletProvider();\n }\n\n connect(params?: ConnectParams): Promise<UltraResponse<ConnectResult>> {\n return this.provider.connect(params);\n }\n\n disconnect(): Promise<UltraResponse<boolean>> {\n return this.provider.disconnect();\n }\n\n signMessage(message: string): Promise<UltraResponse<SignMessageResult>> {\n return this.provider.signMessage(message);\n }\n\n signTransaction(\n transaction: BlockchainTransaction | BlockchainTransaction[],\n options?: SignTransactionOptions,\n ): Promise<UltraResponse<SignTransactionResult>> {\n return this.provider.signTransaction(transaction, options);\n }\n\n getChainId(): Promise<UltraResponse<string>> {\n return this.provider.getChainId();\n }\n\n getAccounts(): Promise<UltraResponse<AccountInfo[]>> {\n return this.provider.getAccounts();\n }\n\n getSelectedAccount(): Promise<UltraResponse<AccountInfo>> {\n return this.provider.getSelectedAccount();\n }\n\n getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>> {\n return this.provider.getAvailableAuthorizations();\n }\n\n on(event: WalletEventType, callback: (data: any) => void): void {\n this.provider.on(event, callback);\n }\n\n off(event: WalletEventType, callback: (data: any) => void): void {\n this.provider.off(event, callback);\n }\n\n switchNetwork(chainId: string): Promise<UltraResponse<void>> {\n return this.provider.switchNetwork(chainId);\n }\n\n getNetwork(): Promise<UltraResponse<NetworkDetails>> {\n return this.provider.getNetwork();\n }\n\n getNetworks(): Promise<UltraResponse<NetworkDetails[]>> {\n return this.provider.getNetworks();\n }\n\n dispose(): void {\n this.provider.dispose();\n }\n\n private resolveWalletProvider(): UltraWalletProvider {\n const requestedProvider: UltraWalletSdkProvider | undefined = this.options?.provider;\n if (requestedProvider === 'extension') {\n return new ExtensionProvider(this.options);\n }\n if (requestedProvider === 'web') {\n return new WebProvider(this.options);\n }\n\n const extensionAvailable = isExtensionAvailable();\n return extensionAvailable ? new ExtensionProvider(this.options) : new WebProvider(this.options);\n }\n}\n"],
5
+ "mappings": ";AAAA,IAAY;CAAZ,SAAYA,eAAY;AACtB,EAAAA,cAAAA,cAAA,uBAAA,IAAA,IAAA,IAAA;AACA,EAAAA,cAAAA,cAAA,0BAAA,IAAA,IAAA,IAAA;AACA,EAAAA,cAAAA,cAAA,2BAAA,IAAA,IAAA,IAAA;AACA,EAAAA,cAAAA,cAAA,kCAAA,IAAA,KAAA,IAAA;AACA,EAAAA,cAAAA,cAAA,eAAA,IAAA,MAAA,IAAA;AACF,GANY,iBAAA,eAAY,CAAA,EAAA;AAQjB,IAAM,oBAAuD;EAClE,CAAC,aAAa,qBAAqB,GAAG;EACtC,CAAC,aAAa,wBAAwB,GAAG;EACzC,CAAC,aAAa,yBAAyB,GAAG;EAC1C,CAAC,aAAa,gCAAgC,GAAG;EACjD,CAAC,aAAa,aAAa,GAAG;;;;ACehC,IAAY;CAAZ,SAAYC,iBAAc;AACxB,EAAAA,gBAAA,SAAA,IAAA;AACA,EAAAA,gBAAA,MAAA,IAAA;AACA,EAAAA,gBAAA,OAAA,IAAA;AACF,GAJY,mBAAA,iBAAc,CAAA,EAAA;;;ACX1B,IAAM,uBAA6C,OAAO,OAAO;EAC/D,OAAO;EACP,QAAQ;EACR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,SAAK,SAAS,GAAG,OAAO,QAAQ;EAClC;EAEA,IAAI,OAAwB,UAA6B;AACvD,SAAK,SAAS,IAAI,OAAO,QAAQ;EACnC;EAEA,cAAc,SAAe;AAC3B,WAAO,KAAK,SAAS,cAAc,OAAO;EAC5C;EAEA,aAAU;AACR,WAAO,KAAK,SAAS,WAAU;EACjC;EAEA,cAAW;AACT,WAAO,KAAK,SAAS,YAAW;EAClC;EAEA,UAAO;AACL,SAAK,SAAS,QAAO;EACvB;EAEQ,wBAAqB;AAC3B,UAAM,oBAAwD,KAAK,SAAS;AAC5E,QAAI,sBAAsB,aAAa;AACrC,aAAO,IAAI,kBAAkB,KAAK,OAAO;IAC3C;AACA,QAAI,sBAAsB,OAAO;AAC/B,aAAO,IAAI,YAAY,KAAK,OAAO;IACrC;AAEA,UAAM,qBAAqB,qBAAoB;AAC/C,WAAO,qBAAqB,IAAI,kBAAkB,KAAK,OAAO,IAAI,IAAI,YAAY,KAAK,OAAO;EAChG;;",
6
+ "names": ["SdkErrorCode", "ResponseStatus"]
7
+ }
package/package.json CHANGED
@@ -1,16 +1,31 @@
1
1
  {
2
2
  "name": "@ultraos/wallet-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.6.0",
4
4
  "homepage": "https://developers.ultra.io",
5
5
  "dependencies": {
6
6
  "json-rpc-2.0": "^1.7.0",
7
7
  "tslib": "^2.3.0"
8
8
  },
9
9
  "type": "module",
10
- "main": "./src/index.js",
10
+ "main": "./dist/index.mjs",
11
11
  "typings": "./src/index.d.ts",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "module": "./src/index.js"
15
+ "module": "./dist/index.mjs",
16
+ "types": "./src/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./src/index.d.ts",
20
+ "import": "./dist/index.mjs",
21
+ "default": "./dist/index.mjs"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "src",
28
+ "README.md",
29
+ "CHANGELOG.md"
30
+ ]
16
31
  }
@@ -16,5 +16,17 @@ export interface ConnectParams {
16
16
  * The nonce must be prefixed with 'message:', '0x' or 'UOSx'
17
17
  */
18
18
  nonce?: string;
19
+ /**
20
+ * If true, the dApp explicitly requires a connect-time identity attestation.
21
+ * When the connected wallet supports attestation but the origin has not yet
22
+ * consented to attestation issuance, the wallet prompts for consent (reusing
23
+ * the connect prompt — no separate signature dialog) instead of returning a
24
+ * silent, attestation-less result; on approval, `connect()` resolves with a
25
+ * `ConnectResult` whose `attestation` field is populated. Wallets that do not
26
+ * support attestation ignore this flag (the result simply has no `attestation`).
27
+ * Omitting it preserves existing behavior.
28
+ * @experimental See `ConnectAttestation`.
29
+ */
30
+ requireAttestation?: boolean;
19
31
  }
20
32
  //# sourceMappingURL=connect-params.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect-params.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/connect-params.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"connect-params.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/connect-params.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"connect-params.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/connect-params.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Optional parameters for establishing a connection with the Ultra Wallet.\n */\nexport interface ConnectParams {\n /**\n * If true, do not prompt the user for permissions; share account info only if Dapp is already trusted.\n */\n onlyIfTrusted?: boolean;\n /**\n * Optional referral code to associate with the connection request.\n */\n referralCode?: string;\n\n /**\n * A unique string used for identifying or authenticating a specific request or transaction.\n * Typically utilized for security mechanisms, such as preventing replay attacks or ensuring the uniqueness of transactions.\n * The nonce must be prefixed with 'message:', '0x' or 'UOSx'\n */\n nonce?: string;\n}\n"]}
1
+ {"version":3,"file":"connect-params.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/connect-params.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Optional parameters for establishing a connection with the Ultra Wallet.\n */\nexport interface ConnectParams {\n /**\n * If true, do not prompt the user for permissions; share account info only if Dapp is already trusted.\n */\n onlyIfTrusted?: boolean;\n /**\n * Optional referral code to associate with the connection request.\n */\n referralCode?: string;\n\n /**\n * A unique string used for identifying or authenticating a specific request or transaction.\n * Typically utilized for security mechanisms, such as preventing replay attacks or ensuring the uniqueness of transactions.\n * The nonce must be prefixed with 'message:', '0x' or 'UOSx'\n */\n nonce?: string;\n\n /**\n * If true, the dApp explicitly requires a connect-time identity attestation.\n * When the connected wallet supports attestation but the origin has not yet\n * consented to attestation issuance, the wallet prompts for consent (reusing\n * the connect prompt — no separate signature dialog) instead of returning a\n * silent, attestation-less result; on approval, `connect()` resolves with a\n * `ConnectResult` whose `attestation` field is populated. Wallets that do not\n * support attestation ignore this flag (the result simply has no `attestation`).\n * Omitting it preserves existing behavior.\n * @experimental See `ConnectAttestation`.\n */\n requireAttestation?: boolean;\n}\n"]}
@@ -2,7 +2,6 @@ export * from './blockchain-transaction.interface';
2
2
  export * from './connect-params.interface';
3
3
  export * from './error-enum';
4
4
  export * from './json-rpc-message.interface';
5
- export * from './purchase-item.interface';
6
5
  export * from './wallet-provider.interface';
7
6
  export * from './wallet-provider-response.interface';
8
7
  export * from './wallet-sdk-options.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC"}
@@ -2,7 +2,6 @@ export * from './blockchain-transaction.interface';
2
2
  export * from './connect-params.interface';
3
3
  export * from './error-enum';
4
4
  export * from './json-rpc-message.interface';
5
- export * from './purchase-item.interface';
6
5
  export * from './wallet-provider.interface';
7
6
  export * from './wallet-provider-response.interface';
8
7
  export * from './wallet-sdk-options.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './blockchain-transaction.interface';\nexport * from './connect-params.interface';\nexport * from './error-enum';\nexport * from './json-rpc-message.interface';\nexport * from './purchase-item.interface';\nexport * from './wallet-provider.interface';\nexport * from './wallet-provider-response.interface';\nexport * from './wallet-sdk-options.interface';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './blockchain-transaction.interface';\nexport * from './connect-params.interface';\nexport * from './error-enum';\nexport * from './json-rpc-message.interface';\nexport * from './wallet-provider.interface';\nexport * from './wallet-provider-response.interface';\nexport * from './wallet-sdk-options.interface';\n"]}
@@ -76,7 +76,7 @@ export interface NetworkInfo {
76
76
  }
77
77
  /**
78
78
  * Extended network information including connection details.
79
- * Returned by getNetwork, getNetworks, and accepted by addNetwork.
79
+ * Returned by getNetwork and getNetworks.
80
80
  */
81
81
  export interface NetworkDetails {
82
82
  /**
@@ -96,6 +96,70 @@ export interface NetworkDetails {
96
96
  */
97
97
  isCustom?: boolean;
98
98
  }
99
+ /**
100
+ * One account the wallet currently holds signing keys for, plus the permission
101
+ * names whose keys it controls. Sourced from the same set the wallet exposes via
102
+ * `ConnectResult.accounts` — never an FE-supplied (spoofable) list (RFC §2.1 / §5.6).
103
+ */
104
+ export interface SignableAccount {
105
+ /** The blockchain account name. */
106
+ account: string;
107
+ /** The permission names the wallet holds the signing key for (e.g. `active`). */
108
+ permissions: string[];
109
+ }
110
+ /**
111
+ * The signed payload of a connect-time identity attestation (RFC §2.1). The canonical
112
+ * form — JSON with sorted keys, UTF-8 encoded, SHA-256 hashed — is what the wallet signs.
113
+ */
114
+ export interface AttestationPayload {
115
+ /** Attestation format version. */
116
+ v: 1;
117
+ /** The signing public key (e.g. `EOS...` / `UTR...`). */
118
+ pubkey: string;
119
+ /** The primary account name (the one signing). */
120
+ account: string;
121
+ /** The permission used to sign (e.g. `active`, `owner`). */
122
+ permission: string;
123
+ /** The dApp origin the attestation is bound to (e.g. `http://localhost:5172`). */
124
+ origin: string;
125
+ /** The chain identifier the attestation is scoped to. */
126
+ chainId: string;
127
+ /** Issued-at, unix seconds. */
128
+ iat: number;
129
+ /** Expiry, unix seconds. */
130
+ exp: number;
131
+ /** 32-byte random value, hex-encoded. */
132
+ nonce: string;
133
+ /**
134
+ * The full set of accounts the wallet currently holds signing keys for, each with
135
+ * the permission names it controls. Lets a backend reason about the user's real
136
+ * account set without trusting an FE-supplied (spoofable) list. Omitted when the
137
+ * wallet doesn't enumerate additional accounts — backends MUST fall back to the
138
+ * primary `account` field on absence.
139
+ */
140
+ signableAccounts?: SignableAccount[];
141
+ }
142
+ /**
143
+ * A connect-time identity attestation, optionally produced by the wallet when the
144
+ * user approves a `connect()`. Rides the existing connect consent — no extra popup.
145
+ *
146
+ * Present only if the connected wallet vendor supports silent attestation; absent
147
+ * otherwise. dApps treat absence as "fall back to whatever auth this dApp uses
148
+ * without attestation". The SDK does not verify or transform this value — it is
149
+ * passed through verbatim from the wallet. Verification is the consumer backend's
150
+ * responsibility (see RFC §2.4 / §5).
151
+ *
152
+ * @see https://github.com/ultraio/ultra-tool-kit/blob/feature/ai-enhancement/docs/proposals/wallet-native-attestation.md
153
+ *
154
+ * @experimental Issued only by the browser-extension wallet and not yet consumed by any
155
+ * Ultra service; the shape may change before it is stabilised.
156
+ */
157
+ export interface ConnectAttestation {
158
+ /** The signed identity payload. */
159
+ payload: AttestationPayload;
160
+ /** Signature over the canonical hash of `payload` (e.g. `SIG_K1_...`). */
161
+ signature: string;
162
+ }
99
163
  /**
100
164
  * Represents the result of a successful connection request, containing the user's account details.
101
165
  * Backward-compatible: legacy fields `blockchainid` and `publicKey` are preserved alongside
@@ -103,8 +167,10 @@ export interface NetworkDetails {
103
167
  */
104
168
  export type ConnectResult = {
105
169
  /**
106
- * The blockchain network identifier.
107
- * @deprecated Use `network.chainId` instead.
170
+ * The connected (selected) account name, e.g. `aa1aa2aa3aa4` — not a chain id.
171
+ * Equals `selectedAccount.accountName` when the wallet returns `selectedAccount`;
172
+ * the Web Wallet returns only this legacy field.
173
+ * @deprecated Use `selectedAccount.accountName` when present.
108
174
  */
109
175
  blockchainid: string;
110
176
  /**
@@ -124,31 +190,22 @@ export type ConnectResult = {
124
190
  * Information about the connected blockchain network.
125
191
  */
126
192
  network?: NetworkInfo;
193
+ /**
194
+ * The nonce passed to `connect({ nonce })`, echoed back. Present only when a nonce was sent.
195
+ */
196
+ nonce?: string;
197
+ /**
198
+ * The wallet's signature over `nonce` (same scheme as `signMessage`). Present only when a nonce was sent.
199
+ */
200
+ signedNonce?: string;
201
+ /**
202
+ * An optional connect-time identity attestation. Present only when the connected
203
+ * wallet vendor supports silent attestation; `undefined` otherwise. Passed through
204
+ * verbatim from the wallet — the SDK does not verify or transform it.
205
+ * @experimental See {@link ConnectAttestation}.
206
+ */
207
+ attestation?: ConnectAttestation;
127
208
  };
128
- /**
129
- * The result structure returned after a successful item purchase using the Ultra Wallet.
130
- * Contains metadata about the purchased items and the associated blockchain transaction.
131
- */
132
- export interface PurchaseItemResult {
133
- /**
134
- * An ID associated with the purchase order, used for support requests if required.
135
- */
136
- orderHash: string;
137
- items: {
138
- /**
139
- * The ID of the minted Uniq.
140
- */
141
- artifactId: string;
142
- /**
143
- * The purchased item ID.
144
- */
145
- productId: string;
146
- /**
147
- * The ID of the transaction in the blockchain, useful for tracking the status and details of the transaction.
148
- */
149
- blockchainTransactionId: string;
150
- }[];
151
- }
152
209
  /**
153
210
  * Represents the result returned after signing a message with the Ultra Wallet.
154
211
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider-response.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/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E,MAAM,CAAC;IACnD,OAAO,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;QAClC,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE;YACb,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;SACpB,EAAE,CAAC;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,GAAG,EAAE,CAAC;IAC1B,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,WAAW,EAAE,CAAC;CAC9B"}
1
+ {"version":3,"file":"wallet-provider-response.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider-response.interface.ts"],"names":[],"mappings":"AAAA;;;;;G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C;YACjB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,GAAG,EAAE,CAAC;IAC1B,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,WAAW,EAAE,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider-response.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider-response.interface.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,iCAAe,CAAA;AACjB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["/**\n * A generic wrapper for all Ultra Wallet SDK responses.\n * Encapsulates the status, data payload, and optional error messaging or codes.\n *\n * @template T The type of the data payload contained in the response.\n */\nexport interface UltraResponse<T = any> {\n /**\n * The status of the response, e.g., success, fail, or error.\n */\n status: ResponseStatus;\n /**\n * The actual response data payload.\n */\n data: T;\n /**\n * Optional end-user-readable message, explaining what went wrong (if applicable).\n */\n message?: string;\n /**\n * Optional error or status code.\n */\n code?: number;\n}\n\n/**\n * Enumeration of possible response statuses returned by the Ultra Wallet SDK.\n */\nexport enum ResponseStatus {\n SUCCESS = 'success',\n FAIL = 'fail',\n ERROR = 'error',\n}\n\n/**\n * Represents the result of a disconnect request.\n * A boolean indicating whether the disconnection was successful.\n */\nexport type DisconnectResponse = boolean;\n\n/**\n * Represents a single permission entry associated with a blockchain account.\n */\nexport interface PermissionInfo {\n /**\n * The permission level name (e.g., \"active\", \"owner\").\n */\n name: string;\n /**\n * The public keys associated with this permission.\n */\n publicKeys: string[];\n}\n\n/**\n * Represents a blockchain account with its associated permissions.\n */\nexport interface AccountInfo {\n /**\n * The blockchain account name.\n */\n accountName: string;\n /**\n * The list of permissions associated with this account.\n */\n permissions: PermissionInfo[];\n}\n\n/**\n * Represents information about the connected blockchain network.\n */\nexport interface NetworkInfo {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n}\n\n/**\n * Extended network information including connection details.\n * Returned by getNetwork, getNetworks, and accepted by addNetwork.\n */\nexport interface NetworkDetails {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n /**\n * The RPC node URL for the network.\n */\n nodeUrl: string;\n /**\n * Whether this is a user-defined custom network.\n */\n isCustom?: boolean;\n}\n\n/**\n * Represents the result of a successful connection request, containing the user's account details.\n * Backward-compatible: legacy fields `blockchainid` and `publicKey` are preserved alongside\n * the new multi-account fields.\n */\nexport type ConnectResult = {\n /**\n * The blockchain network identifier.\n * @deprecated Use `network.chainId` instead.\n */\n blockchainid: string;\n /**\n * The public key associated with the user's account.\n * @deprecated Use `selectedAccount.permissions[n].publicKeys` instead.\n */\n publicKey: string;\n /**\n * All accounts available in the connected wallet.\n */\n accounts?: AccountInfo[];\n /**\n * The currently selected account.\n */\n selectedAccount?: AccountInfo;\n /**\n * Information about the connected blockchain network.\n */\n network?: NetworkInfo;\n};\n\n/**\n * The result structure returned after a successful item purchase using the Ultra Wallet.\n * Contains metadata about the purchased items and the associated blockchain transaction.\n */\nexport interface PurchaseItemResult {\n /**\n * An ID associated with the purchase order, used for support requests if required.\n */\n orderHash: string;\n\n items: {\n /**\n * The ID of the minted Uniq.\n */\n artifactId: string;\n /**\n * The purchased item ID.\n */\n productId: string;\n /**\n * The ID of the transaction in the blockchain, useful for tracking the status and details of the transaction.\n */\n blockchainTransactionId: string;\n }[];\n}\n\n/**\n * Represents the result returned after signing a message with the Ultra Wallet.\n */\nexport interface SignMessageResult {\n signature: string;\n}\n\n/**\n * Represents the result returned after signing a blockchain transaction with the Ultra Wallet.\n */\nexport interface SignTransactionResult {\n /**\n * The hash of the signed blockchain transaction.\n */\n transactionHash?: string;\n /**\n * Authorizations that couldn't be signed because the wallet lacks the keys.\n * Format: [\"account@permission\", ...]\n * Absent or empty means all authorizations were signed.\n */\n unsignedAuth?: string[];\n processed?: {\n id: string;\n block_num: number;\n block_time: string; // ISO timestamp\n producer_block_id: string | null;\n receipt: {\n status: string;\n cpu_usage_us: number;\n net_usage_words: number;\n };\n elapsed: number;\n net_usage: number;\n scheduled: boolean;\n action_traces: ActionTrace[];\n account_ram_delta: any | null;\n except: any | null;\n error_code: number | null;\n };\n}\n\nexport interface ActionTrace {\n action_ordinal: number;\n creator_action_ordinal: number;\n closest_unnotified_ancestor_action_ordinal: number;\n receipt: {\n receiver: string;\n act_digest: string;\n global_sequence: number;\n recv_sequence: number;\n auth_sequence: [string, number][];\n code_sequence: number;\n abi_sequence: number;\n };\n receiver: string;\n act: {\n account: string;\n name: string;\n authorization: {\n actor: string;\n permission: string;\n }[];\n data: {\n from: string;\n to: string;\n quantity: string;\n memo: string;\n };\n hex_data: string;\n };\n context_free: boolean;\n elapsed: number;\n console: string;\n trx_id: string;\n block_num: number;\n block_time: string;\n producer_block_id: string | null;\n account_ram_deltas: any[];\n except: any | null;\n error_code: number | null;\n return_value_hex_data: string;\n inline_traces: ActionTrace[];\n}\n"]}
1
+ {"version":3,"file":"wallet-provider-response.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider-response.interface.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,iCAAe,CAAA;AACjB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["/**\n * A generic wrapper for all Ultra Wallet SDK responses.\n * Encapsulates the status, data payload, and optional error messaging or codes.\n *\n * @template T The type of the data payload contained in the response.\n */\nexport interface UltraResponse<T = any> {\n /**\n * The status of the response, e.g., success, fail, or error.\n */\n status: ResponseStatus;\n /**\n * The actual response data payload.\n */\n data: T;\n /**\n * Optional end-user-readable message, explaining what went wrong (if applicable).\n */\n message?: string;\n /**\n * Optional error or status code.\n */\n code?: number;\n}\n\n/**\n * Enumeration of possible response statuses returned by the Ultra Wallet SDK.\n */\nexport enum ResponseStatus {\n SUCCESS = 'success',\n FAIL = 'fail',\n ERROR = 'error',\n}\n\n/**\n * Represents the result of a disconnect request.\n * A boolean indicating whether the disconnection was successful.\n */\nexport type DisconnectResponse = boolean;\n\n/**\n * Represents a single permission entry associated with a blockchain account.\n */\nexport interface PermissionInfo {\n /**\n * The permission level name (e.g., \"active\", \"owner\").\n */\n name: string;\n /**\n * The public keys associated with this permission.\n */\n publicKeys: string[];\n}\n\n/**\n * Represents a blockchain account with its associated permissions.\n */\nexport interface AccountInfo {\n /**\n * The blockchain account name.\n */\n accountName: string;\n /**\n * The list of permissions associated with this account.\n */\n permissions: PermissionInfo[];\n}\n\n/**\n * Represents information about the connected blockchain network.\n */\nexport interface NetworkInfo {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n}\n\n/**\n * Extended network information including connection details.\n * Returned by getNetwork and getNetworks.\n */\nexport interface NetworkDetails {\n /**\n * The human-readable name of the network (e.g., \"mainnet\", \"testnet\").\n */\n name: string;\n /**\n * The unique chain identifier.\n */\n chainId: string;\n /**\n * The RPC node URL for the network.\n */\n nodeUrl: string;\n /**\n * Whether this is a user-defined custom network.\n */\n isCustom?: boolean;\n}\n\n/**\n * One account the wallet currently holds signing keys for, plus the permission\n * names whose keys it controls. Sourced from the same set the wallet exposes via\n * `ConnectResult.accounts` — never an FE-supplied (spoofable) list (RFC §2.1 / §5.6).\n */\nexport interface SignableAccount {\n /** The blockchain account name. */\n account: string;\n /** The permission names the wallet holds the signing key for (e.g. `active`). */\n permissions: string[];\n}\n\n/**\n * The signed payload of a connect-time identity attestation (RFC §2.1). The canonical\n * form — JSON with sorted keys, UTF-8 encoded, SHA-256 hashed — is what the wallet signs.\n */\nexport interface AttestationPayload {\n /** Attestation format version. */\n v: 1;\n /** The signing public key (e.g. `EOS...` / `UTR...`). */\n pubkey: string;\n /** The primary account name (the one signing). */\n account: string;\n /** The permission used to sign (e.g. `active`, `owner`). */\n permission: string;\n /** The dApp origin the attestation is bound to (e.g. `http://localhost:5172`). */\n origin: string;\n /** The chain identifier the attestation is scoped to. */\n chainId: string;\n /** Issued-at, unix seconds. */\n iat: number;\n /** Expiry, unix seconds. */\n exp: number;\n /** 32-byte random value, hex-encoded. */\n nonce: string;\n /**\n * The full set of accounts the wallet currently holds signing keys for, each with\n * the permission names it controls. Lets a backend reason about the user's real\n * account set without trusting an FE-supplied (spoofable) list. Omitted when the\n * wallet doesn't enumerate additional accounts — backends MUST fall back to the\n * primary `account` field on absence.\n */\n signableAccounts?: SignableAccount[];\n}\n\n/**\n * A connect-time identity attestation, optionally produced by the wallet when the\n * user approves a `connect()`. Rides the existing connect consent — no extra popup.\n *\n * Present only if the connected wallet vendor supports silent attestation; absent\n * otherwise. dApps treat absence as \"fall back to whatever auth this dApp uses\n * without attestation\". The SDK does not verify or transform this value — it is\n * passed through verbatim from the wallet. Verification is the consumer backend's\n * responsibility (see RFC §2.4 / §5).\n *\n * @see https://github.com/ultraio/ultra-tool-kit/blob/feature/ai-enhancement/docs/proposals/wallet-native-attestation.md\n *\n * @experimental Issued only by the browser-extension wallet and not yet consumed by any\n * Ultra service; the shape may change before it is stabilised.\n */\nexport interface ConnectAttestation {\n /** The signed identity payload. */\n payload: AttestationPayload;\n /** Signature over the canonical hash of `payload` (e.g. `SIG_K1_...`). */\n signature: string;\n}\n\n/**\n * Represents the result of a successful connection request, containing the user's account details.\n * Backward-compatible: legacy fields `blockchainid` and `publicKey` are preserved alongside\n * the new multi-account fields.\n */\nexport type ConnectResult = {\n /**\n * The connected (selected) account name, e.g. `aa1aa2aa3aa4` — not a chain id.\n * Equals `selectedAccount.accountName` when the wallet returns `selectedAccount`;\n * the Web Wallet returns only this legacy field.\n * @deprecated Use `selectedAccount.accountName` when present.\n */\n blockchainid: string;\n /**\n * The public key associated with the user's account.\n * @deprecated Use `selectedAccount.permissions[n].publicKeys` instead.\n */\n publicKey: string;\n /**\n * All accounts available in the connected wallet.\n */\n accounts?: AccountInfo[];\n /**\n * The currently selected account.\n */\n selectedAccount?: AccountInfo;\n /**\n * Information about the connected blockchain network.\n */\n network?: NetworkInfo;\n /**\n * The nonce passed to `connect({ nonce })`, echoed back. Present only when a nonce was sent.\n */\n nonce?: string;\n /**\n * The wallet's signature over `nonce` (same scheme as `signMessage`). Present only when a nonce was sent.\n */\n signedNonce?: string;\n /**\n * An optional connect-time identity attestation. Present only when the connected\n * wallet vendor supports silent attestation; `undefined` otherwise. Passed through\n * verbatim from the wallet the SDK does not verify or transform it.\n * @experimental See {@link ConnectAttestation}.\n */\n attestation?: ConnectAttestation;\n};\n\n/**\n * Represents the result returned after signing a message with the Ultra Wallet.\n */\nexport interface SignMessageResult {\n signature: string;\n}\n\n/**\n * Represents the result returned after signing a blockchain transaction with the Ultra Wallet.\n */\nexport interface SignTransactionResult {\n /**\n * The hash of the signed blockchain transaction.\n */\n transactionHash?: string;\n /**\n * Authorizations that couldn't be signed because the wallet lacks the keys.\n * Format: [\"account@permission\", ...]\n * Absent or empty means all authorizations were signed.\n */\n unsignedAuth?: string[];\n processed?: {\n id: string;\n block_num: number;\n block_time: string; // ISO timestamp\n producer_block_id: string | null;\n receipt: {\n status: string;\n cpu_usage_us: number;\n net_usage_words: number;\n };\n elapsed: number;\n net_usage: number;\n scheduled: boolean;\n action_traces: ActionTrace[];\n account_ram_delta: any | null;\n except: any | null;\n error_code: number | null;\n };\n}\n\nexport interface ActionTrace {\n action_ordinal: number;\n creator_action_ordinal: number;\n closest_unnotified_ancestor_action_ordinal: number;\n receipt: {\n receiver: string;\n act_digest: string;\n global_sequence: number;\n recv_sequence: number;\n auth_sequence: [string, number][];\n code_sequence: number;\n abi_sequence: number;\n };\n receiver: string;\n act: {\n account: string;\n name: string;\n authorization: {\n actor: string;\n permission: string;\n }[];\n data: {\n from: string;\n to: string;\n quantity: string;\n memo: string;\n };\n hex_data: string;\n };\n context_free: boolean;\n elapsed: number;\n console: string;\n trx_id: string;\n block_num: number;\n block_time: string;\n producer_block_id: string | null;\n account_ram_deltas: any[];\n except: any | null;\n error_code: number | null;\n return_value_hex_data: string;\n inline_traces: ActionTrace[];\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  import { BlockchainTransaction, SignTransactionOptions } from './blockchain-transaction.interface';
2
2
  import { AvailableAuth } from './blockchain-transaction.interface';
3
3
  import { ConnectParams } from './connect-params.interface';
4
- import { PurchaseItemType } from './purchase-item.interface';
5
- import { AccountInfo, ConnectResult, DisconnectResponse, NetworkDetails, PurchaseItemResult, SignMessageResult, SignTransactionResult, UltraResponse } from './wallet-provider-response.interface';
4
+ import { AccountInfo, ConnectResult, DisconnectResponse, NetworkDetails, SignMessageResult, SignTransactionResult, UltraResponse } from './wallet-provider-response.interface';
6
5
  /**
7
6
  * Event types emitted by the wallet provider.
8
7
  */
@@ -37,12 +36,6 @@ export interface UltraWalletProvider {
37
36
  * Get current chain id
38
37
  */
39
38
  getChainId(): Promise<UltraResponse<string>>;
40
- /**
41
- * Open a popup to purchase an item
42
- * @param {PurchaseItemType} itemType - The type of item to purchase
43
- * @param {string} itemId - The id of the item to purchase
44
- */
45
- purchaseItem(itemType: PurchaseItemType, itemId: string): Promise<UltraResponse<PurchaseItemResult>>;
46
39
  /**
47
40
  * Get all accounts available in the connected wallet.
48
41
  */
@@ -82,15 +75,6 @@ export interface UltraWalletProvider {
82
75
  * Get all networks configured in the wallet.
83
76
  */
84
77
  getNetworks(): Promise<UltraResponse<NetworkDetails[]>>;
85
- /**
86
- * Add a custom network to the wallet.
87
- * @param params - The network configuration to add
88
- */
89
- addNetwork(params: {
90
- name: string;
91
- chainId: string;
92
- nodeUrl: string;
93
- }): Promise<UltraResponse<void>>;
94
78
  /**
95
79
  * Release any resources held by the provider (timers, window listeners,
96
80
  * internal maps). After dispose() the provider is no longer usable —
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACd,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAEvE;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,OAAO,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GG;IACH,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAErG;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
1
+ {"version":3,"file":"wallet-provider.interface.d.ts","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACd,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAEvE;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExE;;;;OAIG;IACH,eAAe,CACb,WAAW,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,EAC5D,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAEjD;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAErD;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;IAE1D;;;;OAIG;IACH,0BAA0B,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAEtE;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;IAEhE;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;IAEjE;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7D;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;IAErD;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { BlockchainTransaction, SignTransactionOptions } from './blockchain-transaction.interface';\nimport { AvailableAuth } from './blockchain-transaction.interface';\nimport { ConnectParams } from './connect-params.interface';\nimport { PurchaseItemType } from './purchase-item.interface';\nimport {\n AccountInfo,\n ConnectResult,\n DisconnectResponse,\n NetworkDetails,\n PurchaseItemResult,\n SignMessageResult,\n SignTransactionResult,\n UltraResponse,\n} from './wallet-provider-response.interface';\n\n/**\n * Event types emitted by the wallet provider.\n */\nexport type WalletEventType = 'accountChanged' | 'networkChanged' | 'disconnect';\n\n/**\n * Defines the minimal interface that a wallet provider must implement for the Ultra Wallet SDK.\n */\nexport interface UltraWalletProvider {\n /**\n * Prompt the user for permission to share his wallet info with the 3rd party application.\n * Once permission is established the first time, the 3rd party application will be whitelisted for future requests.\n * @param params.onlyIfTrusted - Do not prompt the user for permissions. Share current account info if Dapp is already trusted,\n * otherwise rejects the request.\n */\n connect(params?: ConnectParams): Promise<UltraResponse<ConnectResult>>;\n\n /**\n * Remove permission to interact with the 3rd party application\n */\n disconnect(): Promise<UltraResponse<DisconnectResponse>>;\n\n /**\n * Open a popup to sign a message\n * @param message - The message to sign. The message should be prefixed with \"0x:, UOSx:, or message:\"\n */\n signMessage(message: string): Promise<UltraResponse<SignMessageResult>>;\n\n /**\n * Open a popup to sign a transaction\n * @param transaction - The transaction to sign\n * @param options - The options for the transaction\n */\n signTransaction(\n transaction: BlockchainTransaction | BlockchainTransaction[],\n options?: SignTransactionOptions,\n ): Promise<UltraResponse<SignTransactionResult>>;\n\n /**\n * Get current chain id\n */\n getChainId(): Promise<UltraResponse<string>>;\n\n /**\n * Open a popup to purchase an item\n * @param {PurchaseItemType} itemType - The type of item to purchase\n * @param {string} itemId - The id of the item to purchase\n */\n purchaseItem(itemType: PurchaseItemType, itemId: string): Promise<UltraResponse<PurchaseItemResult>>;\n\n /**\n * Get all accounts available in the connected wallet.\n */\n getAccounts(): Promise<UltraResponse<AccountInfo[]>>;\n\n /**\n * Get the currently selected account in the wallet.\n */\n getSelectedAccount(): Promise<UltraResponse<AccountInfo>>;\n\n /**\n * Get all authorizations (account@permission pairs) the wallet can sign for.\n * Useful for dApps that need to know which authorities are available before\n * constructing transactions.\n */\n getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>>;\n\n /**\n * Register a callback for a wallet event.\n * @param event - The event type to listen for\n * @param callback - The callback to invoke when the event fires\n */\n on(event: WalletEventType, callback: (data: any) => void): void;\n\n /**\n * Remove a previously registered callback for a wallet event.\n * @param event - The event type to stop listening for\n * @param callback - The exact callback reference to remove\n */\n off(event: WalletEventType, callback: (data: any) => void): void;\n\n /**\n * Request the wallet to switch to a different network.\n * @param chainId - The chain identifier of the target network\n */\n switchNetwork(chainId: string): Promise<UltraResponse<void>>;\n\n /**\n * Get information about the currently active network.\n */\n getNetwork(): Promise<UltraResponse<NetworkDetails>>;\n\n /**\n * Get all networks configured in the wallet.\n */\n getNetworks(): Promise<UltraResponse<NetworkDetails[]>>;\n\n /**\n * Add a custom network to the wallet.\n * @param params - The network configuration to add\n */\n addNetwork(params: { name: string; chainId: string; nodeUrl: string }): Promise<UltraResponse<void>>;\n\n /**\n * Release any resources held by the provider (timers, window listeners,\n * internal maps). After dispose() the provider is no longer usable —\n * callers should drop the reference and construct a fresh one if needed.\n * Implementations that hold no resources may safely no-op.\n */\n dispose(): void;\n}\n"]}
1
+ {"version":3,"file":"wallet-provider.interface.js","sourceRoot":"","sources":["../../../../../../libs/wallet-sdk/src/lib/interfaces/wallet-provider.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { BlockchainTransaction, SignTransactionOptions } from './blockchain-transaction.interface';\nimport { AvailableAuth } from './blockchain-transaction.interface';\nimport { ConnectParams } from './connect-params.interface';\nimport {\n AccountInfo,\n ConnectResult,\n DisconnectResponse,\n NetworkDetails,\n SignMessageResult,\n SignTransactionResult,\n UltraResponse,\n} from './wallet-provider-response.interface';\n\n/**\n * Event types emitted by the wallet provider.\n */\nexport type WalletEventType = 'accountChanged' | 'networkChanged' | 'disconnect';\n\n/**\n * Defines the minimal interface that a wallet provider must implement for the Ultra Wallet SDK.\n */\nexport interface UltraWalletProvider {\n /**\n * Prompt the user for permission to share his wallet info with the 3rd party application.\n * Once permission is established the first time, the 3rd party application will be whitelisted for future requests.\n * @param params.onlyIfTrusted - Do not prompt the user for permissions. Share current account info if Dapp is already trusted,\n * otherwise rejects the request.\n */\n connect(params?: ConnectParams): Promise<UltraResponse<ConnectResult>>;\n\n /**\n * Remove permission to interact with the 3rd party application\n */\n disconnect(): Promise<UltraResponse<DisconnectResponse>>;\n\n /**\n * Open a popup to sign a message\n * @param message - The message to sign. The message should be prefixed with \"0x:, UOSx:, or message:\"\n */\n signMessage(message: string): Promise<UltraResponse<SignMessageResult>>;\n\n /**\n * Open a popup to sign a transaction\n * @param transaction - The transaction to sign\n * @param options - The options for the transaction\n */\n signTransaction(\n transaction: BlockchainTransaction | BlockchainTransaction[],\n options?: SignTransactionOptions,\n ): Promise<UltraResponse<SignTransactionResult>>;\n\n /**\n * Get current chain id\n */\n getChainId(): Promise<UltraResponse<string>>;\n\n /**\n * Get all accounts available in the connected wallet.\n */\n getAccounts(): Promise<UltraResponse<AccountInfo[]>>;\n\n /**\n * Get the currently selected account in the wallet.\n */\n getSelectedAccount(): Promise<UltraResponse<AccountInfo>>;\n\n /**\n * Get all authorizations (account@permission pairs) the wallet can sign for.\n * Useful for dApps that need to know which authorities are available before\n * constructing transactions.\n */\n getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>>;\n\n /**\n * Register a callback for a wallet event.\n * @param event - The event type to listen for\n * @param callback - The callback to invoke when the event fires\n */\n on(event: WalletEventType, callback: (data: any) => void): void;\n\n /**\n * Remove a previously registered callback for a wallet event.\n * @param event - The event type to stop listening for\n * @param callback - The exact callback reference to remove\n */\n off(event: WalletEventType, callback: (data: any) => void): void;\n\n /**\n * Request the wallet to switch to a different network.\n * @param chainId - The chain identifier of the target network\n */\n switchNetwork(chainId: string): Promise<UltraResponse<void>>;\n\n /**\n * Get information about the currently active network.\n */\n getNetwork(): Promise<UltraResponse<NetworkDetails>>;\n\n /**\n * Get all networks configured in the wallet.\n */\n getNetworks(): Promise<UltraResponse<NetworkDetails[]>>;\n\n /**\n * Release any resources held by the provider (timers, window listeners,\n * internal maps). After dispose() the provider is no longer usable —\n * callers should drop the reference and construct a fresh one if needed.\n * Implementations that hold no resources may safely no-op.\n */\n dispose(): void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { AccountInfo, AvailableAuth, BlockchainTransaction, ConnectParams, ConnectResult, NetworkDetails, PurchaseItemResult, PurchaseItemType, SignMessageResult, SignTransactionOptions, SignTransactionResult, UltraResponse, UltraWalletProvider, UltraWalletSdkOptions, WalletEventType } from '../../interfaces';
1
+ import { AccountInfo, AvailableAuth, BlockchainTransaction, ConnectParams, ConnectResult, NetworkDetails, SignMessageResult, SignTransactionOptions, SignTransactionResult, UltraResponse, UltraWalletProvider, UltraWalletSdkOptions, WalletEventType } from '../../interfaces';
2
2
  export declare class ExtensionProvider implements UltraWalletProvider {
3
3
  private readonly options?;
4
4
  private readonly eventListeners;
@@ -25,7 +25,6 @@ export declare class ExtensionProvider implements UltraWalletProvider {
25
25
  signMessage(message: string): Promise<UltraResponse<SignMessageResult>>;
26
26
  signTransaction(transaction: BlockchainTransaction | BlockchainTransaction[], options?: SignTransactionOptions): Promise<UltraResponse<SignTransactionResult>>;
27
27
  getChainId(): Promise<UltraResponse<string>>;
28
- purchaseItem(itemType: PurchaseItemType, itemId: string): Promise<UltraResponse<PurchaseItemResult>>;
29
28
  getAccounts(): Promise<UltraResponse<AccountInfo[]>>;
30
29
  getSelectedAccount(): Promise<UltraResponse<AccountInfo>>;
31
30
  getAvailableAuthorizations(): Promise<UltraResponse<AvailableAuth[]>>;
@@ -34,11 +33,6 @@ export declare class ExtensionProvider implements UltraWalletProvider {
34
33
  switchNetwork(chainId: string): Promise<UltraResponse<void>>;
35
34
  getNetwork(): Promise<UltraResponse<NetworkDetails>>;
36
35
  getNetworks(): Promise<UltraResponse<NetworkDetails[]>>;
37
- addNetwork(params: {
38
- name: string;
39
- chainId: string;
40
- nodeUrl: string;
41
- }): Promise<UltraResponse<void>>;
42
36
  /**
43
37
  * Detach the window message listener and clear timers + maps. Safe to call
44
38
  * multiple times. Does NOT deregister each listener on the BG — the BG
@@ -1 +1 @@
1
- {"version":3,"file":"extension.provider.d.ts","sourceRoot":"","sources":["../../../../../../../libs/wallet-sdk/src/lib/providers/extension-provider/extension.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAgB1B,qBAAa,iBAAkB,YAAW,mBAAmB;IAgB/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAfrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0D;IACzF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,cAAc,CAAgD;IAEtE;;;;;OAKG;IACH,OAAO,KAAK,cAAc,GAEzB;gBAE4B,OAAO,CAAC,EAAE,qBAAqB;IAI5D;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAgBzB,OAAO,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAqB5E,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAI7C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAIvE,eAAe,CACb,WAAW,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,EAC5D,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAIhD,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAI5C,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAIpG,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;IAIpD,kBAAkB,IAAI,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAIzD,0BAA0B,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;IAIrE,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAY/D,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAWhE,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAI5D,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAIpD,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC;IAIvD,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAIpG;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;YAaD,6BAA6B;YAe7B,+BAA+B;IAe7C,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,kBAAkB;CAM3B"}
1
+ {"version":3,"file":"extension.provider.d.ts","sourceRoot":"","sources":["../../../../../../../libs/wallet-sdk/src/lib/providers/extension-provider/extension.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,c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AAG,IAAI;IAY/D,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAWhE,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAI5D,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAIpD,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC;IAIvD;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;YAaD,6BAA6B;YAe7B,+BAA+B;IAe7C,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,kBAAkB;CAM3B"}
@@ -75,9 +75,6 @@ export class ExtensionProvider {
75
75
  getChainId() {
76
76
  return this.walletProvider.getChainId();
77
77
  }
78
- purchaseItem(itemType, itemId) {
79
- return this.walletProvider.purchaseItem(itemType, itemId);
80
- }
81
78
  getAccounts() {
82
79
  return this.walletProvider.getAccounts();
83
80
  }
@@ -119,9 +116,6 @@ export class ExtensionProvider {
119
116
  getNetworks() {
120
117
  return this.walletProvider.getNetworks();
121
118
  }
122
- addNetwork(params) {
123
- return this.walletProvider.addNetwork(params);
124
- }
125
119
  /**
126
120
  * Detach the window message listener and clear timers + maps. Safe to call
127
121
  * multiple times. Does NOT deregister each listener on the BG — the BG