[{"data":1,"prerenderedAt":1757},["ShallowReactive",2],{"navigation_docs":3,"-mini-apps-ethereum-provider":137,"-mini-apps-ethereum-provider-surround":1752},[4,27,57,79,97,115],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting Started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Mini Apps","i-lucide-smartphone","\u002Fmini-apps","2.mini-apps",[33,37,41,45,49,53],{"title":34,"path":35,"stem":36},"Provider runtime","\u002Fmini-apps\u002Fprovider-runtime","2.mini-apps\u002F1.provider-runtime",{"title":38,"path":39,"stem":40},"Ethereum provider","\u002Fmini-apps\u002Fethereum-provider","2.mini-apps\u002F2.ethereum-provider",{"title":42,"path":43,"stem":44},"Language and i18n","\u002Fmini-apps\u002Flanguage-i18n","2.mini-apps\u002F3.language-i18n",{"title":46,"path":47,"stem":48},"Local simulator","\u002Fmini-apps\u002Flocal-simulator","2.mini-apps\u002F4.local-simulator",{"title":50,"path":51,"stem":52},"Nuxt module","\u002Fmini-apps\u002Fnuxt-module","2.mini-apps\u002F5.nuxt-module",{"title":54,"path":55,"stem":56},"Host runtime","\u002Fmini-apps\u002Fhost-runtime","2.mini-apps\u002F6.host-runtime",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":26},"Auth","i-lucide-key-round","\u002Fauth","3.auth",[63,67,71,75],{"title":64,"path":65,"stem":66},"Nimiq Better Auth","\u002Fauth\u002Fnimiq-better-auth","3.auth\u002F1.nimiq-better-auth",{"title":68,"path":69,"stem":70},"Cross-device approval","\u002Fauth\u002Fcross-device","3.auth\u002F2.cross-device",{"title":72,"path":73,"stem":74},"Nimiq cross-device adapter","\u002Fauth\u002Fnimiq-adapter","3.auth\u002F3.nimiq-adapter",{"title":76,"path":77,"stem":78},"Security model","\u002Fauth\u002Fsecurity-model","3.auth\u002F4.security-model",{"title":80,"icon":81,"path":82,"stem":83,"children":84,"page":26},"Utilities","i-lucide-wrench","\u002Futilities","4.utilities",[85,89,93],{"title":86,"path":87,"stem":88},"Universal Nimiq facade","\u002Futilities\u002Funimiq","4.utilities\u002F1.unimiq",{"title":90,"path":91,"stem":92},"ERC-20 helpers","\u002Futilities\u002Funerc20","4.utilities\u002F2.unerc20",{"title":94,"path":95,"stem":96},"Better Auth ledger","\u002Futilities\u002Fledger","4.utilities\u002F3.ledger",{"title":98,"icon":99,"path":100,"stem":101,"children":102,"page":26},"Testing","i-lucide-test-tube-2","\u002Ftesting","5.testing",[103,107,111],{"title":104,"path":105,"stem":106},"Local scenarios","\u002Ftesting\u002Flocal-scenarios","5.testing\u002F1.local-scenarios",{"title":108,"path":109,"stem":110},"Vitest helpers","\u002Ftesting\u002Fvitest-helpers","5.testing\u002F2.vitest-helpers",{"title":112,"path":113,"stem":114},"Bridge mode","\u002Ftesting\u002Fbridge-mode","5.testing\u002F3.bridge-mode",{"title":116,"icon":117,"path":118,"stem":119,"children":120,"page":26},"Reference","i-lucide-book-open","\u002Freference","6.reference",[121,125,129,133],{"title":122,"path":123,"stem":124},"Packages","\u002Freference\u002Fpackages","6.reference\u002F1.packages",{"title":126,"path":127,"stem":128},"Endpoints","\u002Freference\u002Fendpoints","6.reference\u002F2.endpoints",{"title":130,"path":131,"stem":132},"Runtime support","\u002Freference\u002Fruntime-support","6.reference\u002F3.runtime-support",{"title":134,"path":135,"stem":136},"Public API exports","\u002Freference\u002Fpublic-api","6.reference\u002F4.public-api",{"id":138,"title":38,"body":139,"description":1746,"extension":1747,"links":1748,"meta":1749,"navigation":245,"path":39,"seo":1750,"stem":40,"__hash__":1751},"docs\u002F2.mini-apps\u002F2.ethereum-provider.md",{"type":140,"value":141,"toc":1737},"minimark",[142,151,158,163,178,184,193,197,291,294,309,313,316,912,919,931,935,944,1347,1349,1364,1368,1371,1521,1531,1535,1541,1690,1692,1706,1710,1733],[143,144,145,146,150],"p",{},"Use the Ethereum helpers when your mini app needs the injected EIP-1193 ",[147,148,149],"code",{},"window.ethereum"," provider for EVM accounts, chain switching, native transfers, or ERC-20 reads and writes.",[143,152,153,154,157],{},"Do not use these helpers when you only need the Nimiq provider. Use the provider runtime page for ",[147,155,156],{},"window.nimiq",".",[159,160,162],"h2",{"id":161},"choose-the-ethereum-helper","Choose the Ethereum helper",[143,164,165,166,169,170,173,174,177],{},"Use ",[147,167,168],{},"requestMiniAppEthereumAccount()"," when a button click needs one connected address. It first reads ",[147,171,172],{},"eth_accounts",", then asks with ",[147,175,176],{},"eth_requestAccounts"," only when no account is connected.",[143,179,165,180,183],{},[147,181,182],{},"getMiniAppEthereumAccounts()"," when you need a non-prompting account check.",[143,185,165,186,189,190,192],{},[147,187,188],{},"discoverEip6963Providers()"," only when wallet discovery semantics matter. Direct ",[147,191,149],{}," access is enough for most mini apps.",[159,194,196],{"id":195},"connect-one-account","Connect one account",[198,199,205],"pre",{"className":200,"code":201,"filename":202,"language":203,"meta":204,"style":204},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { requestMiniAppEthereumAccount } from '@onmax\u002Fnimiq-mini-app-kit'\n\nexport async function connectEthereumAccount() {\n  return await requestMiniAppEthereumAccount()\n}\n","app\u002Fethereum-account.ts","ts","",[147,206,207,240,247,270,285],{"__ignoreMap":204},[208,209,212,216,220,224,227,230,233,237],"span",{"class":210,"line":211},"line",1,[208,213,215],{"class":214},"s7zQu","import",[208,217,219],{"class":218},"sMK4o"," {",[208,221,223],{"class":222},"sTEyZ"," requestMiniAppEthereumAccount",[208,225,226],{"class":218}," }",[208,228,229],{"class":214}," from",[208,231,232],{"class":218}," '",[208,234,236],{"class":235},"sfazB","@onmax\u002Fnimiq-mini-app-kit",[208,238,239],{"class":218},"'\n",[208,241,243],{"class":210,"line":242},2,[208,244,246],{"emptyLinePlaceholder":245},true,"\n",[208,248,250,253,257,260,264,267],{"class":210,"line":249},3,[208,251,252],{"class":214},"export",[208,254,256],{"class":255},"spNyl"," async",[208,258,259],{"class":255}," function",[208,261,263],{"class":262},"s2Zo4"," connectEthereumAccount",[208,265,266],{"class":218},"()",[208,268,269],{"class":218}," {\n",[208,271,273,276,279,281],{"class":210,"line":272},4,[208,274,275],{"class":214},"  return",[208,277,278],{"class":214}," await",[208,280,223],{"class":262},[208,282,284],{"class":283},"swJcz","()\n",[208,286,288],{"class":210,"line":287},5,[208,289,290],{"class":218},"}\n",[143,292,293],{},"Expected behavior:",[295,296,297,301,306],"ul",{},[298,299,300],"li",{},"If the account is already connected, the helper returns it without prompting.",[298,302,303,304,157],{},"If no account is connected, Nimiq Pay asks the user to approve ",[147,305,176],{},[298,307,308],{},"Concurrent callers share one pending account request.",[159,310,312],{"id":311},"switch-to-polygon-before-a-usdt-read","Switch to Polygon before a USDT read",[143,314,315],{},"Use the active chain deliberately before token reads or writes. USDT on Polygon uses 6 decimals.",[198,317,320],{"className":200,"code":318,"filename":319,"language":203,"meta":204,"style":204},"import {\n  initMiniAppEthereumProvider,\n  requestMiniAppEthereumAccount,\n} from '@onmax\u002Fnimiq-mini-app-kit'\nimport { decodeFunctionResult, encodeFunctionData, formatUnits, parseAbi } from 'viem'\n\nconst USDT_POLYGON = '0xc2132D05D31c914a87C6611C10748AEb04B58e8F'\nconst ERC20_ABI = parseAbi([\n  'function balanceOf(address account) view returns (uint256)',\n])\n\nexport async function readPolygonUsdtBalance() {\n  const ethereum = await initMiniAppEthereumProvider({ timeout: 10_000 })\n  const account = await requestMiniAppEthereumAccount({ provider: ethereum })\n\n  await ethereum.request({\n    method: 'wallet_switchEthereumChain',\n    params: [{ chainId: '0x89' }],\n  })\n\n  const data = encodeFunctionData({\n    abi: ERC20_ABI,\n    functionName: 'balanceOf',\n    args: [account as `0x${string}`],\n  })\n\n  const rawBalance = await ethereum.request\u003C`0x${string}`>({\n    method: 'eth_call',\n    params: [{ to: USDT_POLYGON, data }, 'latest'],\n  })\n\n  const balance = decodeFunctionResult({\n    abi: ERC20_ABI,\n    functionName: 'balanceOf',\n    data: rawBalance,\n  })\n\n  return formatUnits(balance, 6)\n}\n","app\u002Fpolygon-usdt.ts",[147,321,322,328,336,343,356,392,397,416,431,445,451,456,472,510,539,544,562,579,611,619,624,640,653,670,706,713,718,757,773,810,817,822,838,849,864,876,883,888,907],{"__ignoreMap":204},[208,323,324,326],{"class":210,"line":211},[208,325,215],{"class":214},[208,327,269],{"class":218},[208,329,330,333],{"class":210,"line":242},[208,331,332],{"class":222},"  initMiniAppEthereumProvider",[208,334,335],{"class":218},",\n",[208,337,338,341],{"class":210,"line":249},[208,339,340],{"class":222},"  requestMiniAppEthereumAccount",[208,342,335],{"class":218},[208,344,345,348,350,352,354],{"class":210,"line":272},[208,346,347],{"class":218},"}",[208,349,229],{"class":214},[208,351,232],{"class":218},[208,353,236],{"class":235},[208,355,239],{"class":218},[208,357,358,360,362,365,368,371,373,376,378,381,383,385,387,390],{"class":210,"line":287},[208,359,215],{"class":214},[208,361,219],{"class":218},[208,363,364],{"class":222}," decodeFunctionResult",[208,366,367],{"class":218},",",[208,369,370],{"class":222}," encodeFunctionData",[208,372,367],{"class":218},[208,374,375],{"class":222}," formatUnits",[208,377,367],{"class":218},[208,379,380],{"class":222}," parseAbi",[208,382,226],{"class":218},[208,384,229],{"class":214},[208,386,232],{"class":218},[208,388,389],{"class":235},"viem",[208,391,239],{"class":218},[208,393,395],{"class":210,"line":394},6,[208,396,246],{"emptyLinePlaceholder":245},[208,398,400,403,406,409,411,414],{"class":210,"line":399},7,[208,401,402],{"class":255},"const",[208,404,405],{"class":222}," USDT_POLYGON ",[208,407,408],{"class":218},"=",[208,410,232],{"class":218},[208,412,413],{"class":235},"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",[208,415,239],{"class":218},[208,417,419,421,424,426,428],{"class":210,"line":418},8,[208,420,402],{"class":255},[208,422,423],{"class":222}," ERC20_ABI ",[208,425,408],{"class":218},[208,427,380],{"class":262},[208,429,430],{"class":222},"([\n",[208,432,434,437,440,443],{"class":210,"line":433},9,[208,435,436],{"class":218},"  '",[208,438,439],{"class":235},"function balanceOf(address account) view returns (uint256)",[208,441,442],{"class":218},"'",[208,444,335],{"class":218},[208,446,448],{"class":210,"line":447},10,[208,449,450],{"class":222},"])\n",[208,452,454],{"class":210,"line":453},11,[208,455,246],{"emptyLinePlaceholder":245},[208,457,459,461,463,465,468,470],{"class":210,"line":458},12,[208,460,252],{"class":214},[208,462,256],{"class":255},[208,464,259],{"class":255},[208,466,467],{"class":262}," readPolygonUsdtBalance",[208,469,266],{"class":218},[208,471,269],{"class":218},[208,473,475,478,481,484,486,489,492,495,498,501,505,507],{"class":210,"line":474},13,[208,476,477],{"class":255},"  const",[208,479,480],{"class":222}," ethereum",[208,482,483],{"class":218}," =",[208,485,278],{"class":214},[208,487,488],{"class":262}," initMiniAppEthereumProvider",[208,490,491],{"class":283},"(",[208,493,494],{"class":218},"{",[208,496,497],{"class":283}," timeout",[208,499,500],{"class":218},":",[208,502,504],{"class":503},"sbssI"," 10_000",[208,506,226],{"class":218},[208,508,509],{"class":283},")\n",[208,511,513,515,518,520,522,524,526,528,531,533,535,537],{"class":210,"line":512},14,[208,514,477],{"class":255},[208,516,517],{"class":222}," account",[208,519,483],{"class":218},[208,521,278],{"class":214},[208,523,223],{"class":262},[208,525,491],{"class":283},[208,527,494],{"class":218},[208,529,530],{"class":283}," provider",[208,532,500],{"class":218},[208,534,480],{"class":222},[208,536,226],{"class":218},[208,538,509],{"class":283},[208,540,542],{"class":210,"line":541},15,[208,543,246],{"emptyLinePlaceholder":245},[208,545,547,550,552,554,557,559],{"class":210,"line":546},16,[208,548,549],{"class":214},"  await",[208,551,480],{"class":222},[208,553,157],{"class":218},[208,555,556],{"class":262},"request",[208,558,491],{"class":283},[208,560,561],{"class":218},"{\n",[208,563,565,568,570,572,575,577],{"class":210,"line":564},17,[208,566,567],{"class":283},"    method",[208,569,500],{"class":218},[208,571,232],{"class":218},[208,573,574],{"class":235},"wallet_switchEthereumChain",[208,576,442],{"class":218},[208,578,335],{"class":218},[208,580,582,585,587,590,592,595,597,599,602,604,606,609],{"class":210,"line":581},18,[208,583,584],{"class":283},"    params",[208,586,500],{"class":218},[208,588,589],{"class":283}," [",[208,591,494],{"class":218},[208,593,594],{"class":283}," chainId",[208,596,500],{"class":218},[208,598,232],{"class":218},[208,600,601],{"class":235},"0x89",[208,603,442],{"class":218},[208,605,226],{"class":218},[208,607,608],{"class":283},"]",[208,610,335],{"class":218},[208,612,614,617],{"class":210,"line":613},19,[208,615,616],{"class":218},"  }",[208,618,509],{"class":283},[208,620,622],{"class":210,"line":621},20,[208,623,246],{"emptyLinePlaceholder":245},[208,625,627,629,632,634,636,638],{"class":210,"line":626},21,[208,628,477],{"class":255},[208,630,631],{"class":222}," data",[208,633,483],{"class":218},[208,635,370],{"class":262},[208,637,491],{"class":283},[208,639,561],{"class":218},[208,641,643,646,648,651],{"class":210,"line":642},22,[208,644,645],{"class":283},"    abi",[208,647,500],{"class":218},[208,649,650],{"class":222}," ERC20_ABI",[208,652,335],{"class":218},[208,654,656,659,661,663,666,668],{"class":210,"line":655},23,[208,657,658],{"class":283},"    functionName",[208,660,500],{"class":218},[208,662,232],{"class":218},[208,664,665],{"class":235},"balanceOf",[208,667,442],{"class":218},[208,669,335],{"class":218},[208,671,673,676,678,680,683,686,689,692,695,699,702,704],{"class":210,"line":672},24,[208,674,675],{"class":283},"    args",[208,677,500],{"class":218},[208,679,589],{"class":283},[208,681,682],{"class":222},"account",[208,684,685],{"class":214}," as",[208,687,688],{"class":218}," `",[208,690,691],{"class":235},"0x",[208,693,694],{"class":218},"${",[208,696,698],{"class":697},"sBMFI","string",[208,700,701],{"class":218},"}`",[208,703,608],{"class":283},[208,705,335],{"class":218},[208,707,709,711],{"class":210,"line":708},25,[208,710,616],{"class":218},[208,712,509],{"class":283},[208,714,716],{"class":210,"line":715},26,[208,717,246],{"emptyLinePlaceholder":245},[208,719,721,723,726,728,730,732,734,736,739,742,744,746,748,750,753,755],{"class":210,"line":720},27,[208,722,477],{"class":255},[208,724,725],{"class":222}," rawBalance",[208,727,483],{"class":218},[208,729,278],{"class":214},[208,731,480],{"class":222},[208,733,157],{"class":218},[208,735,556],{"class":262},[208,737,738],{"class":218},"\u003C",[208,740,741],{"class":218},"`",[208,743,691],{"class":235},[208,745,694],{"class":218},[208,747,698],{"class":697},[208,749,701],{"class":218},[208,751,752],{"class":218},">",[208,754,491],{"class":283},[208,756,561],{"class":218},[208,758,760,762,764,766,769,771],{"class":210,"line":759},28,[208,761,567],{"class":283},[208,763,500],{"class":218},[208,765,232],{"class":218},[208,767,768],{"class":235},"eth_call",[208,770,442],{"class":218},[208,772,335],{"class":218},[208,774,776,778,780,782,784,787,789,792,794,796,799,801,804,806,808],{"class":210,"line":775},29,[208,777,584],{"class":283},[208,779,500],{"class":218},[208,781,589],{"class":283},[208,783,494],{"class":218},[208,785,786],{"class":283}," to",[208,788,500],{"class":218},[208,790,791],{"class":222}," USDT_POLYGON",[208,793,367],{"class":218},[208,795,631],{"class":222},[208,797,798],{"class":218}," },",[208,800,232],{"class":218},[208,802,803],{"class":235},"latest",[208,805,442],{"class":218},[208,807,608],{"class":283},[208,809,335],{"class":218},[208,811,813,815],{"class":210,"line":812},30,[208,814,616],{"class":218},[208,816,509],{"class":283},[208,818,820],{"class":210,"line":819},31,[208,821,246],{"emptyLinePlaceholder":245},[208,823,825,827,830,832,834,836],{"class":210,"line":824},32,[208,826,477],{"class":255},[208,828,829],{"class":222}," balance",[208,831,483],{"class":218},[208,833,364],{"class":262},[208,835,491],{"class":283},[208,837,561],{"class":218},[208,839,841,843,845,847],{"class":210,"line":840},33,[208,842,645],{"class":283},[208,844,500],{"class":218},[208,846,650],{"class":222},[208,848,335],{"class":218},[208,850,852,854,856,858,860,862],{"class":210,"line":851},34,[208,853,658],{"class":283},[208,855,500],{"class":218},[208,857,232],{"class":218},[208,859,665],{"class":235},[208,861,442],{"class":218},[208,863,335],{"class":218},[208,865,867,870,872,874],{"class":210,"line":866},35,[208,868,869],{"class":283},"    data",[208,871,500],{"class":218},[208,873,725],{"class":222},[208,875,335],{"class":218},[208,877,879,881],{"class":210,"line":878},36,[208,880,616],{"class":218},[208,882,509],{"class":283},[208,884,886],{"class":210,"line":885},37,[208,887,246],{"emptyLinePlaceholder":245},[208,889,891,893,895,897,900,902,905],{"class":210,"line":890},38,[208,892,275],{"class":214},[208,894,375],{"class":262},[208,896,491],{"class":283},[208,898,899],{"class":222},"balance",[208,901,367],{"class":218},[208,903,904],{"class":503}," 6",[208,906,509],{"class":283},[208,908,910],{"class":210,"line":909},39,[208,911,290],{"class":218},[143,913,914,915,918],{},"Expected result in the deterministic simulator when the account has ",[147,916,917],{},"1000000"," raw units:",[198,920,925],{"className":921,"code":922,"filename":923,"language":924,"meta":204,"style":204},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","1\n","output","txt",[147,926,927],{"__ignoreMap":204},[208,928,929],{"class":210,"line":211},[208,930,922],{},[159,932,934],{"id":933},"add-a-missing-chain-after-switch-failure","Add a missing chain after switch failure",[143,936,165,937,940,941,943],{},[147,938,939],{},"wallet_addEthereumChain"," when ",[147,942,574],{}," fails because the chain is unknown to the host.",[198,945,948],{"className":200,"code":946,"filename":947,"language":203,"meta":204,"style":204},"import { initMiniAppEthereumProvider } from '@onmax\u002Fnimiq-mini-app-kit'\n\nconst BASE = {\n  chainId: '0x2105',\n  chainName: 'Base',\n  nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n  rpcUrls: ['https:\u002F\u002Fmainnet.base.org'],\n  blockExplorerUrls: ['https:\u002F\u002Fbasescan.org'],\n}\n\nexport async function ensureBaseChain() {\n  const ethereum = await initMiniAppEthereumProvider()\n\n  try {\n    await ethereum.request({\n      method: 'wallet_switchEthereumChain',\n      params: [{ chainId: BASE.chainId }],\n    })\n  }\n  catch (error) {\n    if ((error as { code?: number }).code !== 4902)\n      throw error\n\n    await ethereum.request({\n      method: 'wallet_addEthereumChain',\n      params: [BASE],\n    })\n  }\n}\n","app\u002Fensure-base.ts",[147,949,950,968,972,983,999,1015,1063,1083,1103,1107,1111,1126,1140,1144,1151,1166,1181,1210,1217,1222,1238,1278,1286,1290,1304,1318,1333,1339,1343],{"__ignoreMap":204},[208,951,952,954,956,958,960,962,964,966],{"class":210,"line":211},[208,953,215],{"class":214},[208,955,219],{"class":218},[208,957,488],{"class":222},[208,959,226],{"class":218},[208,961,229],{"class":214},[208,963,232],{"class":218},[208,965,236],{"class":235},[208,967,239],{"class":218},[208,969,970],{"class":210,"line":242},[208,971,246],{"emptyLinePlaceholder":245},[208,973,974,976,979,981],{"class":210,"line":249},[208,975,402],{"class":255},[208,977,978],{"class":222}," BASE ",[208,980,408],{"class":218},[208,982,269],{"class":218},[208,984,985,988,990,992,995,997],{"class":210,"line":272},[208,986,987],{"class":283},"  chainId",[208,989,500],{"class":218},[208,991,232],{"class":218},[208,993,994],{"class":235},"0x2105",[208,996,442],{"class":218},[208,998,335],{"class":218},[208,1000,1001,1004,1006,1008,1011,1013],{"class":210,"line":287},[208,1002,1003],{"class":283},"  chainName",[208,1005,500],{"class":218},[208,1007,232],{"class":218},[208,1009,1010],{"class":235},"Base",[208,1012,442],{"class":218},[208,1014,335],{"class":218},[208,1016,1017,1020,1022,1024,1027,1029,1031,1034,1036,1038,1041,1043,1045,1048,1050,1052,1055,1057,1060],{"class":210,"line":394},[208,1018,1019],{"class":283},"  nativeCurrency",[208,1021,500],{"class":218},[208,1023,219],{"class":218},[208,1025,1026],{"class":283}," name",[208,1028,500],{"class":218},[208,1030,232],{"class":218},[208,1032,1033],{"class":235},"Ether",[208,1035,442],{"class":218},[208,1037,367],{"class":218},[208,1039,1040],{"class":283}," symbol",[208,1042,500],{"class":218},[208,1044,232],{"class":218},[208,1046,1047],{"class":235},"ETH",[208,1049,442],{"class":218},[208,1051,367],{"class":218},[208,1053,1054],{"class":283}," decimals",[208,1056,500],{"class":218},[208,1058,1059],{"class":503}," 18",[208,1061,1062],{"class":218}," },\n",[208,1064,1065,1068,1070,1072,1074,1077,1079,1081],{"class":210,"line":399},[208,1066,1067],{"class":283},"  rpcUrls",[208,1069,500],{"class":218},[208,1071,589],{"class":222},[208,1073,442],{"class":218},[208,1075,1076],{"class":235},"https:\u002F\u002Fmainnet.base.org",[208,1078,442],{"class":218},[208,1080,608],{"class":222},[208,1082,335],{"class":218},[208,1084,1085,1088,1090,1092,1094,1097,1099,1101],{"class":210,"line":418},[208,1086,1087],{"class":283},"  blockExplorerUrls",[208,1089,500],{"class":218},[208,1091,589],{"class":222},[208,1093,442],{"class":218},[208,1095,1096],{"class":235},"https:\u002F\u002Fbasescan.org",[208,1098,442],{"class":218},[208,1100,608],{"class":222},[208,1102,335],{"class":218},[208,1104,1105],{"class":210,"line":433},[208,1106,290],{"class":218},[208,1108,1109],{"class":210,"line":447},[208,1110,246],{"emptyLinePlaceholder":245},[208,1112,1113,1115,1117,1119,1122,1124],{"class":210,"line":453},[208,1114,252],{"class":214},[208,1116,256],{"class":255},[208,1118,259],{"class":255},[208,1120,1121],{"class":262}," ensureBaseChain",[208,1123,266],{"class":218},[208,1125,269],{"class":218},[208,1127,1128,1130,1132,1134,1136,1138],{"class":210,"line":458},[208,1129,477],{"class":255},[208,1131,480],{"class":222},[208,1133,483],{"class":218},[208,1135,278],{"class":214},[208,1137,488],{"class":262},[208,1139,284],{"class":283},[208,1141,1142],{"class":210,"line":474},[208,1143,246],{"emptyLinePlaceholder":245},[208,1145,1146,1149],{"class":210,"line":512},[208,1147,1148],{"class":214},"  try",[208,1150,269],{"class":218},[208,1152,1153,1156,1158,1160,1162,1164],{"class":210,"line":541},[208,1154,1155],{"class":214},"    await",[208,1157,480],{"class":222},[208,1159,157],{"class":218},[208,1161,556],{"class":262},[208,1163,491],{"class":283},[208,1165,561],{"class":218},[208,1167,1168,1171,1173,1175,1177,1179],{"class":210,"line":546},[208,1169,1170],{"class":283},"      method",[208,1172,500],{"class":218},[208,1174,232],{"class":218},[208,1176,574],{"class":235},[208,1178,442],{"class":218},[208,1180,335],{"class":218},[208,1182,1183,1186,1188,1190,1192,1194,1196,1199,1201,1204,1206,1208],{"class":210,"line":564},[208,1184,1185],{"class":283},"      params",[208,1187,500],{"class":218},[208,1189,589],{"class":283},[208,1191,494],{"class":218},[208,1193,594],{"class":283},[208,1195,500],{"class":218},[208,1197,1198],{"class":222}," BASE",[208,1200,157],{"class":218},[208,1202,1203],{"class":222},"chainId",[208,1205,226],{"class":218},[208,1207,608],{"class":283},[208,1209,335],{"class":218},[208,1211,1212,1215],{"class":210,"line":581},[208,1213,1214],{"class":218},"    }",[208,1216,509],{"class":283},[208,1218,1219],{"class":210,"line":613},[208,1220,1221],{"class":218},"  }\n",[208,1223,1224,1227,1230,1233,1236],{"class":210,"line":621},[208,1225,1226],{"class":214},"  catch",[208,1228,1229],{"class":283}," (",[208,1231,1232],{"class":222},"error",[208,1234,1235],{"class":283},") ",[208,1237,561],{"class":218},[208,1239,1240,1243,1246,1248,1250,1252,1255,1258,1261,1263,1266,1268,1270,1273,1276],{"class":210,"line":626},[208,1241,1242],{"class":214},"    if",[208,1244,1245],{"class":283}," ((",[208,1247,1232],{"class":222},[208,1249,685],{"class":214},[208,1251,219],{"class":218},[208,1253,1254],{"class":283}," code",[208,1256,1257],{"class":218},"?:",[208,1259,1260],{"class":697}," number",[208,1262,226],{"class":218},[208,1264,1265],{"class":283},")",[208,1267,157],{"class":218},[208,1269,147],{"class":222},[208,1271,1272],{"class":218}," !==",[208,1274,1275],{"class":503}," 4902",[208,1277,509],{"class":283},[208,1279,1280,1283],{"class":210,"line":642},[208,1281,1282],{"class":214},"      throw",[208,1284,1285],{"class":222}," error\n",[208,1287,1288],{"class":210,"line":655},[208,1289,246],{"emptyLinePlaceholder":245},[208,1291,1292,1294,1296,1298,1300,1302],{"class":210,"line":672},[208,1293,1155],{"class":214},[208,1295,480],{"class":222},[208,1297,157],{"class":218},[208,1299,556],{"class":262},[208,1301,491],{"class":283},[208,1303,561],{"class":218},[208,1305,1306,1308,1310,1312,1314,1316],{"class":210,"line":708},[208,1307,1170],{"class":283},[208,1309,500],{"class":218},[208,1311,232],{"class":218},[208,1313,939],{"class":235},[208,1315,442],{"class":218},[208,1317,335],{"class":218},[208,1319,1320,1322,1324,1326,1329,1331],{"class":210,"line":715},[208,1321,1185],{"class":283},[208,1323,500],{"class":218},[208,1325,589],{"class":283},[208,1327,1328],{"class":222},"BASE",[208,1330,608],{"class":283},[208,1332,335],{"class":218},[208,1334,1335,1337],{"class":210,"line":720},[208,1336,1214],{"class":218},[208,1338,509],{"class":283},[208,1340,1341],{"class":210,"line":759},[208,1342,1221],{"class":218},[208,1344,1345],{"class":210,"line":775},[208,1346,290],{"class":218},[143,1348,293],{},[295,1350,1351,1354,1361],{},[298,1352,1353],{},"Known chain: the host asks the user to approve the switch.",[298,1355,1356,1357,1360],{},"Unknown chain with ",[147,1358,1359],{},"4902",": the host asks the user to add the chain.",[298,1362,1363],{},"Any other error stays visible to your app.",[159,1365,1367],{"id":1366},"discover-announced-providers","Discover announced providers",[143,1369,1370],{},"Use EIP-6963 discovery when an embedded wallet chooser or simulator shell needs provider announcements.",[198,1372,1375],{"className":200,"code":1373,"filename":1374,"language":203,"meta":204,"style":204},"import { discoverEip6963Providers } from '@onmax\u002Fnimiq-mini-app-kit'\n\nexport async function listAnnouncedWallets() {\n  const providers = await discoverEip6963Providers({ waitMs: 50 })\n\n  return providers.map(({ info }) => ({\n    name: info.name,\n    rdns: info.rdns,\n  }))\n}\n","app\u002Fdiscover-wallets.ts",[147,1376,1377,1396,1400,1415,1444,1448,1478,1494,1510,1517],{"__ignoreMap":204},[208,1378,1379,1381,1383,1386,1388,1390,1392,1394],{"class":210,"line":211},[208,1380,215],{"class":214},[208,1382,219],{"class":218},[208,1384,1385],{"class":222}," discoverEip6963Providers",[208,1387,226],{"class":218},[208,1389,229],{"class":214},[208,1391,232],{"class":218},[208,1393,236],{"class":235},[208,1395,239],{"class":218},[208,1397,1398],{"class":210,"line":242},[208,1399,246],{"emptyLinePlaceholder":245},[208,1401,1402,1404,1406,1408,1411,1413],{"class":210,"line":249},[208,1403,252],{"class":214},[208,1405,256],{"class":255},[208,1407,259],{"class":255},[208,1409,1410],{"class":262}," listAnnouncedWallets",[208,1412,266],{"class":218},[208,1414,269],{"class":218},[208,1416,1417,1419,1422,1424,1426,1428,1430,1432,1435,1437,1440,1442],{"class":210,"line":272},[208,1418,477],{"class":255},[208,1420,1421],{"class":222}," providers",[208,1423,483],{"class":218},[208,1425,278],{"class":214},[208,1427,1385],{"class":262},[208,1429,491],{"class":283},[208,1431,494],{"class":218},[208,1433,1434],{"class":283}," waitMs",[208,1436,500],{"class":218},[208,1438,1439],{"class":503}," 50",[208,1441,226],{"class":218},[208,1443,509],{"class":283},[208,1445,1446],{"class":210,"line":287},[208,1447,246],{"emptyLinePlaceholder":245},[208,1449,1450,1452,1454,1456,1459,1461,1464,1468,1471,1474,1476],{"class":210,"line":394},[208,1451,275],{"class":214},[208,1453,1421],{"class":222},[208,1455,157],{"class":218},[208,1457,1458],{"class":262},"map",[208,1460,491],{"class":283},[208,1462,1463],{"class":218},"({",[208,1465,1467],{"class":1466},"sHdIc"," info",[208,1469,1470],{"class":218}," })",[208,1472,1473],{"class":255}," =>",[208,1475,1229],{"class":283},[208,1477,561],{"class":218},[208,1479,1480,1483,1485,1487,1489,1492],{"class":210,"line":399},[208,1481,1482],{"class":283},"    name",[208,1484,500],{"class":218},[208,1486,1467],{"class":222},[208,1488,157],{"class":218},[208,1490,1491],{"class":222},"name",[208,1493,335],{"class":218},[208,1495,1496,1499,1501,1503,1505,1508],{"class":210,"line":418},[208,1497,1498],{"class":283},"    rdns",[208,1500,500],{"class":218},[208,1502,1467],{"class":222},[208,1504,157],{"class":218},[208,1506,1507],{"class":222},"rdns",[208,1509,335],{"class":218},[208,1511,1512,1514],{"class":210,"line":433},[208,1513,616],{"class":218},[208,1515,1516],{"class":283},"))\n",[208,1518,1519],{"class":210,"line":447},[208,1520,290],{"class":218},[143,1522,1523,1524,1527,1528,157],{},"Do not pass ",[147,1525,1526],{},"timeout"," here. The helper option is ",[147,1529,1530],{},"waitMs",[159,1532,1534],{"id":1533},"announce-a-simulator-provider","Announce a simulator provider",[143,1536,165,1537,1540],{},[147,1538,1539],{},"registerEip6963Provider()"," when a custom host shell owns the provider and wants app-side discovery to find it.",[198,1542,1545],{"className":200,"code":1543,"filename":1544,"language":203,"meta":204,"style":204},"import {\n  registerEip6963Provider,\n  type MiniAppEthereumProvider,\n} from '@onmax\u002Fnimiq-mini-app-kit'\n\nexport function registerSimulatorWallet(provider: MiniAppEthereumProvider) {\n  return registerEip6963Provider({\n    uuid: '9d95c7a2-20ef-4b6f-9df7-a77b151e8051',\n    name: 'Nimiq Pay Simulator',\n    icon: '',\n    rdns: 'com.nimiq.pay.simulator',\n  }, provider)\n}\n","host\u002Fregister-provider.ts",[147,1546,1547,1553,1560,1570,1582,1586,1608,1619,1635,1650,1662,1677,1686],{"__ignoreMap":204},[208,1548,1549,1551],{"class":210,"line":211},[208,1550,215],{"class":214},[208,1552,269],{"class":218},[208,1554,1555,1558],{"class":210,"line":242},[208,1556,1557],{"class":222},"  registerEip6963Provider",[208,1559,335],{"class":218},[208,1561,1562,1565,1568],{"class":210,"line":249},[208,1563,1564],{"class":214},"  type",[208,1566,1567],{"class":222}," MiniAppEthereumProvider",[208,1569,335],{"class":218},[208,1571,1572,1574,1576,1578,1580],{"class":210,"line":272},[208,1573,347],{"class":218},[208,1575,229],{"class":214},[208,1577,232],{"class":218},[208,1579,236],{"class":235},[208,1581,239],{"class":218},[208,1583,1584],{"class":210,"line":287},[208,1585,246],{"emptyLinePlaceholder":245},[208,1587,1588,1590,1592,1595,1597,1600,1602,1604,1606],{"class":210,"line":394},[208,1589,252],{"class":214},[208,1591,259],{"class":255},[208,1593,1594],{"class":262}," registerSimulatorWallet",[208,1596,491],{"class":218},[208,1598,1599],{"class":1466},"provider",[208,1601,500],{"class":218},[208,1603,1567],{"class":697},[208,1605,1265],{"class":218},[208,1607,269],{"class":218},[208,1609,1610,1612,1615,1617],{"class":210,"line":399},[208,1611,275],{"class":214},[208,1613,1614],{"class":262}," registerEip6963Provider",[208,1616,491],{"class":283},[208,1618,561],{"class":218},[208,1620,1621,1624,1626,1628,1631,1633],{"class":210,"line":418},[208,1622,1623],{"class":283},"    uuid",[208,1625,500],{"class":218},[208,1627,232],{"class":218},[208,1629,1630],{"class":235},"9d95c7a2-20ef-4b6f-9df7-a77b151e8051",[208,1632,442],{"class":218},[208,1634,335],{"class":218},[208,1636,1637,1639,1641,1643,1646,1648],{"class":210,"line":433},[208,1638,1482],{"class":283},[208,1640,500],{"class":218},[208,1642,232],{"class":218},[208,1644,1645],{"class":235},"Nimiq Pay Simulator",[208,1647,442],{"class":218},[208,1649,335],{"class":218},[208,1651,1652,1655,1657,1660],{"class":210,"line":447},[208,1653,1654],{"class":283},"    icon",[208,1656,500],{"class":218},[208,1658,1659],{"class":218}," ''",[208,1661,335],{"class":218},[208,1663,1664,1666,1668,1670,1673,1675],{"class":210,"line":453},[208,1665,1498],{"class":283},[208,1667,500],{"class":218},[208,1669,232],{"class":218},[208,1671,1672],{"class":235},"com.nimiq.pay.simulator",[208,1674,442],{"class":218},[208,1676,335],{"class":218},[208,1678,1679,1682,1684],{"class":210,"line":458},[208,1680,1681],{"class":218},"  },",[208,1683,530],{"class":222},[208,1685,509],{"class":283},[208,1687,1688],{"class":210,"line":474},[208,1689,290],{"class":218},[143,1691,293],{},[295,1693,1694,1697,1703],{},[298,1695,1696],{},"The provider announces immediately.",[298,1698,1699,1700,157],{},"It announces again when the page dispatches ",[147,1701,1702],{},"eip6963:requestProvider",[298,1704,1705],{},"The returned cleanup function removes the event listener.",[159,1707,1709],{"id":1708},"runtime-rules","Runtime rules",[295,1711,1712,1718,1724,1727,1730],{},[298,1713,165,1714,1717],{},[147,1715,1716],{},"eth_signTypedData_v4"," for structured approvals, permits, and typed login challenges.",[298,1719,165,1720,1723],{},[147,1721,1722],{},"personal_sign"," only for plain text.",[298,1725,1726],{},"Switch to the intended chain before token reads or writes.",[298,1728,1729],{},"Parse and format token amounts with the token's real decimals.",[298,1731,1732],{},"Do not request accounts or signatures on page load.",[1734,1735,1736],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":204,"searchDepth":242,"depth":242,"links":1738},[1739,1740,1741,1742,1743,1744,1745],{"id":161,"depth":242,"text":162},{"id":195,"depth":242,"text":196},{"id":311,"depth":242,"text":312},{"id":933,"depth":242,"text":934},{"id":1366,"depth":242,"text":1367},{"id":1533,"depth":242,"text":1534},{"id":1708,"depth":242,"text":1709},"Use the mini-app Ethereum provider and EIP-6963 discovery helpers.","md",null,{},{"title":38,"description":1746},"j_gW7tMkbU9J8Rp-ge_piu9DkZ9qnu4fSLrdRX4lCQk",[1753,1755],{"title":34,"path":35,"stem":36,"description":1754,"children":-1},"Wait for the Nimiq mini-app provider and handle unavailable host state.",{"title":42,"path":43,"stem":44,"description":1756,"children":-1},"Read the Nimiq Pay host language and connect it to Nuxt i18n.",1778838254428]