Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

021/crypto-wallets

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

021/crypto-wallets

Package for working with crypto wallets

Source
Packagist
Version
v1.2.2
Version published
Maintainers
1
Created
Source

Installation

Run composer require 021/crypto-wallets

Requirements

  • PHP 7.1+

Usage

Import wallet

use O21\CryptoWallets\BitcoinWallet; or use O21\CryptoWallets\LitecoinWallet;

Connect to wallet

use O21\CryptoWallets\Configs\BitcoindConfig;

$wallet = new BitcoinWallet(BitcoindConfig::fill(
    'username',
    'password',
    '127.0.0.1',
    18333
));

Check connection

$wallet->isAvailable()

Wallet

// Return wallet balance 
$wallet->getBalance()

// Return transactions count for wallet
$wallet->getTransactionsCount()

// Return typical transaction size for wallet (Constant)
$wallet->getTypicalTransactionSize()

Rates

By default, method getRate() will return result from binance.com

use O21\CryptoWallets\Contracts\WalletRate;

// Return USD rate for Bitcoin 
$wallet->getRate() 

// Return EUR rate for Bitcoin 
$wallet->getRate('EUR') 

// Return EUR rate for Bitcoin from blockchain.com
$wallet->getRate('EUR', WalletRate::RATE_BLOCKCHAIN)

// Return best rate for last 30 minutes 
$wallet->getBestRate('USD', 30)

Addresses

// Return new addresses
$wallet->getNewAddress()

// Return is address valid 
$wallet->validateAddress('wallet_address')

// Return link to blockchair.com for explain address
$wallet->getExploreAddressLink('wallet_address')

To be continued...

FAQs

Package last updated on 30 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts