test_wallet_export.js (704B)
1 import * as tart from "tart"; 2 3 const { talerUtilHttp, talerWalletCore, talerUtil } = talerModules; 4 5 const { j2s } = talerUtil; 6 7 const httpLib = talerUtilHttp.createPlatformHttpLib(); 8 9 const { wallet } = await talerWalletCore.createNativeWalletHost2({ 10 httpLib, 11 }); 12 13 14 const initResp = await wallet.client.call(talerWalletCore.WalletApiOperation.InitWallet, {}); 15 16 console.log(j2s(initResp)); 17 18 try { 19 const exportResp = await wallet.client.call(talerWalletCore.WalletApiOperation.ExportDbToFile, { 20 directory: "/tmp", 21 stem: "taler-wallet-export", 22 forceFormat: "json", 23 }); 24 } catch (e) { 25 console.log("caught e"); 26 } 27 28 29 await wallet.client.call(talerWalletCore.WalletApiOperation.Shutdown, {});