Skip to content

Instantly share code, notes, and snippets.

@askaaqib
Last active August 18, 2022 03:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save askaaqib/097c174ee4d197b92d576cecbbb00ea3 to your computer and use it in GitHub Desktop.
Save askaaqib/097c174ee4d197b92d576cecbbb00ea3 to your computer and use it in GitHub Desktop.
SkyCoin SDK PHP
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
$sky = new \SkyCoin\SkyCoin("192.168.100.27", 6420);
$walletFactory = new \SkyCoin\Wallets\WalletsFactory($sky);
echo "<pre>";
////GET BLOCK BY HEIGHT
//$getBlockByHeight = $sky->blocks()->getByHeight(1891);
//var_dump($getBlockByHeight);
//
////GET BLOCK BY HASH
//$block = $sky->blocks()->getByHash("015265e82b4a28eee364327bf0d3b51fed54c2067318029974c262478a09bf17");
//var_dump($block);
//CREATE WALLET
//$new_wallet = $walletFactory->create("lorem ipsum doller sit amit", "MyWallet", "asd2020asd");
//var_dump($new_wallet);
$filename = "2020_10_19_a886.wlt";
$version = "0.4";
$label = "MyWallet";
$primaryAddr = "2eXJ6q11PMskUwTDBiPQSMbHETtvdSHijpz";
$primaryPubKey = "02d9c014af9fd5bf39efcf5441b4a9dc5dd20c008b140f31a353a052cfd69966eb";
$wallet = new \SkyCoin\Wallets\Wallet($sky, "2020_10_19_a886.wlt", "asd2020asd");
//CREATE ADDRESS
//$walletAddress = $wallet->createAddress();
//var_dump($walletAddress);
// y6d8L1xftDUJoR9bh6GUUM4hWJBPvgQPw9
//CHECK WALLET BALANCE
$walletBalance = $wallet->getBalance();
var_dump($walletBalance);
echo "</pre>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment