Skip to content

Commit

Permalink
Merge pull request #86 from minterpro/master
Browse files Browse the repository at this point in the history
upgrade to taconet
  • Loading branch information
grkamil authored Feb 10, 2021
2 parents 43c5ad6 + 0b20afa commit 8884a12
Show file tree
Hide file tree
Showing 49 changed files with 2,265 additions and 94 deletions.
289 changes: 281 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ This is a pure PHP SDK for working with <b>Minter</b> blockchain
- [getMinGasPrice](#getmingasprice)
- [getMissedBlocks](#getmissedblocks)
- [getWaitlist](#getwaitlist)
- [getPriceCommissions](#getPriceCommissions)
- [getPriceVotes](#getPriceVotes)
- [getSwapPool](#getSwapPool)
- [getSwapPoolProvider](#getSwapPoolProvider)
- [Error handling](#error-handling)

* [Minter SDK](#using-mintersdk)
Expand All @@ -53,6 +57,19 @@ This is a pure PHP SDK for working with <b>Minter</b> blockchain
- [EditMultisig](#example-20)
- [PriceVote](#example-21)
- [EditCandidatePublicKey](#example-22)
- [AddLiquidity](#example-23)
- [RemoveLiquidity](#example-24)
- [SellSwapPool](#example-25)
- [BuySwapPool](#example-26)
- [SellAllSwapPool](#example-27)
- [EditCandidateCommission](#example-28)
- [MoveStake](#example-29)
- [MintToken](#example-30)
- [BurnToken](#example-31)
- [CreateToken](#example-32)
- [RecreateToken](#example-33)
- [PriceCommission](#example-34)
- [CreateSwapPool](#example-35)
- [Sign transaction with multisignatures](#sign-transaction-with-multisignatures)
- [Get fee of transaction](#get-fee-of-transaction)
- [Decode Transaction](#decode-transaction)
Expand Down Expand Up @@ -157,23 +174,23 @@ getValidators(?int $height = null, ?int $page = 1, ?int $perPage = null): \stdCl
Return estimate of buy coin transaction.

``
estimateCoinBuy(string $coinToSell, string $valueToBuy, string $coinToBuy, ?int $height = null): \stdClass
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): \stdClass
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): \stdClass
estimateCoinSellAll(string $coinToSell, string $valueToSell, string $coinToBuy, ?int $height = null, string $swapFrom): \stdClass
``

### getCoinInfo
Expand Down Expand Up @@ -229,15 +246,15 @@ getCandidates(?int $height = null, ?bool $includeStakes = false): \stdClass

### estimateTxCommission

Return estimate of transaction.
Returns estimate of transaction.

``
estimateTxCommission(string $tx, ?int $height = null): \stdClass
``

### getTransactions

Return transactions by query.
Returns transactions by query.

``
getTransactions(string $query, ?int $page = null, ?int $perPage = null): \stdClass
Expand Down Expand Up @@ -277,28 +294,70 @@ getMissedBlocks(string $pubKey, ?int $height = null): \stdClass

### getGenesis

Return network genesis.
Returns network genesis.

``
getGenesis(): \stdClass
``

### getNetworkInfo

Return node network information.
Returns node network information.

``
getNetworkInfo(): \stdClass
``

### getWaitlist

Return waitlisted stakes by address
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
``



### Error handling

Example of how you can handle errors and get the response body.
Expand Down Expand Up @@ -639,6 +698,220 @@ $tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>AddLiquidity</b> transaction
* Constructor: ```MinterAddLiquidityTx($coin0, $coin1, $volume0, $maximumVolume1)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterAddLiquidityTx;

$data = new MinterAddLiquidityTx(0, 1, '1000', '2000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>RemoveLiquidity</b> transaction
* Constructor: ```MinterRemoveLiquidityTx($coin0, $coin1, $liquidity, $minimumVolume0, $minimumVolume1)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterRemoveLiquidityTx;

$data = new MinterRemoveLiquidityTx(0, 1, '2000', '500', '1000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>SellSwapPool</b> transaction
* Constructor: ```MinterSellSwapPoolTx($coinToSell, $valueToSell, $coinToBuy, $minimumValueToBuy)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterSellSwapPoolTx;

$data = new MinterSellSwapPoolTx(0, '100', 1, '200');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>BuySwapPool</b> transaction
* Constructor: ```MinterBuySwapPoolTx($coinToBuy, $valueToBuy, $coinToSell, $maximumValueToSell)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterBuySwapPoolTx;

$data = new MinterBuySwapPoolTx(0, '100', 1, '200');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>SellAllSwapPool</b> transaction
* Constructor: ```MinterSellAllSwapPoolTx($coinToSell, $coinToBuy, $minimumValueToBuy)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterSellAllSwapPoolTx;

$data = new MinterSellAllSwapPoolTx(0, 1, '100');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>EditCandidateCommission</b> transaction
* Constructor: ```MinterEditCandidateCommissionTx($publicKey, $commission)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterEditCandidateCommissionTx;

$data = new MinterEditCandidateCommissionTx('public key', 77);
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>MoveStake</b> transaction
* Constructor: ```MinterMoveStakeTx($from, $to, $coin, $stake)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterEditCandidateCommissionTx;

$data = new MinterEditCandidateCommissionTx('from public key', 'to public key', 1, '3000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>MintToken</b> transaction
* Constructor: ```MinterMintTokenTx($coin, $value)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterMintTokenTx;

$data = new MinterMintTokenTx(2, '3000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>BurnToken</b> transaction
* Constructor: ```MinterBurnTokenTx($coin, $value)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterBurnTokenTx;

$data = new MinterBurnTokenTx(3, '100000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>CreateToken</b> transaction
* Constructor: ```MinterCreateTokenTx($name, $symbol, $initialAmount, $maxSupply, $mintable, $burnable)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterCreateTokenTx;

$data = new MinterCreateTokenTx('TEST COIN IS MINTABLE ONLY', 'TEST', '10000', '50000', true, false);
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>RecreateToken</b> transaction
* Constructor: ```MinterRecreateTokenTx($name, $symbol, $initialAmount, $maxSupply, $mintable, $burnable)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterRecreateTokenTx;

$data = new MinterRecreateTokenTx('TEST COIN IS TURNED TO BE BURNABLE ONLY', 'TEST', '50000', '50000', false, true);
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>PriceCommission</b> transaction
* Constructor: ```MinterPriceCommissionTx(
$pubKey,
$height,
$coin,
$payloadByte,
$send,
$buyBancor,
$sellBancor,
$sellAllBancor,
$buyPool,
$sellPool,
$sellAllPool,
$createTicker3,
$createTicker4,
$createTicker5,
$createTicker6,
$createTicker7to10,
$createCoin,
$createToken,
$recreateCoin,
$recreateToken,
$declareCandidacy,
$delegate,
$unbond,
$redeemCheck,
$setCandidateOn,
$setCandidateOff,
$createMultisig,
$multisendBase,
$multisendDelta,
$editCandidate,
$setHaltBlock,
$editTickerOwner,
$editMultisig,
$priceVote,
$editCandidatePublicKey,
$createSwapPool,
$addLiquidity,
$removeLiquidity,
$editCandidateCommission,
$moveStake,
$burnToken,
$mintToken,
$voteCommission,
$voteUpdate
)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterPriceCommissionTx;

$data = new MinterPriceCommissionTx('public key', 100000,0,'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

###### Example
* Sign the <b>CreateSwapPoll</b> transaction
* Constructor: ```MinterCreateSwapPoolTx($coin0, $coin1, $volume0, $volume1)```

```php
use Minter\SDK\MinterTx;
use Minter\SDK\MinterCoins\MinterCreateSwapPoolTx;

$data = new MinterCreateSwapPoolTx(1, 2, '11000', '22000');
$tx = new MinterTx($nonce, $data);
$tx->sign('your private key')
```

### Sign transaction with multisignatures

Returns a signed tx.
Expand Down
Loading

0 comments on commit 8884a12

Please sign in to comment.