Skip to content

placecodex/tatum-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published