Giter Site home page Giter Site logo

tatumio / tatum-php Goto Github PK

View Code? Open in Web Editor NEW
53.0 6.0 25.0 12.44 MB

Tatum SDK written in PHP

Home Page: https://tatumio.github.io/tatum-php/

License: MIT License

PHP 100.00%
tatum tatum-api tatum-php-sdk tatum-sdk web3-php tatum-php web3-sdk ethereum ethereum-php smart-contracts

tatum-php's People

Contributors

hehe100596 avatar highbreedtech avatar isra67 avatar mark-jivko avatar nader-tatum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tatum-php's Issues

.env file not found

Fatal error: Uncaught TatumException: You need to set your Network from your .env file! in C:\laragon\www\tatum\vendor\tatumio\tatum-php\src\Tatum.php:57 Stack trace: #0 C:\laragon\www\tatum\vendor\tatumio\tatum-php\src\Tatum.php(42): Tatum\Tatum->InitTatum() #1 C:\laragon\www\tatum\index.php(104): Tatum\Tatum->__construct() #2 [internal function]: {closure}()

generatePrivateKey from mnemonic BUG

        $sdk = new \Tatum\Sdk();
        $result = $sdk
            ->mainnet()
            ->local()->wallet()
            ->bsc()
            ->generatePrivateKey('elite tonight holiday hat boil culture second romance parrot pair swamp impose sign valley apart lunar lake tonight song kind divert mango naive chef', 0);
        // 4223009e6dffe7accaff161ac1d3df304775b65474eae0da4140dde011e6801c

截屏2023-09-11 15 32 26

In fact, the private key recovered by the program is not this, and it is completely inconsistent with the wallet.

No transaction data in notifications

Hello dear developers, I have the following problem, I created a subscription to notifications for an address, subscription type "ADDRESS_TRANSACTION", the documentation says that the data is contained in the body of the POST request, but when testing I get an empty webhook. Here is the code of my handler:

<?php
var_dump($_POST);

I'm doing a test webhook through the tatum panel.
image
As shown in the screenshot, the $_POST variable is empty, please advise how to solve this problem

Type mixed cannot be marked as nullable since mixed already includes null

Describe the bug
Type for return type
\Tatum\Model\EthTx::getBlockNumber()

To Reproduce
Steps to reproduce the behavior:

  1. Call method \Tatum\Api\EthereumApi::ethGetTransactionByAddress()
  2. Response 'Type mixed cannot be marked as nullable since mixed already includes null'

Environment (please complete the following information):

  • CPU: x64
  • PHP Version: 8.1.0
  • Server: Apache

Solana To And From Addresses only take strings with 43 character Limits when Wallets are 44.

Describe the bug
chainTransferSolanaSpl currently expects strings with a length of 43 characters when all solana wallets are 44.

To Reproduce
Steps to reproduce the behavior:

  1. Create ChainTransferSolanaSpl Model with a standard Solana address in the To field
  2. Received response 'Exception when calling api()->fungibleTokensERC20OrCompatible()->chainTransferSolanaSpl(): Tatum\Model\ChainTransferSolanaSpl::setTo() 'to' length must be smaller than or equal to 43'
  3. Expected response 'TxnId'

Expected behavior
I expect the transaction to go through as intended. The same query works via curl with the 44 character long Solana wallet address.

Environment (please complete the following information):

  • OS: Ubuntu
  • CPU: x86
  • PHP Version: 8.1.2
  • Server: Apache

Additional context
Add any other context about the problem here.

PHP8 support

Hey folks, With the amount of watchers/downloads/stars, I believe this project is not a prioity, so, when are you planning to update this lib to support PHP 8?
Thanks!

Undefined constant "Tatum\Sdk\Psr7\Http\CURL_HTTP_VERSION_2_0"

Describe the bug
Undefined constant "Tatum\Sdk\Psr7\Http\CURL_HTTP_VERSION_2_0"

To Reproduce

mainnet()->config()->setDebug(true); // Account address you want to get balance of $arg_address = "0x3223AEB8404C7525FcAA6C512f91e287AE9FfE7B"; // Type of Ethereum testnet. Defaults to ethereum-sepolia. $arg_x_testnet_type = 'ethereum-sepolia'; try { /** * GET /v3/ethereum/account/balance/{address} * * @var \Tatum\Model\EthBalance $response */ $response = $sdk->mainnet() ->api() ->ethereum() ->ethGetBalance($arg_address, $arg_x_testnet_type); var_dump($response); } catch (\Tatum\Sdk\ApiException $apiExc) { echo sprintf( "API Exception when calling api()->ethereum()->ethGetBalance(): %s\n", var_export($apiExc->getResponseObject(), true) ); } catch (\Exception $exc) { echo sprintf( "Exception when calling api()->ethereum()->ethGetBalance(): %s\n", $exc->getMessage() ); } Environment - OS: Ubuntu 22 - CPU: x64 - PHP Version: 8.2 - Server: Apache **Additional context** Add any other context about the problem here.

settype(): Invalid type

array:1 [▼
"Exception" => yii\base\ErrorException {#206 ▼
#message: "settype(): Invalid type"
#code: 2
#file: "vendor/tatumio/tatum-php/lib/Sdk/Serializer.php"
#line: 464
#severity: E_WARNING
trace: {▼
vendor/tatumio/tatum-php/lib/Sdk/Serializer.php:464 {▼
yii\base\ErrorHandler->handleError($code, $message, $file, $line) …
› if (in_array($type, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
› settype($data, $type);
› return $data;
}
yii\base\ErrorHandler->handleError() {}
vendor/tatumio/tatum-php/lib/Sdk/Serializer.php:464 {▼
Tatum\Sdk\Serializer::doDeserialize($data, string $type) …
› if (in_array($type, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
› settype($data, $type);
› return $data;
arguments: {▼
&$var: 10300651
$type: "mixed"
}
}
vendor/tatumio/tatum-php/lib/Sdk/Serializer.php:502 {▼
Tatum\Sdk\Serializer::doDeserialize($data, string $type) …
› $propertyValue = $data->{$instance::attributeMap()[$property]};
› $instance->$propertySetter(self::doDeserialize($propertyValue, $model_types));
› }
arguments: {▶}
}
vendor/tatumio/tatum-php/lib/Sdk/Serializer.php:419 {▶}
vendor/tatumio/tatum-php/lib/Sdk/Serializer.php:393 {▶}
vendor/tatumio/tatum-php/lib/Api/AbstractApi.php:112 {▶}
vendor/tatumio/tatum-php/lib/Api/EthereumApi.php:487 {▶}
addons/VymToken/backend/controllers/basic/TransactionController.php:48 {▶}
addons\VymToken\backend\controllers\basic\TransactionController->actionRun() {}
vendor/yiisoft/yii2/base/InlineAction.php:57 {▶}
vendor/yiisoft/yii2/base/Controller.php:178 {▶}
vendor/yiisoft/yii2/base/Module.php:552 {▶}
vendor/yiisoft/yii2/web/Application.php:103 {▶}
vendor/yiisoft/yii2/base/Application.php:384 {▶}
web/backend/index.php:35 {▶}
}
}
]

php-mcrypt not available from source

After cloning the repo into a folder I opened the read me to finish the install, upon running the command

"apt-get install php php-gmp php-mbstring php-mcrypt"

I was returned this error .

"Package php-mcrypt is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-mcrypt' has no installation candidate"

So is there another program that can accomplish this same thing or perhaps another source?

ERC20Currency model does not have getters and setters

Describe the bug
\Tatum\Model\TransferEthBlockchain and \Tatum\Model\TransferEthBlockchainKMS require \Tatum\Model\Erc20Currency. But \Tatum\Model\Erc20Currency doesn't have _constructor, getters and setters.

To Reproduce
Steps to reproduce the behavior:

  1. $Erc20Currency = new Erc20Currency();
  2. $Erc20Currency->setCurrency('ETH');
  3. Received response: Call to undefined method Tatum\Model\Erc20Currency::setCurrency()
  4. Expected response: $Erc20Currency->getCurrency() returns 'ETH';

Environment:

  • OS: Ubuntu 22
  • CPU: x64
  • PHP Version: 8.1
  • Server: Apache

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.