placecodex / tatum-php
PHP SDK to Tatum.io API client, with examples
dev-master
2021-08-16 20:31 UTC
Requires
- php: ^7.2
- ext-curl: *
- ext-gmp: ^7.2
- ext-json: *
- ext-mbstring: ^7.2
- ext-mcrypt: ^1.0.4
- ext-openssl: *
- btccom/bitwasp-bitcoin-bch-addon: master
- kornrunner/keccak: ^1.1.0
- mbezhanov/ethereum-converter: dev-master
- web3p/ethereum-tx: dev-master
This package is not auto-updated.
Last update: 2025-01-29 07:45:28 UTC
README
this package was cloned from tatumio/tatum-php and adapted to laravel
Thanks tatum team for the excellent work
tatum-php
Tatum.io Official PHP SDK for dev
To Install This SDK clone to a folder eg: tatum-php
Installation and Running.
Linux Ubuntu 16.04 requirements:apt-get install php php-gmp php-mbstring php-mcrypt
To Install this Lib
composer require placecodex/tatum-php
Try an example
To let Library generate mnemonic
<?php require('vendor/autoload.php'); $Tatum = new Tatum\Tatum(); $coin = "BTC"; $wallet = $Tatum->generateWallet($coin); echo $wallet; $walletX = json_decode($wallet); echo "<hr/>"; echo $Tatum->generatePrivateKey($coin, $walletX->mnemonic, '0'); echo "<hr/>"; echo $Tatum->generateAddressFromXPub($coin, $walletX->xpub, '0'); echo "<hr/>";
To Generate From mnemonic given
<?php require('vendor/autoload.php'); $Tatum = new Tatum\Tatum(); $mnemonic = 'book review judge pelican powder talk onion shuffle panda foot scheme rail rather pond logic private month sure harsh leader double zero pave happy'; $xpub = ""; $coin = "BTC"; $wallet = $Tatum->generateWallet($coin, $mnemonic); echo $wallet; $walletX = json_decode($wallet); echo "<hr/>"; echo $Tatum->generatePrivateKey($coin, $walletX->mnemonic, '0'); echo "<hr/>"; echo $Tatum->generateAddressFromXPub($coin, $walletX->xpub, '0'); echo "<hr/>";
To Sign Ethereum and ERC20 Transaction
<?php require('vendor/autoload.php'); $Tatum = new Tatum\Tatum(); $body = array( 'ETH', //Currency EG: ETH, USDT, USDC etc '0x07849dd09c66e90742831afbcafee041a3f0a0c674678b6f0fa31f0e2dc284ca', //Private Key Wif '0x309981C7302e9f650880fbc6282E28A87384eE39', // From Address '0x83214dd08f7995ad436b1bfda15dffe985485e42', //To Address '0.0328', // Amount in ETH '1', // Fee in Gwei '', //Gas Limit minimum is 21000 '', //Data '' // Nonce ); To Send Directly Use echo $Tatum->sendEthereumTransaction($body); Sign and Get Hex use echo $Tatum->prepareSignedEthereumTransaction($body); echo "<hr/>";
Bitcoin, Ethereum and ERC20 Tokens, BitcoinCash and Litecoin only is supported yet.