Download the PHP package minter/minter-php-sdk without Composer
On this page you can find all versions of the php package minter/minter-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package minter-php-sdk
About
This is a pure PHP SDK for working with Minter blockchain
- Installation
-
Minter Api
- Methods:
- getBalance
- getNonce
- send
- getAddresses
- getStatus
- getValidators
- estimateCoinBuy
- estimateCoinSell
- estimateCoinSellAll
- getCoinInfo
- getBlock
- getEvents
- getTransaction
- getCandidate
- getCandidates
- estimateTxCommission
- getTransactions
- getUnconfirmedTxs
- getMaxGasPrice
- getMinGasPrice
- getMissedBlocks
- getWaitlist
- getPriceCommissions
- getPriceVotes
- getSwapPool
- getSwapPoolProvider
- getLimitOrder
- getLimitOrders
- getLimitOrdersByCoins
- Error handling
- Methods:
- Minter SDK
- Sign transaction
- SendCoin
- SellCoin
- SellAllCoin
- BuyCoin
- CreateCoin
- DeclareCandidacy
- Delegate
- SetCandidateOn
- SetCandidateOff
- RedeemCheck
- Unbond
- MultiSend
- EditCandidate
- CreateMultisig
- SetHaltBlock
- RecreateCoin
- EditCoinOwner
- EditMultisig
- EditCandidatePublicKey
- AddLiquidity
- RemoveLiquidity
- SellSwapPool
- BuySwapPool
- SellAllSwapPool
- EditCandidateCommission
- MintToken
- BurnToken
- CreateToken
- RecreateToken
- PriceCommission
- CreateSwapPool
- AddLimitOrder
- RemoveLimitOrder
- Sign transaction with multisignatures
- Get fee of transaction
- Decode Transaction
- Minter Check
- Minter Wallet
- Minter Link
- Sign transaction
- Tests
Installing
Using MinterAPI
You can get all valid responses and full documentation at Minter Node Api
Create MinterAPI instance
getBalance
Returns coins list, balance and transaction count (for nonce) of an address.
getBalance(string $minterAddress, ?int $height = null): \stdClass
Example
getNonce
Returns next transaction number (nonce) of an address.
getNonce(string $minterAddress): int
Example
send
Returns the result of sending signed tx.
:warning: To ensure that transaction was successfully committed to the blockchain, you need to find the transaction by the hash and ensure that the status code equals to 0.
send(string $tx): \stdClass
Example
getAddresses
Returns addresses balances.
getAddresses(array $addresses, ?int $height = null): \stdClass
getStatus
Returns node status info.
getStatus(): \stdClass
getValidators
Returns list of active validators.
getValidators(?int $height = null, ?int $page = 1, ?int $perPage = null): \stdClass
estimateCoinBuy
Return estimate of buy coin transaction.
estimateCoinBuy(string $coinToSell, string $valueToBuy, string $coinToBuy, ?int $height = null, string $swapFrom): \stdClass
estimateCoinSell
Return estimate of sell coin transaction.
estimateCoinSell(string $coinToSell, string $valueToSell, string $coinToBuy, ?int $height = null, string $swapFrom): \stdClass
estimateCoinSellAll
Return estimate of sell coin all transaction.
estimateCoinSellAll(string $coinToSell, string $valueToSell, string $coinToBuy, ?int $height = null, string $swapFrom): \stdClass
getCoinInfo
Returns information about coin. Note: this method does not return information about base coins (MNT and BIP).
getCoinInfo(string $coin, ?int $height = null): \stdClass
getBlock
Returns block data at given height.
getBlock(int $height): \stdClass
getEvents
Returns events at given height.
getEvents(int $height): \stdClass
getTransaction
Returns transaction info.
getTransaction(string $hash): \stdClass
getCandidate
Returns candidate’s info by provided public_key. It will respond with 404 code if candidate is not found.
getCandidate(string $publicKey, ?int $height = null): \stdClass
getCandidates
Returns list of candidates.
$height is optional parameter.
getCandidates(?int $height = null, ?bool $includeStakes = false): \stdClass
estimateTxCommission
Returns estimate of transaction.
estimateTxCommission(string $tx, ?int $height = null): \stdClass
getTransactions
Returns transactions by query.
getTransactions(string $query, ?int $page = null, ?int $perPage = null): \stdClass
getUnconfirmedTxs
Returns unconfirmed transactions.
getUnconfirmedTxs(?int $limit = null): \stdClass
getMaxGasPrice
Returns current max gas price.
getMaxGasPrice(?int $height = null): \stdClass
getMinGasPrice
Returns current min gas price.
getMinGasPrice(): \stdClass
getMissedBlocks
Returns missed blocks by validator public key.
getMissedBlocks(string $pubKey, ?int $height = null): \stdClass
getGenesis
Returns network genesis.
getGenesis(): \stdClass
getNetworkInfo
Returns node network information.
getNetworkInfo(): \stdClass
getWaitlist
Returns waitlisted stakes by address
getWaitlist(string $address, ?string $publicKey = null, ?int $height = null): \stdClass
getWaitlist
Returns waitlisted stakes by address
getWaitlist(string $address, ?string $publicKey = null, ?int $height = null): \stdClass
getPriceCommissions
Returns the list of the commissions that are set up on the Minter Network
getPriceCommissions(?int $height = null): \stdClass
getPriceVotes
Returns the list of validators' votes for changing commissions on the network
getPriceVotes(int $height): \stdClass
getSwapPool
Returns entire liquidity volume of the swap pool
getSwapPool(string $coin0, string $coin1, ?int $height = null): \stdClass
getSwapPoolProvider
Returns liquidity volume of the swap pool provided by specified address
getSwapPoolProvider(string $coin0, string $coin1, string $provider, ?int $height = null): \stdClass
getLimitOrders
Returns list of limit orders by ids
getLimitOrders(array $ids, ?int $height = null): \stdClass
getLimitOrder
Returns limit order details by id
getLimitOrder(int $limitOrderId, ?int $height = null): \stdClass
getLimitOrdersByCoins
Returns limit orders related to sell and buy coins
getLimitOrdersByCoins(string $sellCoin, string $buyCoin, int $limit = null, ?int $height = null): \stdClass
Error handling
Example of how you can handle errors and get the response body.
Using MinterSDK
Sign transaction
Returns a signed tx.
Example
- Sign the SendCoin transaction
- Constructor:
At all type of transactions you can also set optional fields: gas price, gas coin, payload, serviceData, chain id
Example
- Sign the SellCoin transaction
- Constructor:
Example
- Sign the SellAllCoin transaction
- Constructor:
Example
- Sign the BuyCoin transaction
- Constructor:
Example
- Sign the CreateCoin transaction
- Constructor:
Example
- Sign the DeclareCandidacy transaction
- Constructor:
Example
- Sign the Delegate transaction
- Constructor:
Example
- Sign the SetCandidateOn transaction
- Constructor:
Example
- Sign the SetCandidateOff transaction
- Constructor:
Example
- Sign the RedeemCheck transaction
- Constructor:
Example
- Sign the Unbond transaction
- Constructor:
Example
- Sign the MultiSend transaction
- Constructor:
Example
- Sign the EditCandidate transaction
- Constructor:
Example
- Sign the CreateMultisig transaction
- Constructor:
Example
- Sign the SetHaltBlock transaction
- Constructor:
Example
- Sign the RecreateCoin transaction
- Constructor:
Example
- Sign the EditCoinOwner transaction
- Constructor:
Example
- Sign the EditMultisig transaction
- Constructor:
Example
- Sign the EditCandidatePublicKey transaction
- Constructor:
Example
- Sign the AddLiquidity transaction
- Constructor:
Example
- Sign the RemoveLiquidity transaction
- Constructor:
Example
- Sign the SellSwapPool transaction
- Constructor:
Example
- Sign the BuySwapPool transaction
- Constructor:
Example
- Sign the SellAllSwapPool transaction
- Constructor:
Example
- Sign the EditCandidateCommission transaction
- Constructor:
Example
- Sign the MintToken transaction
- Constructor:
Example
- Sign the BurnToken transaction
- Constructor:
Example
- Sign the CreateToken transaction
- Constructor:
Example
- Sign the RecreateToken transaction
- Constructor:
Example
- Sign the PriceCommission transaction
- Constructor:
Example
- Sign the CreateSwapPoll transaction
- Constructor:
Example
- Sign the AddLimitOrder transaction
- Constructor:
Example
- Sign the RemoveLimitOrder transaction
- Constructor:
Sign transaction with multisignatures
Returns a signed tx.
Example
- To sign transaction with multisignatures, you need to call signMultisig method and pass multisig Minter address and his private keys (in any order).
Example
- To get the signature of transaction (not signed transaction) you need to call createSignature
Example
- To sign transaction with ready signatures, you need to call signMultisigBySigns method and pass multisig Minter address and your signatures (in any order).
Get fee of transaction
- Calculate fee of transaction. You can get fee AFTER signing or decoding transaction.
Decode transaction
Returns an array with transaction data.
Example
- Decode transaction
Create Minter Check
Example
-
Create check
-
Create proof
- Decode check
Minter Wallet
Example
-
Create wallet.
-
Create wallet from mnemonic
- Create wallet from private key
Minter Link
Example
- Create Minter deep link.
-
You can pass data of any Minter transaction to the constructor.
- You can define optional fields such as host, payload, nonce, gas price, gas coin, check password.
Tests
To run unit tests:
All versions of minter-php-sdk with dependencies
ext-bcmath Version *
ext-json Version *
ext-gmp Version *
kornrunner/keccak Version ^1.0
guzzlehttp/guzzle Version ^6.3|^7.3
minter/minter-php-bip-44 Version ^1.2
bitwasp/bitcoin-lib Version ^1.0
simplito/elliptic-php Version ^1.0
minter/php-rlp Version ^1.0.0