From 6890bd648499094f1af3b6b964cfbf1e5beebd28 Mon Sep 17 00:00:00 2001 From: cyan Date: Sun, 13 Oct 2024 12:54:43 +0000 Subject: Draft PHP implementation --- impls/monero.php/ffi.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 impls/monero.php/ffi.php (limited to 'impls/monero.php/ffi.php') diff --git a/impls/monero.php/ffi.php b/impls/monero.php/ffi.php new file mode 100644 index 0000000..5ab35b3 --- /dev/null +++ b/impls/monero.php/ffi.php @@ -0,0 +1,35 @@ +MONERO_WalletManagerFactory_getWalletManager(); +$exists = $ffi->MONERO_WalletManager_walletExists($wmPtr, "test_wallet"); +if ($exists) { + $wPtr = $ffi->MONERO_WalletManager_openWallet($wmPtr, "test_wallet", "test_password", 0); +} else { + $wPtr = $ffi->MONERO_WalletManager_createWallet($wmPtr, "test_wallet", "test_password", "English", 0); +} +$status = $ffi->MONERO_Wallet_status($wPtr); +if ($status != 0) { + $error = $ffi->MONERO_Wallet_errorString($wPtr); + echo "Unable to create wallet: $error".PHP_EOL; + exit(1); +} +echo $ffi->MONERO_Wallet_address($wPtr, 0, 0).PHP_EOL; \ No newline at end of file -- cgit v1.2.3