[{"data":1,"prerenderedAt":3004},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fcore-tech\u002Fwasm-wallet-client":3,"docs-surround-\u002Fdocs\u002Fcore-tech\u002Fwasm-wallet-client":2993},{"id":4,"title":5,"body":6,"description":2985,"extension":2986,"image":2987,"meta":2988,"navTitle":2987,"navigation":1415,"path":2989,"seo":2990,"stem":2991,"__hash__":2992},"docs\u002Fdocs\u002Fcore-tech\u002FWASM-wallet-client.md","Overview",{"type":7,"value":8,"toc":2861},"minimark",[9,13,28,61,65,68,472,475,479,503,505,510,518,522,572,575,589,591,595,603,606,620,623,666,669,683,689,692,701,704,716,719,733,735,738,746,749,754,758,767,770,784,786,789,797,800,807,810,830,832,835,843,846,851,854,859,862,972,975,989,991,994,1014,1017,1021,1024,1033,1036,1076,1079,1093,1095,1098,1105,1108,1112,1115,1121,1124,1137,1139,1142,1149,1152,1161,1164,1170,1173,1191,1194,1197,1214,1217,1221,1224,1230,1233,1313,1316,1328,1331,1334,1352,1355,1360,1363,1376,1379,1424,1427,1439,1442,1445,1451,1454,1458,1461,1473,1476,1502,1505,1519,1521,1524,1530,1533,1557,1559,1562,1569,1572,1576,1579,1627,1630,1644,1646,1649,1653,1656,1666,1669,1683,1687,1690,1694,1697,1706,1709,1733,1737,1740,1747,1750,1754,1757,1765,1768,1827,1829,1851,1853,1856,1863,1866,1871,1874,1927,1929,1953,1955,1958,1965,1968,1972,1975,1998,2000,2003,2010,2013,2017,2020,2086,2089,2111,2113,2116,2123,2126,2130,2133,2218,2221,2243,2245,2248,2254,2257,2261,2264,2343,2346,2386,2388,2391,2408,2411,2546,2549,2595,2597,2600,2620,2623,2833,2836,2839,2842,2845,2848,2851,2854,2857],[10,11,5],"h1",{"id":12},"overview",[14,15,16,17,22,23,27],"p",{},"WASM wallet client is a thin wrapper around Beam client library build into WASM using Emscripten toolchain. This wrapper allows to run BEAM wallet inside any browser supporting WebAssembly and it provides the regular ",[18,19,21],"a",{"href":20},"Beam-wallet-protocol-API","BEAM wallet API"," to communicated with it from external(javascript) code. It's available via ",[24,25,26],"code",{},"npm"," for different network types:",[29,30,31,40,47,54],"ul",{},[32,33,34],"li",{},[18,35,39],{"href":36,"rel":37},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fbeam-wasm-client",[38],"nofollow","mainnet",[32,41,42],{},[18,43,46],{"href":44,"rel":45},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fbeam-wasm-client-testnet",[38],"testnet",[32,48,49],{},[18,50,53],{"href":51,"rel":52},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fbeam-wasm-client-dappnet",[38],"dappnet",[32,55,56],{},[18,57,60],{"href":58,"rel":59},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fbeam-wasm-client-masternet",[38],"masternet (developer)",[10,62,64],{"id":63},"api","API",[14,66,67],{},"WASM wallet client module exports following classes:",[29,69,70,368,409],{},[32,71,72,76,77],{},[18,73,75],{"href":74},"#WasmWalletClient","WasmWalletClient"," - the main object provides a set of static and member methods to control the wallet. It could be used to implement BEAM wallet as a browser extension",[78,79,80,93],"table",{},[81,82,83],"thead",{},[84,85,86,90],"tr",{},[87,88,89],"th",{},"Method",[87,91,92],{},"Description",[94,95,96,108,119,130,141,152,167,181,192,203,214,225,236,247,258,269,280,291,302,313,324,335,346,357],"tbody",{},[84,97,98,105],{},[99,100,101],"td",{},[18,102,104],{"href":103},"#Constructor","Constructor",[99,106,107],{},"Creates new regular wallet object",[84,109,110,116],{},[99,111,112],{},[18,113,115],{"href":114},"#Headless-constructor","Headless constructor",[99,117,118],{},"Creates new headless wallet object",[84,120,121,127],{},[99,122,123],{},[18,124,126],{"href":125},"#startWallet","startWallet",[99,128,129],{},"Starts the wallet in the background thread",[84,131,132,138],{},[99,133,134],{},[18,135,137],{"href":136},"#stopWallet","stopWallet",[99,139,140],{},"Asynchronously stops the wallet running in the background",[84,142,143,149],{},[99,144,145],{},[18,146,148],{"href":147},"#isRunning","isRunning",[99,150,151],{},"Checks if the wallet is running",[84,153,154,160],{},[99,155,156],{},[18,157,159],{"href":158},"#isHeadless","isHeadless",[99,161,162,163,166],{},"Checks if the wallet is ",[24,164,165],{},"headless",", i.e. without master and owner keys",[84,168,169,175],{},[99,170,171],{},[18,172,174],{"href":173},"#sendRequest","sendRequest",[99,176,177,178,180],{},"Sends ",[18,179,64],{"href":20}," request to the wallet",[84,182,183,189],{},[99,184,185],{},[18,186,188],{"href":187},"#subscribe","subscribe",[99,190,191],{},"Subscribes for API responses",[84,193,194,200],{},[99,195,196],{},[18,197,199],{"href":198},"#unsubscribe","unsubscribe",[99,201,202],{},"Unsubscribes from response notifications",[84,204,205,211],{},[99,206,207],{},[18,208,210],{"href":209},"#setSyncHandler","setSyncHandler",[99,212,213],{},"Sets synchronization handler, allows to track sync progress",[84,215,216,222],{},[99,217,218],{},[18,219,221],{"href":220},"#setApproveSendHandler","setApproveSendHandler",[99,223,224],{},"Sets handler which allows to approve or reject any send operation initiated by DAPPs",[84,226,227,233],{},[99,228,229],{},[18,230,232],{"href":231},"#setApproveContractInfoHandler","setApproveContractInfoHandler",[99,234,235],{},"Sets handler which allows to approve or reject any operation which requires user's attention from application shader",[84,237,238,244],{},[99,239,240],{},[18,241,243],{"href":242},"#createAppAPI","createAppAPI",[99,245,246],{},"Asynchronously creates new application wallet API for given application",[84,248,249,255],{},[99,250,251],{},[18,252,254],{"href":253},"#importRecovery","importRecovery",[99,256,257],{},"Asynchronously imports recovery data",[84,259,260,266],{},[99,261,262],{},[18,263,265],{"href":264},"#GeneratePhrase","GeneratePhrase",[99,267,268],{},"Generates new seed phrase",[84,270,271,277],{},[99,272,273],{},[18,274,276],{"href":275},"#IsAllowedWord","IsAllowedWord",[99,278,279],{},"Checks if given word is in the dictionary of the words allowed to be used in seed phrases",[84,281,282,288],{},[99,283,284],{},[18,285,287],{"href":286},"#IsValidPhrase","IsValidPhrase",[99,289,290],{},"Validates given seed phrase",[84,292,293,299],{},[99,294,295],{},[18,296,298],{"href":297},"#ConvertTokenToJson","ConvertTokenToJson",[99,300,301],{},"Converts given BEAM address to json",[84,303,304,310],{},[99,305,306],{},[18,307,309],{"href":308},"#ConvertJsonToToken","ConvertJsonToToken",[99,311,312],{},"Packs transaction parameters presented as JSON object into BEAM address",[84,314,315,321],{},[99,316,317],{},[18,318,320],{"href":319},"#MountFS","MountFS",[99,322,323],{},"Asynchronously mounts WASM filesystem to the roor of IndexDB",[84,325,326,332],{},[99,327,328],{},[18,329,331],{"href":330},"#CreateWallet","CreateWallet",[99,333,334],{},"Creates new wallet database",[84,336,337,343],{},[99,338,339],{},[18,340,342],{"href":341},"#DeleteWallet","DeleteWallet",[99,344,345],{},"Deletes given wallet database from IndexDB",[84,347,348,354],{},[99,349,350],{},[18,351,353],{"href":352},"#IsInitialized","IsInitialized",[99,355,356],{},"Ensures that database was created",[84,358,359,365],{},[99,360,361],{},[18,362,364],{"href":363},"#CheckPassword","CheckPassword",[99,366,367],{},"Tests if given password fits to the database",[32,369,370,374,375],{},[18,371,373],{"href":372},"#AppAPI","AppAPI"," - a proxy API object, it gives limited wallet API for external web applications, which want to work with BEAM wallet",[78,376,377,385],{},[81,378,379],{},[84,380,381,383],{},[87,382,89],{},[87,384,92],{},[94,386,387,398],{},[84,388,389,395],{},[99,390,391],{},[18,392,394],{"href":393},"#callWalletApi","callWalletApi",[99,396,397],{},"Allows to call wallet API methods from application",[84,399,400,406],{},[99,401,402],{},[18,403,405],{"href":404},"#setHandler","setHandler",[99,407,408],{},"Sets handler to receive response for API request",[32,410,411,415,416],{},[18,412,414],{"href":413},"#AppAPICallback","AppAPICallback"," - a callback object for applications, it allows the wallet to control the action which application want to perform.",[78,417,418,426],{},[81,419,420],{},[84,421,422,424],{},[87,423,89],{},[87,425,92],{},[94,427,428,439,450,461],{},[84,429,430,436],{},[99,431,432],{},[18,433,435],{"href":434},"#sendApproved","sendApproved",[99,437,438],{},"Approves send request from application",[84,440,441,447],{},[99,442,443],{},[18,444,446],{"href":445},"#sendRejected","sendRejected",[99,448,449],{},"Rejects send request from application",[84,451,452,458],{},[99,453,454],{},[18,455,457],{"href":456},"#contractInfoApproved","contractInfoApproved",[99,459,460],{},"Approves contract call",[84,462,463,469],{},[99,464,465],{},[18,466,468],{"href":467},"#contractInfoRejected","contractInfoRejected",[99,470,471],{},"Rejects contract call",[10,473,75],{"id":474},"wasmwalletclient",[476,477,265],"h2",{"id":478},"generatephrase",[480,481,486],"pre",{"className":482,"code":483,"language":484,"meta":485,"style":485},"language-javascript shiki shiki-themes github-dark","WasmWalletClient.GeneratePhrase()\n","javascript","",[24,487,488],{"__ignoreMap":485},[489,490,493,497,500],"span",{"class":491,"line":492},"line",1,[489,494,496],{"class":495},"s95oV","WasmWalletClient.",[489,498,265],{"class":499},"svObZ",[489,501,502],{"class":495},"()\n",[14,504,268],{},[506,507,509],"h3",{"id":508},"return-value","Return value",[29,511,512],{},[32,513,514,515],{},"seed phrase, a string of 12 words from the dictionary separated separated by ",[24,516,517],{}," ",[506,519,521],{"id":520},"example","Example",[480,523,525],{"className":482,"code":524,"language":484,"meta":485,"style":485}," var phrase = Module.WasmWalletClient.GeneratePhrase()\n console.log('seed phrase is: ', phrase);\n \u002F\u002F OUTPUT: seed phrase is:  legend hurdle erode ribbon pass exit basket doll sorry version muscle brain\n",[24,526,527,546,565],{"__ignoreMap":485},[489,528,529,533,536,539,542,544],{"class":491,"line":492},[489,530,532],{"class":531},"snl16"," var",[489,534,535],{"class":495}," phrase ",[489,537,538],{"class":531},"=",[489,540,541],{"class":495}," Module.WasmWalletClient.",[489,543,265],{"class":499},[489,545,502],{"class":495},[489,547,549,552,555,558,562],{"class":491,"line":548},2,[489,550,551],{"class":495}," console.",[489,553,554],{"class":499},"log",[489,556,557],{"class":495},"(",[489,559,561],{"class":560},"sU2Wk","'seed phrase is: '",[489,563,564],{"class":495},", phrase);\n",[489,566,568],{"class":491,"line":567},3,[489,569,571],{"class":570},"sAwPA"," \u002F\u002F OUTPUT: seed phrase is:  legend hurdle erode ribbon pass exit basket doll sorry version muscle brain\n",[476,573,276],{"id":574},"isallowedword",[480,576,578],{"className":482,"code":577,"language":484,"meta":485,"style":485},"WasmWalletClient.IsAllowedWord(word : String)\n",[24,579,580],{"__ignoreMap":485},[489,581,582,584,586],{"class":491,"line":492},[489,583,496],{"class":495},[489,585,276],{"class":499},[489,587,588],{"class":495},"(word : String)\n",[14,590,279],{},[506,592,594],{"id":593},"parameters","Parameters",[29,596,597],{},[32,598,599,602],{},[24,600,601],{},"word"," : the word to be checked",[506,604,509],{"id":605},"return-value-1",[29,607,608],{},[32,609,610,613,614,616,617],{},[24,611,612],{},"true"," if ",[24,615,601],{}," is in the dictionary otherwise ",[24,618,619],{},"false",[506,621,521],{"id":622},"example-1",[480,624,626],{"className":482,"code":625,"language":484,"meta":485,"style":485},"  if (Module.WasmWalletClient.IsAllowedWord('hurdle')) {\n      console.log(\"Word is allowed\");\n  }\n",[24,627,628,646,661],{"__ignoreMap":485},[489,629,630,633,636,638,640,643],{"class":491,"line":492},[489,631,632],{"class":531},"  if",[489,634,635],{"class":495}," (Module.WasmWalletClient.",[489,637,276],{"class":499},[489,639,557],{"class":495},[489,641,642],{"class":560},"'hurdle'",[489,644,645],{"class":495},")) {\n",[489,647,648,651,653,655,658],{"class":491,"line":548},[489,649,650],{"class":495},"      console.",[489,652,554],{"class":499},[489,654,557],{"class":495},[489,656,657],{"class":560},"\"Word is allowed\"",[489,659,660],{"class":495},");\n",[489,662,663],{"class":491,"line":567},[489,664,665],{"class":495},"  }\n",[476,667,287],{"id":668},"isvalidphrase",[480,670,672],{"className":482,"code":671,"language":484,"meta":485,"style":485},"WasmWalletClient.IsValidPhrase(phrase : String)\n",[24,673,674],{"__ignoreMap":485},[489,675,676,678,680],{"class":491,"line":492},[489,677,496],{"class":495},[489,679,287],{"class":499},[489,681,682],{"class":495},"(phrase : String)\n",[14,684,685,686],{},"Validates given seed ",[24,687,688],{},"phrase",[506,690,594],{"id":691},"parameters-1",[29,693,694],{},[32,695,696,698,699],{},[24,697,688],{}," : a string of the words separated by ",[24,700,517],{},[506,702,509],{"id":703},"return-value-2",[29,705,706],{},[32,707,708,710,711,713,714],{},[24,709,612],{}," if seed ",[24,712,688],{}," is valid otherwise ",[24,715,619],{},[476,717,298],{"id":718},"converttokentojson",[480,720,722],{"className":482,"code":721,"language":484,"meta":485,"style":485},"WasmWalletClient.ConvertTokenToJson(token : String)\n",[24,723,724],{"__ignoreMap":485},[489,725,726,728,730],{"class":491,"line":492},[489,727,496],{"class":495},[489,729,298],{"class":499},[489,731,732],{"class":495},"(token : String)\n",[14,734,301],{},[506,736,594],{"id":737},"parameters-2",[29,739,740],{},[32,741,742,745],{},[24,743,744],{},"token"," : address to to unpack data",[506,747,509],{"id":748},"return-value-3",[29,750,751],{},[32,752,753],{},"json object with address parameters unpacked from given string",[506,755,757],{"id":756},"notes","Notes",[29,759,760],{},[32,761,762,763,766],{},"in beam address(token) is binary packed set the key-value parameters presented as ",[24,764,765],{},"base58"," string",[476,768,309],{"id":769},"convertjsontotoken",[480,771,773],{"className":482,"code":772,"language":484,"meta":485,"style":485},"WasmWalletClient.ConvertJsonToToken(json : String)\n",[24,774,775],{"__ignoreMap":485},[489,776,777,779,781],{"class":491,"line":492},[489,778,496],{"class":495},[489,780,309],{"class":499},[489,782,783],{"class":495},"(json : String)\n",[14,785,312],{},[506,787,594],{"id":788},"parameters-3",[29,790,791],{},[32,792,793,796],{},[24,794,795],{},"json"," : parameters of the transaction",[506,798,509],{"id":799},"return-value-4",[29,801,802],{},[32,803,804,806],{},[24,805,765],{}," encoded string of packed parameters",[476,808,320],{"id":809},"mountfs",[480,811,813],{"className":482,"code":812,"language":484,"meta":485,"style":485},"WasmWalletClient.MountFS(callback : function)\n",[24,814,815],{"__ignoreMap":485},[489,816,817,819,821,824,827],{"class":491,"line":492},[489,818,496],{"class":495},[489,820,320],{"class":499},[489,822,823],{"class":495},"(callback : ",[489,825,826],{"class":531},"function",[489,828,829],{"class":495},")\n",[14,831,323],{},[506,833,594],{"id":834},"parameters-4",[29,836,837],{},[32,838,839,842],{},[24,840,841],{},"callback"," : mounting completion handler, if an error occurred, it will be provided as a parameter to this function.",[506,844,509],{"id":845},"return-value-5",[29,847,848],{},[32,849,850],{},"none",[506,852,757],{"id":853},"notes-1",[29,855,856],{},[32,857,858],{},"This method should be called before any action which implies work with filesystem",[506,860,521],{"id":861},"example-2",[480,863,865],{"className":482,"code":864,"language":484,"meta":485,"style":485}," Module.WasmWalletClient.MountFS(function(error) {\n   if (error != null) {\n     console.log(\"mounted\");\n     var walletClient = new Module.WasmWalletClient(\"\u002Fbeam_wallet\u002Fwallet.db\",\n                                                  \"123\",\n                                                  \"eu-node01.masternet.beam.mw:8200\");\n   }\n }\n",[24,866,867,886,903,917,944,952,960,966],{"__ignoreMap":485},[489,868,869,871,873,875,877,879,883],{"class":491,"line":492},[489,870,541],{"class":495},[489,872,320],{"class":499},[489,874,557],{"class":495},[489,876,826],{"class":531},[489,878,557],{"class":495},[489,880,882],{"class":881},"s9osk","error",[489,884,885],{"class":495},") {\n",[489,887,888,891,894,897,901],{"class":491,"line":548},[489,889,890],{"class":531},"   if",[489,892,893],{"class":495}," (error ",[489,895,896],{"class":531},"!=",[489,898,900],{"class":899},"sDLfK"," null",[489,902,885],{"class":495},[489,904,905,908,910,912,915],{"class":491,"line":567},[489,906,907],{"class":495},"     console.",[489,909,554],{"class":499},[489,911,557],{"class":495},[489,913,914],{"class":560},"\"mounted\"",[489,916,660],{"class":495},[489,918,920,923,926,928,931,934,936,938,941],{"class":491,"line":919},4,[489,921,922],{"class":531},"     var",[489,924,925],{"class":495}," walletClient ",[489,927,538],{"class":531},[489,929,930],{"class":531}," new",[489,932,933],{"class":495}," Module.",[489,935,75],{"class":499},[489,937,557],{"class":495},[489,939,940],{"class":560},"\"\u002Fbeam_wallet\u002Fwallet.db\"",[489,942,943],{"class":495},",\n",[489,945,947,950],{"class":491,"line":946},5,[489,948,949],{"class":560},"                                                  \"123\"",[489,951,943],{"class":495},[489,953,955,958],{"class":491,"line":954},6,[489,956,957],{"class":560},"                                                  \"eu-node01.masternet.beam.mw:8200\"",[489,959,660],{"class":495},[489,961,963],{"class":491,"line":962},7,[489,964,965],{"class":495},"   }\n",[489,967,969],{"class":491,"line":968},8,[489,970,971],{"class":495}," }\n",[476,973,331],{"id":974},"createwallet",[480,976,978],{"className":482,"code":977,"language":484,"meta":485,"style":485},"WasmWalletClient.CreateWallet(seedPhrase : String, database : String, password : String)\n",[24,979,980],{"__ignoreMap":485},[489,981,982,984,986],{"class":491,"line":492},[489,983,496],{"class":495},[489,985,331],{"class":499},[489,987,988],{"class":495},"(seedPhrase : String, database : String, password : String)\n",[14,990,334],{},[506,992,594],{"id":993},"parameters-5",[29,995,996,1002,1008],{},[32,997,998,1001],{},[24,999,1000],{},"seedPhrase",": seed pharse for the wallet",[32,1003,1004,1007],{},[24,1005,1006],{},"database"," : path to the database in IndexedDB",[32,1009,1010,1013],{},[24,1011,1012],{},"password"," : password to the new wallet database",[506,1015,509],{"id":1016},"return-value-6",[29,1018,1019],{},[32,1020,850],{},[506,1022,757],{"id":1023},"notes-2",[29,1025,1026],{},[32,1027,1028,1029,1032],{},"Ensure that ",[24,1030,1031],{},"MountFS()"," has been called before",[506,1034,521],{"id":1035},"example-3",[480,1037,1039],{"className":482,"code":1038,"language":484,"meta":485,"style":485}," let phrase = Module.WasmWalletClient.GeneratePhrase();\n Module.WasmWalletClient.CreateWallet(phrase, \"\u002Fbeam_wallet\u002Fwallet.db\", \"123\");\n",[24,1040,1041,1057],{"__ignoreMap":485},[489,1042,1043,1046,1048,1050,1052,1054],{"class":491,"line":492},[489,1044,1045],{"class":531}," let",[489,1047,535],{"class":495},[489,1049,538],{"class":531},[489,1051,541],{"class":495},[489,1053,265],{"class":499},[489,1055,1056],{"class":495},"();\n",[489,1058,1059,1061,1063,1066,1068,1071,1074],{"class":491,"line":548},[489,1060,541],{"class":495},[489,1062,331],{"class":499},[489,1064,1065],{"class":495},"(phrase, ",[489,1067,940],{"class":560},[489,1069,1070],{"class":495},", ",[489,1072,1073],{"class":560},"\"123\"",[489,1075,660],{"class":495},[476,1077,342],{"id":1078},"deletewallet",[480,1080,1082],{"className":482,"code":1081,"language":484,"meta":485,"style":485},"WasmWalletClient.DeleteWallet(database : String)\n",[24,1083,1084],{"__ignoreMap":485},[489,1085,1086,1088,1090],{"class":491,"line":492},[489,1087,496],{"class":495},[489,1089,342],{"class":499},[489,1091,1092],{"class":495},"(database : String)\n",[14,1094,345],{},[506,1096,594],{"id":1097},"parameters-6",[29,1099,1100],{},[32,1101,1102,1104],{},[24,1103,1006],{}," : path to the database file",[506,1106,509],{"id":1107},"return-value-7",[29,1109,1110],{},[32,1111,850],{},[506,1113,757],{"id":1114},"notes-3",[29,1116,1117],{},[32,1118,1028,1119,1032],{},[24,1120,1031],{},[476,1122,353],{"id":1123},"isinitialized",[480,1125,1127],{"className":482,"code":1126,"language":484,"meta":485,"style":485},"WasmWalletClient.IsInitialized(database : String)\n",[24,1128,1129],{"__ignoreMap":485},[489,1130,1131,1133,1135],{"class":491,"line":492},[489,1132,496],{"class":495},[489,1134,353],{"class":499},[489,1136,1092],{"class":495},[14,1138,356],{},[506,1140,594],{"id":1141},"parameters-7",[29,1143,1144],{},[32,1145,1146,1148],{},[24,1147,1006],{}," : the path to the database",[506,1150,509],{"id":1151},"return-value-8",[29,1153,1154],{},[32,1155,1156,1158,1159],{},[24,1157,612],{}," if database is created and initialized, otherwise ",[24,1160,619],{},[506,1162,757],{"id":1163},"notes-4",[29,1165,1166],{},[32,1167,1028,1168,1032],{},[24,1169,1031],{},[476,1171,364],{"id":1172},"checkpassword",[480,1174,1176],{"className":482,"code":1175,"language":484,"meta":485,"style":485},"WasmWalletClient.CheckPassword(database : String, password : String, callback : function)\n",[24,1177,1178],{"__ignoreMap":485},[489,1179,1180,1182,1184,1187,1189],{"class":491,"line":492},[489,1181,496],{"class":495},[489,1183,364],{"class":499},[489,1185,1186],{"class":495},"(database : String, password : String, callback : ",[489,1188,826],{"class":531},[489,1190,829],{"class":495},[14,1192,1193],{},"Tests asynchronously if given password fits to the database",[506,1195,594],{"id":1196},"parameters-8",[29,1198,1199,1204,1209],{},[32,1200,1201,1203],{},[24,1202,1006],{}," : path to the database",[32,1205,1206,1208],{},[24,1207,1012],{}," : password to test",[32,1210,1211,1213],{},[24,1212,841],{}," : asynchronously returns the result of the test",[506,1215,509],{"id":1216},"return-value-9",[29,1218,1219],{},[32,1220,850],{},[506,1222,757],{"id":1223},"notes-5",[29,1225,1226],{},[32,1227,1028,1228,1032],{},[24,1229,1031],{},[506,1231,521],{"id":1232},"example-4",[480,1234,1236],{"className":482,"code":1235,"language":484,"meta":485,"style":485},"  Module.WasmWalletClient.CheckPassword(\"\u002Fbeam_wallet\u002Fwallet.db\", \"13\", (res) => {\n  if (res)\n    console.log(\"Password is correct\")\n  else\n    console.log(\"Password is not correct\")\n  })\n",[24,1237,1238,1269,1276,1290,1295,1308],{"__ignoreMap":485},[489,1239,1240,1243,1245,1247,1249,1251,1254,1257,1260,1263,1266],{"class":491,"line":492},[489,1241,1242],{"class":495},"  Module.WasmWalletClient.",[489,1244,364],{"class":499},[489,1246,557],{"class":495},[489,1248,940],{"class":560},[489,1250,1070],{"class":495},[489,1252,1253],{"class":560},"\"13\"",[489,1255,1256],{"class":495},", (",[489,1258,1259],{"class":881},"res",[489,1261,1262],{"class":495},") ",[489,1264,1265],{"class":531},"=>",[489,1267,1268],{"class":495}," {\n",[489,1270,1271,1273],{"class":491,"line":548},[489,1272,632],{"class":531},[489,1274,1275],{"class":495}," (res)\n",[489,1277,1278,1281,1283,1285,1288],{"class":491,"line":567},[489,1279,1280],{"class":495},"    console.",[489,1282,554],{"class":499},[489,1284,557],{"class":495},[489,1286,1287],{"class":560},"\"Password is correct\"",[489,1289,829],{"class":495},[489,1291,1292],{"class":491,"line":919},[489,1293,1294],{"class":531},"  else\n",[489,1296,1297,1299,1301,1303,1306],{"class":491,"line":946},[489,1298,1280],{"class":495},[489,1300,554],{"class":499},[489,1302,557],{"class":495},[489,1304,1305],{"class":560},"\"Password is not correct\"",[489,1307,829],{"class":495},[489,1309,1310],{"class":491,"line":954},[489,1311,1312],{"class":495},"  })\n",[476,1314,104],{"id":1315},"constructor",[480,1317,1319],{"className":482,"code":1318,"language":484,"meta":485,"style":485},"WasmWalletClient(database : String, password : String, nodeURL : String)\n",[24,1320,1321],{"__ignoreMap":485},[489,1322,1323,1325],{"class":491,"line":492},[489,1324,75],{"class":499},[489,1326,1327],{"class":495},"(database : String, password : String, nodeURL : String)\n",[14,1329,1330],{},"Creates new wallet client object",[506,1332,594],{"id":1333},"parameters-9",[29,1335,1336,1341,1346],{},[32,1337,1338,1340],{},[24,1339,1006],{}," : path to encrypted database in browser's IndexDB",[32,1342,1343,1345],{},[24,1344,1012],{}," : password to the database",[32,1347,1348,1351],{},[24,1349,1350],{},"nodeURL"," : URL to BEAM node to communicate with",[506,1353,509],{"id":1354},"return-value-10",[29,1356,1357],{},[32,1358,1359],{},"object of the wallet client",[506,1361,757],{"id":1362},"notes-6",[29,1364,1365,1371],{},[32,1366,1367,1368,1370],{},"wallet client can communicate with node over Web Sockets only, ensure that node located by ",[24,1369,1350],{}," has WebSocket proxy enabled",[32,1372,1373,1374,1032],{},"ensure that ",[24,1375,1031],{},[506,1377,521],{"id":1378},"example-5",[480,1380,1382],{"className":482,"code":1381,"language":484,"meta":485,"style":485}," var walletClient = new Module.WasmWalletClient(\"\u002Fbeam_wallet\u002Fwallet.db\",\n                                                \"123\",\n\n                                                \"eu-node01.masternet.beam.mw:8200\");\n",[24,1383,1384,1404,1411,1417],{"__ignoreMap":485},[489,1385,1386,1388,1390,1392,1394,1396,1398,1400,1402],{"class":491,"line":492},[489,1387,532],{"class":531},[489,1389,925],{"class":495},[489,1391,538],{"class":531},[489,1393,930],{"class":531},[489,1395,933],{"class":495},[489,1397,75],{"class":499},[489,1399,557],{"class":495},[489,1401,940],{"class":560},[489,1403,943],{"class":495},[489,1405,1406,1409],{"class":491,"line":548},[489,1407,1408],{"class":560},"                                                \"123\"",[489,1410,943],{"class":495},[489,1412,1413],{"class":491,"line":567},[489,1414,1416],{"emptyLinePlaceholder":1415},true,"\n",[489,1418,1419,1422],{"class":491,"line":919},[489,1420,1421],{"class":560},"                                                \"eu-node01.masternet.beam.mw:8200\"",[489,1423,660],{"class":495},[476,1425,115],{"id":1426},"headless-constructor",[480,1428,1430],{"className":482,"code":1429,"language":484,"meta":485,"style":485},"WasmWalletClient(nodeURL : String)\n",[24,1431,1432],{"__ignoreMap":485},[489,1433,1434,1436],{"class":491,"line":492},[489,1435,75],{"class":499},[489,1437,1438],{"class":495},"(nodeURL : String)\n",[14,1440,1441],{},"Creates new headless wallet client object. It doesn't have a master key. The wallet with such a database can communicate with the node, but cannot make transactions or detect any UTXO event. It can generate public keys, but they all are temporary and provided only for the reason to have viewer access to dapps",[506,1443,594],{"id":1444},"parameters-10",[29,1446,1447],{},[32,1448,1449,1351],{},[24,1450,1350],{},[506,1452,509],{"id":1453},"return-value-11",[29,1455,1456],{},[32,1457,1359],{},[506,1459,757],{"id":1460},"notes-7",[29,1462,1463,1467],{},[32,1464,1367,1465,1370],{},[24,1466,1350],{},[32,1468,1469,1470,1472],{},"headless wallet doesn't require ",[24,1471,1031],{}," to be called before",[506,1474,521],{"id":1475},"example-6",[480,1477,1479],{"className":482,"code":1478,"language":484,"meta":485,"style":485}," var walletClient = new Module.WasmWalletClient(\"eu-node01.masternet.beam.mw:8200\");\n",[24,1480,1481],{"__ignoreMap":485},[489,1482,1483,1485,1487,1489,1491,1493,1495,1497,1500],{"class":491,"line":492},[489,1484,532],{"class":531},[489,1486,925],{"class":495},[489,1488,538],{"class":531},[489,1490,930],{"class":531},[489,1492,933],{"class":495},[489,1494,75],{"class":499},[489,1496,557],{"class":495},[489,1498,1499],{"class":560},"\"eu-node01.masternet.beam.mw:8200\"",[489,1501,660],{"class":495},[476,1503,126],{"id":1504},"startwallet",[480,1506,1508],{"className":482,"code":1507,"language":484,"meta":485,"style":485},"function startWallet()\n",[24,1509,1510],{"__ignoreMap":485},[489,1511,1512,1514,1517],{"class":491,"line":492},[489,1513,826],{"class":531},[489,1515,1516],{"class":499}," startWallet",[489,1518,502],{"class":495},[14,1520,129],{},[506,1522,757],{"id":1523},"notes-8",[29,1525,1526],{},[32,1527,1367,1528,1370],{},[24,1529,1350],{},[476,1531,137],{"id":1532},"stopwallet",[480,1534,1536],{"className":482,"code":1535,"language":484,"meta":485,"style":485},"function stopWallet(callback : function)\n",[24,1537,1538],{"__ignoreMap":485},[489,1539,1540,1542,1545,1547,1549,1552,1555],{"class":491,"line":492},[489,1541,826],{"class":531},[489,1543,1544],{"class":499}," stopWallet",[489,1546,557],{"class":495},[489,1548,841],{"class":881},[489,1550,1551],{"class":531}," :",[489,1553,1554],{"class":499}," function",[489,1556,829],{"class":495},[14,1558,140],{},[506,1560,594],{"id":1561},"parameters-11",[29,1563,1564],{},[32,1565,1566,1568],{},[24,1567,841],{}," : calls when wallet has stopped. In this callback it is safe to delete the wallet database",[506,1570,509],{"id":1571},"return-value-12",[29,1573,1574],{},[32,1575,850],{},[506,1577,521],{"id":1578},"example-7",[480,1580,1582],{"className":482,"code":1581,"language":484,"meta":485,"style":485},"  wc.stopWallet(()=> {\n    console.log(\"is running: \" + wc.isRunning()) \u002F\u002F false\n  }\n",[24,1583,1584,1598,1623],{"__ignoreMap":485},[489,1585,1586,1589,1591,1594,1596],{"class":491,"line":492},[489,1587,1588],{"class":495},"  wc.",[489,1590,137],{"class":499},[489,1592,1593],{"class":495},"(()",[489,1595,1265],{"class":531},[489,1597,1268],{"class":495},[489,1599,1600,1602,1604,1606,1609,1612,1615,1617,1620],{"class":491,"line":548},[489,1601,1280],{"class":495},[489,1603,554],{"class":499},[489,1605,557],{"class":495},[489,1607,1608],{"class":560},"\"is running: \"",[489,1610,1611],{"class":531}," +",[489,1613,1614],{"class":495}," wc.",[489,1616,148],{"class":499},[489,1618,1619],{"class":495},"()) ",[489,1621,1622],{"class":570},"\u002F\u002F false\n",[489,1624,1625],{"class":491,"line":567},[489,1626,665],{"class":495},[476,1628,148],{"id":1629},"isrunning",[480,1631,1633],{"className":482,"code":1632,"language":484,"meta":485,"style":485},"function isRunning()\n",[24,1634,1635],{"__ignoreMap":485},[489,1636,1637,1639,1642],{"class":491,"line":492},[489,1638,826],{"class":531},[489,1640,1641],{"class":499}," isRunning",[489,1643,502],{"class":495},[14,1645,151],{},[506,1647,594],{"id":1648},"parameters-12",[29,1650,1651],{},[32,1652,850],{},[506,1654,509],{"id":1655},"return-value-13",[29,1657,1658],{},[32,1659,1660,1662,1663,1665],{},[24,1661,612],{}," if the wallet is running, ",[24,1664,619],{}," otherwise",[476,1667,159],{"id":1668},"isheadless",[480,1670,1672],{"className":482,"code":1671,"language":484,"meta":485,"style":485},"function isHeadless()\n",[24,1673,1674],{"__ignoreMap":485},[489,1675,1676,1678,1681],{"class":491,"line":492},[489,1677,826],{"class":531},[489,1679,1680],{"class":499}," isHeadless",[489,1682,502],{"class":495},[14,1684,162,1685,166],{},[24,1686,165],{},[506,1688,594],{"id":1689},"parameters-13",[29,1691,1692],{},[32,1693,850],{},[506,1695,509],{"id":1696},"return-value-14",[29,1698,1699],{},[32,1700,1701,1703,1704,1665],{},[24,1702,612],{}," if the wallet is headless, ",[24,1705,619],{},[476,1707,174],{"id":1708},"sendrequest",[480,1710,1712],{"className":482,"code":1711,"language":484,"meta":485,"style":485},"function sendRequest(jsonRequest : String)\n",[24,1713,1714],{"__ignoreMap":485},[489,1715,1716,1718,1721,1723,1726,1728,1731],{"class":491,"line":492},[489,1717,826],{"class":531},[489,1719,1720],{"class":499}," sendRequest",[489,1722,557],{"class":495},[489,1724,1725],{"class":881},"jsonRequest",[489,1727,1551],{"class":531},[489,1729,1730],{"class":499}," String",[489,1732,829],{"class":495},[14,1734,177,1735,180],{},[18,1736,64],{"href":20},[506,1738,594],{"id":1739},"parameters-14",[29,1741,1742],{},[32,1743,1744,1746],{},[24,1745,1725],{}," : API request",[506,1748,509],{"id":1749},"return-value-15",[29,1751,1752],{},[32,1753,850],{},[506,1755,757],{"id":1756},"notes-9",[29,1758,1759],{},[32,1760,1761,1762,1764],{},"to get response you have to ",[18,1763,188],{"href":187}," before",[506,1766,521],{"id":1767},"example-8",[480,1769,1771],{"className":482,"code":1770,"language":484,"meta":485,"style":485}," walletClient.sendRequest(JSON.stringify({\n     jsonrpc: '2.0',\n     id: 5,\n     method: 'wallet_status'\n }));\n",[24,1772,1773,1794,1804,1814,1822],{"__ignoreMap":485},[489,1774,1775,1778,1780,1782,1785,1788,1791],{"class":491,"line":492},[489,1776,1777],{"class":495}," walletClient.",[489,1779,174],{"class":499},[489,1781,557],{"class":495},[489,1783,1784],{"class":899},"JSON",[489,1786,1787],{"class":495},".",[489,1789,1790],{"class":499},"stringify",[489,1792,1793],{"class":495},"({\n",[489,1795,1796,1799,1802],{"class":491,"line":548},[489,1797,1798],{"class":495},"     jsonrpc: ",[489,1800,1801],{"class":560},"'2.0'",[489,1803,943],{"class":495},[489,1805,1806,1809,1812],{"class":491,"line":567},[489,1807,1808],{"class":495},"     id: ",[489,1810,1811],{"class":899},"5",[489,1813,943],{"class":495},[489,1815,1816,1819],{"class":491,"line":919},[489,1817,1818],{"class":495},"     method: ",[489,1820,1821],{"class":560},"'wallet_status'\n",[489,1823,1824],{"class":491,"line":946},[489,1825,1826],{"class":495}," }));\n",[476,1828,188],{"id":188},[480,1830,1832],{"className":482,"code":1831,"language":484,"meta":485,"style":485},"function subscribe(callback : function)\n",[24,1833,1834],{"__ignoreMap":485},[489,1835,1836,1838,1841,1843,1845,1847,1849],{"class":491,"line":492},[489,1837,826],{"class":531},[489,1839,1840],{"class":499}," subscribe",[489,1842,557],{"class":495},[489,1844,841],{"class":881},[489,1846,1551],{"class":531},[489,1848,1554],{"class":499},[489,1850,829],{"class":495},[14,1852,191],{},[506,1854,594],{"id":1855},"parameters-15",[29,1857,1858],{},[32,1859,1860,1862],{},[24,1861,841],{}," : function which is called when response arrived",[506,1864,509],{"id":1865},"return-value-16",[29,1867,1868],{},[32,1869,1870],{},"index of the subscription",[506,1872,521],{"id":1873},"example-9",[480,1875,1877],{"className":482,"code":1876,"language":484,"meta":485,"style":485},"  var i = walletClient.subscribe((r)=> {\n      console.log(\"response: \" + r)\n  });\n",[24,1878,1879,1906,1922],{"__ignoreMap":485},[489,1880,1881,1884,1887,1889,1891,1893,1896,1899,1902,1904],{"class":491,"line":492},[489,1882,1883],{"class":531},"  var",[489,1885,1886],{"class":495}," i ",[489,1888,538],{"class":531},[489,1890,1777],{"class":495},[489,1892,188],{"class":499},[489,1894,1895],{"class":495},"((",[489,1897,1898],{"class":881},"r",[489,1900,1901],{"class":495},")",[489,1903,1265],{"class":531},[489,1905,1268],{"class":495},[489,1907,1908,1910,1912,1914,1917,1919],{"class":491,"line":548},[489,1909,650],{"class":495},[489,1911,554],{"class":499},[489,1913,557],{"class":495},[489,1915,1916],{"class":560},"\"response: \"",[489,1918,1611],{"class":531},[489,1920,1921],{"class":495}," r)\n",[489,1923,1924],{"class":491,"line":567},[489,1925,1926],{"class":495},"  });\n",[476,1928,199],{"id":199},[480,1930,1932],{"className":482,"code":1931,"language":484,"meta":485,"style":485},"function unsubscribe(index : Number)\n",[24,1933,1934],{"__ignoreMap":485},[489,1935,1936,1938,1941,1943,1946,1948,1951],{"class":491,"line":492},[489,1937,826],{"class":531},[489,1939,1940],{"class":499}," unsubscribe",[489,1942,557],{"class":495},[489,1944,1945],{"class":881},"index",[489,1947,1551],{"class":531},[489,1949,1950],{"class":499}," Number",[489,1952,829],{"class":495},[14,1954,202],{},[506,1956,594],{"id":1957},"parameters-16",[29,1959,1960],{},[32,1961,1962,1964],{},[24,1963,1945],{}," : index of the subscription",[506,1966,509],{"id":1967},"return-value-17",[29,1969,1970],{},[32,1971,850],{},[476,1973,210],{"id":1974},"setsynchandler",[480,1976,1978],{"className":482,"code":1977,"language":484,"meta":485,"style":485},"function setSyncHandler(handler : function)\n",[24,1979,1980],{"__ignoreMap":485},[489,1981,1982,1984,1987,1989,1992,1994,1996],{"class":491,"line":492},[489,1983,826],{"class":531},[489,1985,1986],{"class":499}," setSyncHandler",[489,1988,557],{"class":495},[489,1990,1991],{"class":881},"handler",[489,1993,1551],{"class":531},[489,1995,1554],{"class":499},[489,1997,829],{"class":495},[14,1999,213],{},[506,2001,594],{"id":2002},"parameters-17",[29,2004,2005],{},[32,2006,2007,2009],{},[24,2008,1991],{}," : called each time wallet notifies about sync progress",[506,2011,509],{"id":2012},"return-value-18",[29,2014,2015],{},[32,2016,850],{},[506,2018,521],{"id":2019},"example-10",[480,2021,2023],{"className":482,"code":2022,"language":484,"meta":485,"style":485}," walletClient.setSyncHandler((done, total) => {\n    console.log(\"sync [\" + done + \"\u002F\" + total + \"]\");\n });\n",[24,2024,2025,2047,2081],{"__ignoreMap":485},[489,2026,2027,2029,2031,2033,2036,2038,2041,2043,2045],{"class":491,"line":492},[489,2028,1777],{"class":495},[489,2030,210],{"class":499},[489,2032,1895],{"class":495},[489,2034,2035],{"class":881},"done",[489,2037,1070],{"class":495},[489,2039,2040],{"class":881},"total",[489,2042,1262],{"class":495},[489,2044,1265],{"class":531},[489,2046,1268],{"class":495},[489,2048,2049,2051,2053,2055,2058,2060,2063,2066,2069,2071,2074,2076,2079],{"class":491,"line":548},[489,2050,1280],{"class":495},[489,2052,554],{"class":499},[489,2054,557],{"class":495},[489,2056,2057],{"class":560},"\"sync [\"",[489,2059,1611],{"class":531},[489,2061,2062],{"class":495}," done ",[489,2064,2065],{"class":531},"+",[489,2067,2068],{"class":560}," \"\u002F\"",[489,2070,1611],{"class":531},[489,2072,2073],{"class":495}," total ",[489,2075,2065],{"class":531},[489,2077,2078],{"class":560}," \"]\"",[489,2080,660],{"class":495},[489,2082,2083],{"class":491,"line":567},[489,2084,2085],{"class":495}," });\n",[476,2087,221],{"id":2088},"setapprovesendhandler",[480,2090,2092],{"className":482,"code":2091,"language":484,"meta":485,"style":485},"function setApproveSendHandler(handler : function)\n",[24,2093,2094],{"__ignoreMap":485},[489,2095,2096,2098,2101,2103,2105,2107,2109],{"class":491,"line":492},[489,2097,826],{"class":531},[489,2099,2100],{"class":499}," setApproveSendHandler",[489,2102,557],{"class":495},[489,2104,1991],{"class":881},[489,2106,1551],{"class":531},[489,2108,1554],{"class":499},[489,2110,829],{"class":495},[14,2112,224],{},[506,2114,594],{"id":2115},"parameters-18",[29,2117,2118],{},[32,2119,2120,2122],{},[24,2121,1991],{}," : function called each time application wants to send assets from the wallet",[506,2124,509],{"id":2125},"return-value-19",[29,2127,2128],{},[32,2129,850],{},[506,2131,521],{"id":2132},"example-11",[480,2134,2136],{"className":482,"code":2135,"language":484,"meta":485,"style":485}," walletClient.setApproveSendHandler((request, info, cb)=>{\n     console.log(\"Request: \" + request);\n     console.log(\"Info: \" + info);\n     cb.sendApproved(request);\n     \u002F\u002Fcb.sendRejected(request);\n }) \n",[24,2137,2138,2166,2182,2198,2208,2213],{"__ignoreMap":485},[489,2139,2140,2142,2144,2146,2149,2151,2154,2156,2159,2161,2163],{"class":491,"line":492},[489,2141,1777],{"class":495},[489,2143,221],{"class":499},[489,2145,1895],{"class":495},[489,2147,2148],{"class":881},"request",[489,2150,1070],{"class":495},[489,2152,2153],{"class":881},"info",[489,2155,1070],{"class":495},[489,2157,2158],{"class":881},"cb",[489,2160,1901],{"class":495},[489,2162,1265],{"class":531},[489,2164,2165],{"class":495},"{\n",[489,2167,2168,2170,2172,2174,2177,2179],{"class":491,"line":548},[489,2169,907],{"class":495},[489,2171,554],{"class":499},[489,2173,557],{"class":495},[489,2175,2176],{"class":560},"\"Request: \"",[489,2178,1611],{"class":531},[489,2180,2181],{"class":495}," request);\n",[489,2183,2184,2186,2188,2190,2193,2195],{"class":491,"line":567},[489,2185,907],{"class":495},[489,2187,554],{"class":499},[489,2189,557],{"class":495},[489,2191,2192],{"class":560},"\"Info: \"",[489,2194,1611],{"class":531},[489,2196,2197],{"class":495}," info);\n",[489,2199,2200,2203,2205],{"class":491,"line":919},[489,2201,2202],{"class":495},"     cb.",[489,2204,435],{"class":499},[489,2206,2207],{"class":495},"(request);\n",[489,2209,2210],{"class":491,"line":946},[489,2211,2212],{"class":570},"     \u002F\u002Fcb.sendRejected(request);\n",[489,2214,2215],{"class":491,"line":954},[489,2216,2217],{"class":495}," })\n",[476,2219,232],{"id":2220},"setapprovecontractinfohandler",[480,2222,2224],{"className":482,"code":2223,"language":484,"meta":485,"style":485},"function setApproveContractInfoHandler(handler : function)\n",[24,2225,2226],{"__ignoreMap":485},[489,2227,2228,2230,2233,2235,2237,2239,2241],{"class":491,"line":492},[489,2229,826],{"class":531},[489,2231,2232],{"class":499}," setApproveContractInfoHandler",[489,2234,557],{"class":495},[489,2236,1991],{"class":881},[489,2238,1551],{"class":531},[489,2240,1554],{"class":499},[489,2242,829],{"class":495},[14,2244,235],{},[506,2246,594],{"id":2247},"parameters-19",[29,2249,2250],{},[32,2251,2252],{},[24,2253,1991],{},[506,2255,509],{"id":2256},"return-value-20",[29,2258,2259],{},[32,2260,850],{},[506,2262,521],{"id":2263},"example-12",[480,2265,2267],{"className":482,"code":2266,"language":484,"meta":485,"style":485}," walletClient.setApproveContractInfoHandler((request, info, amounts, cb)=>{\n     console.log(\"Request: \" + request);\n     console.log(\"Info: \" + info);\n     cb.contractInfoApproved(request);\n     \u002F\u002Fcb.contractInfoRejected(request);\n }) \n",[24,2268,2269,2298,2312,2326,2334,2339],{"__ignoreMap":485},[489,2270,2271,2273,2275,2277,2279,2281,2283,2285,2288,2290,2292,2294,2296],{"class":491,"line":492},[489,2272,1777],{"class":495},[489,2274,232],{"class":499},[489,2276,1895],{"class":495},[489,2278,2148],{"class":881},[489,2280,1070],{"class":495},[489,2282,2153],{"class":881},[489,2284,1070],{"class":495},[489,2286,2287],{"class":881},"amounts",[489,2289,1070],{"class":495},[489,2291,2158],{"class":881},[489,2293,1901],{"class":495},[489,2295,1265],{"class":531},[489,2297,2165],{"class":495},[489,2299,2300,2302,2304,2306,2308,2310],{"class":491,"line":548},[489,2301,907],{"class":495},[489,2303,554],{"class":499},[489,2305,557],{"class":495},[489,2307,2176],{"class":560},[489,2309,1611],{"class":531},[489,2311,2181],{"class":495},[489,2313,2314,2316,2318,2320,2322,2324],{"class":491,"line":567},[489,2315,907],{"class":495},[489,2317,554],{"class":499},[489,2319,557],{"class":495},[489,2321,2192],{"class":560},[489,2323,1611],{"class":531},[489,2325,2197],{"class":495},[489,2327,2328,2330,2332],{"class":491,"line":919},[489,2329,2202],{"class":495},[489,2331,457],{"class":499},[489,2333,2207],{"class":495},[489,2335,2336],{"class":491,"line":946},[489,2337,2338],{"class":570},"     \u002F\u002Fcb.contractInfoRejected(request);\n",[489,2340,2341],{"class":491,"line":954},[489,2342,2217],{"class":495},[476,2344,243],{"id":2345},"createappapi",[480,2347,2349],{"className":482,"code":2348,"language":484,"meta":485,"style":485},"function createAppAPI(appid : String, appname : String, callback : function)\n",[24,2350,2351],{"__ignoreMap":485},[489,2352,2353,2355,2358,2360,2363,2365,2367,2369,2372,2374,2376,2378,2380,2382,2384],{"class":491,"line":492},[489,2354,826],{"class":531},[489,2356,2357],{"class":499}," createAppAPI",[489,2359,557],{"class":495},[489,2361,2362],{"class":881},"appid",[489,2364,1551],{"class":531},[489,2366,1730],{"class":499},[489,2368,1070],{"class":495},[489,2370,2371],{"class":881},"appname",[489,2373,1551],{"class":531},[489,2375,1730],{"class":499},[489,2377,1070],{"class":495},[489,2379,841],{"class":881},[489,2381,1551],{"class":531},[489,2383,1554],{"class":499},[489,2385,829],{"class":495},[14,2387,246],{},[506,2389,594],{"id":2390},"parameters-20",[29,2392,2393,2398,2403],{},[32,2394,2395,2397],{},[24,2396,2362],{}," : ID of the application",[32,2399,2400,2402],{},[24,2401,2371],{}," : the name of the app",[32,2404,2405,2407],{},[24,2406,841],{}," : the callback with API object in the case of success",[506,2409,521],{"id":2410},"example-13",[480,2412,2414],{"className":482,"code":2413,"language":484,"meta":485,"style":485}," console.log(\"calling API...\");\n wc.createAppAPI(\"appid\", \"appname\", (api)=>{\n    api.setHandler((r)=> {\n       console.log(\"API response: \" + r)\n    })\n    api.callWalletApi(JSON.stringify({\n       jsonrpc: '2.0',\n        id: 5,\n        method: 'wallet_status'\n    }));        \n });\n",[24,2415,2416,2429,2455,2472,2488,2493,2509,2518,2527,2535,2541],{"__ignoreMap":485},[489,2417,2418,2420,2422,2424,2427],{"class":491,"line":492},[489,2419,551],{"class":495},[489,2421,554],{"class":499},[489,2423,557],{"class":495},[489,2425,2426],{"class":560},"\"calling API...\"",[489,2428,660],{"class":495},[489,2430,2431,2433,2435,2437,2440,2442,2445,2447,2449,2451,2453],{"class":491,"line":548},[489,2432,1614],{"class":495},[489,2434,243],{"class":499},[489,2436,557],{"class":495},[489,2438,2439],{"class":560},"\"appid\"",[489,2441,1070],{"class":495},[489,2443,2444],{"class":560},"\"appname\"",[489,2446,1256],{"class":495},[489,2448,63],{"class":881},[489,2450,1901],{"class":495},[489,2452,1265],{"class":531},[489,2454,2165],{"class":495},[489,2456,2457,2460,2462,2464,2466,2468,2470],{"class":491,"line":567},[489,2458,2459],{"class":495},"    api.",[489,2461,405],{"class":499},[489,2463,1895],{"class":495},[489,2465,1898],{"class":881},[489,2467,1901],{"class":495},[489,2469,1265],{"class":531},[489,2471,1268],{"class":495},[489,2473,2474,2477,2479,2481,2484,2486],{"class":491,"line":919},[489,2475,2476],{"class":495},"       console.",[489,2478,554],{"class":499},[489,2480,557],{"class":495},[489,2482,2483],{"class":560},"\"API response: \"",[489,2485,1611],{"class":531},[489,2487,1921],{"class":495},[489,2489,2490],{"class":491,"line":946},[489,2491,2492],{"class":495},"    })\n",[489,2494,2495,2497,2499,2501,2503,2505,2507],{"class":491,"line":954},[489,2496,2459],{"class":495},[489,2498,394],{"class":499},[489,2500,557],{"class":495},[489,2502,1784],{"class":899},[489,2504,1787],{"class":495},[489,2506,1790],{"class":499},[489,2508,1793],{"class":495},[489,2510,2511,2514,2516],{"class":491,"line":962},[489,2512,2513],{"class":495},"       jsonrpc: ",[489,2515,1801],{"class":560},[489,2517,943],{"class":495},[489,2519,2520,2523,2525],{"class":491,"line":968},[489,2521,2522],{"class":495},"        id: ",[489,2524,1811],{"class":899},[489,2526,943],{"class":495},[489,2528,2530,2533],{"class":491,"line":2529},9,[489,2531,2532],{"class":495},"        method: ",[489,2534,1821],{"class":560},[489,2536,2538],{"class":491,"line":2537},10,[489,2539,2540],{"class":495},"    }));        \n",[489,2542,2544],{"class":491,"line":2543},11,[489,2545,2085],{"class":495},[476,2547,254],{"id":2548},"importrecovery",[480,2550,2552],{"className":482,"code":2551,"language":484,"meta":485,"style":485},"function importRecovery(recoveryData: Uint8Array, callback: function(error, done, total))\n",[24,2553,2554],{"__ignoreMap":485},[489,2555,2556,2558,2561,2563,2566,2569,2572,2574,2576,2578,2580,2582,2584,2586,2588,2590,2592],{"class":491,"line":492},[489,2557,826],{"class":531},[489,2559,2560],{"class":499}," importRecovery",[489,2562,557],{"class":495},[489,2564,2565],{"class":881},"recoveryData",[489,2567,2568],{"class":531},":",[489,2570,2571],{"class":499}," Uint8Array",[489,2573,1070],{"class":495},[489,2575,841],{"class":881},[489,2577,2568],{"class":531},[489,2579,1554],{"class":499},[489,2581,557],{"class":495},[489,2583,882],{"class":881},[489,2585,1070],{"class":495},[489,2587,2035],{"class":881},[489,2589,1070],{"class":495},[489,2591,2040],{"class":881},[489,2593,2594],{"class":495},"))\n",[14,2596,257],{},[506,2598,594],{"id":2599},"parameters-21",[29,2601,2602,2607],{},[32,2603,2604,2606],{},[24,2605,2565],{}," : downloaded recovery data",[32,2608,2609,2611,2612,2614,2615,2617,2618],{},[24,2610,841],{}," : callback function, which allows to handle errors via ",[24,2613,882],{}," parameter and to report progress using ",[24,2616,2035],{}," and ",[24,2619,2040],{},[506,2621,521],{"id":2622},"example-14",[480,2624,2626],{"className":482,"code":2625,"language":484,"meta":485,"style":485}," \u002F\u002F download function should be defined by user\n download(\"recovery.bin\", function(error, data) {\n    if (error == null) {\n        console.log(\"downloaded recovery\")\n        walletClient.importRecovery(data, function(error, done, total) {\n            if (error == null) {\n                console.log(`Restoring ${done}\u002F${total}`)\n            } else {\n                console.log(`Failed to recover: ${error}`)\n            }\n        });\n        \n    } else {\n        console.log(\"failed to download recovery\")\n    }\n\n});\n",[24,2627,2628,2633,2658,2672,2686,2712,2725,2749,2759,2776,2781,2786,2792,2802,2816,2822,2827],{"__ignoreMap":485},[489,2629,2630],{"class":491,"line":492},[489,2631,2632],{"class":570}," \u002F\u002F download function should be defined by user\n",[489,2634,2635,2638,2640,2643,2645,2647,2649,2651,2653,2656],{"class":491,"line":548},[489,2636,2637],{"class":499}," download",[489,2639,557],{"class":495},[489,2641,2642],{"class":560},"\"recovery.bin\"",[489,2644,1070],{"class":495},[489,2646,826],{"class":531},[489,2648,557],{"class":495},[489,2650,882],{"class":881},[489,2652,1070],{"class":495},[489,2654,2655],{"class":881},"data",[489,2657,885],{"class":495},[489,2659,2660,2663,2665,2668,2670],{"class":491,"line":567},[489,2661,2662],{"class":531},"    if",[489,2664,893],{"class":495},[489,2666,2667],{"class":531},"==",[489,2669,900],{"class":899},[489,2671,885],{"class":495},[489,2673,2674,2677,2679,2681,2684],{"class":491,"line":919},[489,2675,2676],{"class":495},"        console.",[489,2678,554],{"class":499},[489,2680,557],{"class":495},[489,2682,2683],{"class":560},"\"downloaded recovery\"",[489,2685,829],{"class":495},[489,2687,2688,2691,2693,2696,2698,2700,2702,2704,2706,2708,2710],{"class":491,"line":946},[489,2689,2690],{"class":495},"        walletClient.",[489,2692,254],{"class":499},[489,2694,2695],{"class":495},"(data, ",[489,2697,826],{"class":531},[489,2699,557],{"class":495},[489,2701,882],{"class":881},[489,2703,1070],{"class":495},[489,2705,2035],{"class":881},[489,2707,1070],{"class":495},[489,2709,2040],{"class":881},[489,2711,885],{"class":495},[489,2713,2714,2717,2719,2721,2723],{"class":491,"line":954},[489,2715,2716],{"class":531},"            if",[489,2718,893],{"class":495},[489,2720,2667],{"class":531},[489,2722,900],{"class":899},[489,2724,885],{"class":495},[489,2726,2727,2730,2732,2734,2737,2739,2742,2744,2747],{"class":491,"line":962},[489,2728,2729],{"class":495},"                console.",[489,2731,554],{"class":499},[489,2733,557],{"class":495},[489,2735,2736],{"class":560},"`Restoring ${",[489,2738,2035],{"class":495},[489,2740,2741],{"class":560},"}\u002F${",[489,2743,2040],{"class":495},[489,2745,2746],{"class":560},"}`",[489,2748,829],{"class":495},[489,2750,2751,2754,2757],{"class":491,"line":968},[489,2752,2753],{"class":495},"            } ",[489,2755,2756],{"class":531},"else",[489,2758,1268],{"class":495},[489,2760,2761,2763,2765,2767,2770,2772,2774],{"class":491,"line":2529},[489,2762,2729],{"class":495},[489,2764,554],{"class":499},[489,2766,557],{"class":495},[489,2768,2769],{"class":560},"`Failed to recover: ${",[489,2771,882],{"class":495},[489,2773,2746],{"class":560},[489,2775,829],{"class":495},[489,2777,2778],{"class":491,"line":2537},[489,2779,2780],{"class":495},"            }\n",[489,2782,2783],{"class":491,"line":2543},[489,2784,2785],{"class":495},"        });\n",[489,2787,2789],{"class":491,"line":2788},12,[489,2790,2791],{"class":495},"        \n",[489,2793,2795,2798,2800],{"class":491,"line":2794},13,[489,2796,2797],{"class":495},"    } ",[489,2799,2756],{"class":531},[489,2801,1268],{"class":495},[489,2803,2805,2807,2809,2811,2814],{"class":491,"line":2804},14,[489,2806,2676],{"class":495},[489,2808,554],{"class":499},[489,2810,557],{"class":495},[489,2812,2813],{"class":560},"\"failed to download recovery\"",[489,2815,829],{"class":495},[489,2817,2819],{"class":491,"line":2818},15,[489,2820,2821],{"class":495},"    }\n",[489,2823,2825],{"class":491,"line":2824},16,[489,2826,1416],{"emptyLinePlaceholder":1415},[489,2828,2830],{"class":491,"line":2829},17,[489,2831,2832],{"class":495},"});\n",[10,2834,373],{"id":2835},"appapi",[476,2837,394],{"id":2838},"callwalletapi",[476,2840,405],{"id":2841},"sethandler",[10,2843,414],{"id":2844},"appapicallback",[476,2846,435],{"id":2847},"sendapproved",[476,2849,446],{"id":2850},"sendrejected",[476,2852,457],{"id":2853},"contractinfoapproved",[476,2855,468],{"id":2856},"contractinforejected",[2858,2859,2860],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}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 pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":485,"searchDepth":548,"depth":548,"links":2862},[2863,2867,2872,2876,2881,2885,2891,2897,2902,2907,2913,2919,2925,2928,2933,2937,2941,2947,2952,2956,2961,2966,2971,2975,2979,2980,2981,2982,2983,2984],{"id":478,"depth":548,"text":265,"children":2864},[2865,2866],{"id":508,"depth":567,"text":509},{"id":520,"depth":567,"text":521},{"id":574,"depth":548,"text":276,"children":2868},[2869,2870,2871],{"id":593,"depth":567,"text":594},{"id":605,"depth":567,"text":509},{"id":622,"depth":567,"text":521},{"id":668,"depth":548,"text":287,"children":2873},[2874,2875],{"id":691,"depth":567,"text":594},{"id":703,"depth":567,"text":509},{"id":718,"depth":548,"text":298,"children":2877},[2878,2879,2880],{"id":737,"depth":567,"text":594},{"id":748,"depth":567,"text":509},{"id":756,"depth":567,"text":757},{"id":769,"depth":548,"text":309,"children":2882},[2883,2884],{"id":788,"depth":567,"text":594},{"id":799,"depth":567,"text":509},{"id":809,"depth":548,"text":320,"children":2886},[2887,2888,2889,2890],{"id":834,"depth":567,"text":594},{"id":845,"depth":567,"text":509},{"id":853,"depth":567,"text":757},{"id":861,"depth":567,"text":521},{"id":974,"depth":548,"text":331,"children":2892},[2893,2894,2895,2896],{"id":993,"depth":567,"text":594},{"id":1016,"depth":567,"text":509},{"id":1023,"depth":567,"text":757},{"id":1035,"depth":567,"text":521},{"id":1078,"depth":548,"text":342,"children":2898},[2899,2900,2901],{"id":1097,"depth":567,"text":594},{"id":1107,"depth":567,"text":509},{"id":1114,"depth":567,"text":757},{"id":1123,"depth":548,"text":353,"children":2903},[2904,2905,2906],{"id":1141,"depth":567,"text":594},{"id":1151,"depth":567,"text":509},{"id":1163,"depth":567,"text":757},{"id":1172,"depth":548,"text":364,"children":2908},[2909,2910,2911,2912],{"id":1196,"depth":567,"text":594},{"id":1216,"depth":567,"text":509},{"id":1223,"depth":567,"text":757},{"id":1232,"depth":567,"text":521},{"id":1315,"depth":548,"text":104,"children":2914},[2915,2916,2917,2918],{"id":1333,"depth":567,"text":594},{"id":1354,"depth":567,"text":509},{"id":1362,"depth":567,"text":757},{"id":1378,"depth":567,"text":521},{"id":1426,"depth":548,"text":115,"children":2920},[2921,2922,2923,2924],{"id":1444,"depth":567,"text":594},{"id":1453,"depth":567,"text":509},{"id":1460,"depth":567,"text":757},{"id":1475,"depth":567,"text":521},{"id":1504,"depth":548,"text":126,"children":2926},[2927],{"id":1523,"depth":567,"text":757},{"id":1532,"depth":548,"text":137,"children":2929},[2930,2931,2932],{"id":1561,"depth":567,"text":594},{"id":1571,"depth":567,"text":509},{"id":1578,"depth":567,"text":521},{"id":1629,"depth":548,"text":148,"children":2934},[2935,2936],{"id":1648,"depth":567,"text":594},{"id":1655,"depth":567,"text":509},{"id":1668,"depth":548,"text":159,"children":2938},[2939,2940],{"id":1689,"depth":567,"text":594},{"id":1696,"depth":567,"text":509},{"id":1708,"depth":548,"text":174,"children":2942},[2943,2944,2945,2946],{"id":1739,"depth":567,"text":594},{"id":1749,"depth":567,"text":509},{"id":1756,"depth":567,"text":757},{"id":1767,"depth":567,"text":521},{"id":188,"depth":548,"text":188,"children":2948},[2949,2950,2951],{"id":1855,"depth":567,"text":594},{"id":1865,"depth":567,"text":509},{"id":1873,"depth":567,"text":521},{"id":199,"depth":548,"text":199,"children":2953},[2954,2955],{"id":1957,"depth":567,"text":594},{"id":1967,"depth":567,"text":509},{"id":1974,"depth":548,"text":210,"children":2957},[2958,2959,2960],{"id":2002,"depth":567,"text":594},{"id":2012,"depth":567,"text":509},{"id":2019,"depth":567,"text":521},{"id":2088,"depth":548,"text":221,"children":2962},[2963,2964,2965],{"id":2115,"depth":567,"text":594},{"id":2125,"depth":567,"text":509},{"id":2132,"depth":567,"text":521},{"id":2220,"depth":548,"text":232,"children":2967},[2968,2969,2970],{"id":2247,"depth":567,"text":594},{"id":2256,"depth":567,"text":509},{"id":2263,"depth":567,"text":521},{"id":2345,"depth":548,"text":243,"children":2972},[2973,2974],{"id":2390,"depth":567,"text":594},{"id":2410,"depth":567,"text":521},{"id":2548,"depth":548,"text":254,"children":2976},[2977,2978],{"id":2599,"depth":567,"text":594},{"id":2622,"depth":567,"text":521},{"id":2838,"depth":548,"text":394},{"id":2841,"depth":548,"text":405},{"id":2847,"depth":548,"text":435},{"id":2850,"depth":548,"text":446},{"id":2853,"depth":548,"text":457},{"id":2856,"depth":548,"text":468},"WASM wallet client is a thin wrapper around Beam client library build into WASM using Emscripten toolchain. This wrapper allows to run BEAM wallet inside any browser supporting WebAssembly and it provides the regular BEAM wallet API to communicated with it from external(javascript) code. It's available via npm for different network types:","md",null,{},"\u002Fdocs\u002Fcore-tech\u002Fwasm-wallet-client",{"title":5,"description":2985},"docs\u002Fcore-tech\u002FWASM-wallet-client","2CvNGEqnfqpqUPh9_CR2icuxL8258ryCJF5frbQzbsg",[2994,2999],{"title":2995,"path":2996,"stem":2997,"description":2998,"children":-1},"Using BeamX Vault Contract With CLI Wallet","\u002Fdocs\u002Fcore-tech\u002Fusing-beamx-vault-contract-with-cli-wallet","docs\u002Fcore-tech\u002FUsing-BeamX-Vault-contract-with-CLI-Wallet","NOTE: If you haven't already, please review BeamX Getting Started Guide and Using BeamX Faucet contract with CLI Wallet",{"title":3000,"path":3001,"stem":3002,"description":3003,"children":-1},"Wallet Service","\u002Fdocs\u002Fcore-tech\u002Fwallet-service","docs\u002Fcore-tech\u002FWallet-Service","Beam wallet service allows to implement lightweight wallets using BEAM API.",1783006089206]