Skip to content

Latest commit

 

History

History
1508 lines (979 loc) · 44.2 KB

WalletApi.md

File metadata and controls

1508 lines (979 loc) · 44.2 KB

Mainnet\WalletApi

All URIs are relative to https://rest-unstable.mainnet.cash

Method HTTP request Description
balance POST /wallet/balance Get total balance for wallet
createWallet POST /wallet/create create a new wallet
depositAddress POST /wallet/deposit_address Get a deposit address in cash address format
depositQr POST /wallet/deposit_qr Get receiving cash address as a qrcode
encodeTransaction POST /wallet/encode_transaction Encode and sign a transaction given a list of sendRequests, options and estimate fees
getAllNftTokenBalances POST /wallet/get_all_nft_token_balances Get non-fungible token balance
getAllTokenBalances POST /wallet/get_all_token_balances Get non-fungible token balance
getHistory POST /wallet/get_history Get a simplified list of transactions related to a wallet
getNftTokenBalance POST /wallet/get_nft_token_balance Get non-fungible token balance
getTokenBalance POST /wallet/get_token_balance Get fungible token balance
getTokenUtxos POST /wallet/get_token_utxos Get token utxos
info POST /wallet/info Get information about a wallet
maxAmountToSend POST /wallet/max_amount_to_send Get maximum spendable amount
namedExists POST /wallet/named_exists Check if a named wallet already exists
replaceNamed POST /wallet/replace_named Replace (recover) named wallet with a new walletId. If wallet with a provided name does not exist yet, it will be creted with a `walletId` supplied If wallet exists it will be overwritten without exception
send POST /wallet/send Send some amount to a given address
sendMax POST /wallet/send_max Send all available funds to a given address
submitTransaction POST /wallet/submit_transaction submit an encoded and signed transaction to the network
tokenBurn POST /wallet/token_burn Perform an explicit token burn
tokenDepositAddress POST /wallet/token_deposit_address Get a token aware deposit address in cash address format
tokenDepositQr POST /wallet/token_deposit_qr Get receiving token aware cash address as a qrcode
tokenGenesis POST /wallet/token_genesis Create new token category
tokenMint POST /wallet/token_mint Mint new non-fungible tokens
utxos POST /wallet/utxo Get detailed information about unspent outputs (utxos)
xpubkeys POST /wallet/xpubkeys A set of xpubkeys and paths for the wallet.

balance

\Mainnet\Model\BalanceResponse balance($balance_request)

Get total balance for wallet

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$balance_request = new \Mainnet\Model\BalanceRequest(); // \Mainnet\Model\BalanceRequest | Request for a wallet balance

try {
    $result = $apiInstance->balance($balance_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->balance: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
balance_request \Mainnet\Model\BalanceRequest Request for a wallet balance

Return type

\Mainnet\Model\BalanceResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createWallet

\Mainnet\Model\WalletResponse createWallet($wallet_request)

create a new wallet

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$wallet_request = new \Mainnet\Model\WalletRequest(); // \Mainnet\Model\WalletRequest | Request a new random wallet

try {
    $result = $apiInstance->createWallet($wallet_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->createWallet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
wallet_request \Mainnet\Model\WalletRequest Request a new random wallet

Return type

\Mainnet\Model\WalletResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

depositAddress

\Mainnet\Model\DepositAddressResponse depositAddress($serialized_wallet)

Get a deposit address in cash address format

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | Request for a deposit address given a wallet

try {
    $result = $apiInstance->depositAddress($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->depositAddress: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet Request for a deposit address given a wallet

Return type

\Mainnet\Model\DepositAddressResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

depositQr

\Mainnet\Model\ScalableVectorGraphic depositQr($serialized_wallet)

Get receiving cash address as a qrcode

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | Request for a deposit cash address as a Quick Response code (qrcode)

try {
    $result = $apiInstance->depositQr($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->depositQr: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet Request for a deposit cash address as a Quick Response code (qrcode)

Return type

\Mainnet\Model\ScalableVectorGraphic

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

encodeTransaction

\Mainnet\Model\EncodeTransactionResponse encodeTransaction($encode_transaction_request)

Encode and sign a transaction given a list of sendRequests, options and estimate fees

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$encode_transaction_request = new \Mainnet\Model\EncodeTransactionRequest(); // \Mainnet\Model\EncodeTransactionRequest | encode a transaction

try {
    $result = $apiInstance->encodeTransaction($encode_transaction_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->encodeTransaction: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
encode_transaction_request \Mainnet\Model\EncodeTransactionRequest encode a transaction

Return type

\Mainnet\Model\EncodeTransactionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAllNftTokenBalances

map[string,float] getAllNftTokenBalances($inline_object4)

Get non-fungible token balance

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$inline_object4 = new \Mainnet\Model\InlineObject4(); // \Mainnet\Model\InlineObject4 | 

try {
    $result = $apiInstance->getAllNftTokenBalances($inline_object4);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getAllNftTokenBalances: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
inline_object4 \Mainnet\Model\InlineObject4

Return type

map[string,float]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAllTokenBalances

map[string,float] getAllTokenBalances($inline_object3)

Get non-fungible token balance

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$inline_object3 = new \Mainnet\Model\InlineObject3(); // \Mainnet\Model\InlineObject3 | 

try {
    $result = $apiInstance->getAllTokenBalances($inline_object3);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getAllTokenBalances: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
inline_object3 \Mainnet\Model\InlineObject3

Return type

map[string,float]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getHistory

\Mainnet\Model\HistoryResponse getHistory($history_request)

Get a simplified list of transactions related to a wallet

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$history_request = new \Mainnet\Model\HistoryRequest(); // \Mainnet\Model\HistoryRequest | Request for a wallet history

try {
    $result = $apiInstance->getHistory($history_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getHistory: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
history_request \Mainnet\Model\HistoryRequest Request for a wallet history

Return type

\Mainnet\Model\HistoryResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getNftTokenBalance

object getNftTokenBalance($inline_object2)

Get non-fungible token balance

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$inline_object2 = new \Mainnet\Model\InlineObject2(); // \Mainnet\Model\InlineObject2 | 

try {
    $result = $apiInstance->getNftTokenBalance($inline_object2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getNftTokenBalance: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
inline_object2 \Mainnet\Model\InlineObject2

Return type

object

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTokenBalance

object getTokenBalance($inline_object1)

Get fungible token balance

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$inline_object1 = new \Mainnet\Model\InlineObject1(); // \Mainnet\Model\InlineObject1 | 

try {
    $result = $apiInstance->getTokenBalance($inline_object1);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getTokenBalance: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
inline_object1 \Mainnet\Model\InlineObject1

Return type

object

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTokenUtxos

\Mainnet\Model\Utxo[] getTokenUtxos($inline_object)

Get token utxos

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$inline_object = new \Mainnet\Model\InlineObject(); // \Mainnet\Model\InlineObject | 

try {
    $result = $apiInstance->getTokenUtxos($inline_object);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->getTokenUtxos: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
inline_object \Mainnet\Model\InlineObject

Return type

\Mainnet\Model\Utxo[]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

info

\Mainnet\Model\WalletInfo info($serialized_wallet)

Get information about a wallet

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | The wallet to request information about, in serialized form.

try {
    $result = $apiInstance->info($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->info: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet The wallet to request information about, in serialized form.

Return type

\Mainnet\Model\WalletInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

maxAmountToSend

\Mainnet\Model\BalanceResponse maxAmountToSend($max_amount_to_send_request)

Get maximum spendable amount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$max_amount_to_send_request = new \Mainnet\Model\MaxAmountToSendRequest(); // \Mainnet\Model\MaxAmountToSendRequest | get amount that will be spend with a spend max request. If a unit type is specified, a numeric value will be returned.

try {
    $result = $apiInstance->maxAmountToSend($max_amount_to_send_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->maxAmountToSend: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
max_amount_to_send_request \Mainnet\Model\MaxAmountToSendRequest get amount that will be spend with a spend max request. If a unit type is specified, a numeric value will be returned.

Return type

\Mainnet\Model\BalanceResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

namedExists

bool namedExists($wallet_named_exists_request)

Check if a named wallet already exists

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$wallet_named_exists_request = new \Mainnet\Model\WalletNamedExistsRequest(); // \Mainnet\Model\WalletNamedExistsRequest | Request parameters

try {
    $result = $apiInstance->namedExists($wallet_named_exists_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->namedExists: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
wallet_named_exists_request \Mainnet\Model\WalletNamedExistsRequest Request parameters

Return type

bool

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replaceNamed

bool replaceNamed($wallet_replace_named_request)

Replace (recover) named wallet with a new walletId. If wallet with a provided name does not exist yet, it will be creted with a walletId supplied If wallet exists it will be overwritten without exception

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$wallet_replace_named_request = new \Mainnet\Model\WalletReplaceNamedRequest(); // \Mainnet\Model\WalletReplaceNamedRequest | Request parameters

try {
    $result = $apiInstance->replaceNamed($wallet_replace_named_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->replaceNamed: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
wallet_replace_named_request \Mainnet\Model\WalletReplaceNamedRequest Request parameters

Return type

bool

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

send

\Mainnet\Model\SendResponse send($send_request)

Send some amount to a given address

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$send_request = new \Mainnet\Model\SendRequest(); // \Mainnet\Model\SendRequest | place a send request

try {
    $result = $apiInstance->send($send_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->send: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
send_request \Mainnet\Model\SendRequest place a send request

Return type

\Mainnet\Model\SendResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sendMax

\Mainnet\Model\SendMaxResponse sendMax($send_max_request)

Send all available funds to a given address

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$send_max_request = new \Mainnet\Model\SendMaxRequest(); // \Mainnet\Model\SendMaxRequest | Request to send all available funds to a given address

try {
    $result = $apiInstance->sendMax($send_max_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->sendMax: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
send_max_request \Mainnet\Model\SendMaxRequest Request to send all available funds to a given address

Return type

\Mainnet\Model\SendMaxResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

submitTransaction

\Mainnet\Model\SubmitTransactionResponse submitTransaction($submit_transaction_request)

submit an encoded and signed transaction to the network

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$submit_transaction_request = new \Mainnet\Model\SubmitTransactionRequest(); // \Mainnet\Model\SubmitTransactionRequest | submit an encoded and signed transaction to the network

try {
    $result = $apiInstance->submitTransaction($submit_transaction_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->submitTransaction: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
submit_transaction_request \Mainnet\Model\SubmitTransactionRequest submit an encoded and signed transaction to the network

Return type

\Mainnet\Model\SubmitTransactionResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tokenBurn

\Mainnet\Model\SendResponse tokenBurn($token_burn_request)

Perform an explicit token burn

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$token_burn_request = new \Mainnet\Model\TokenBurnRequest(); // \Mainnet\Model\TokenBurnRequest | Perform an explicit token burning by spending a token utxo to an OP_RETURN Behaves differently for fungible and non-fungible tokens:  * NFTs are always \"destroyed\"  * FTs' amount is reduced by the amount specified, if 0 FT amount is left and no NFT present, the token is \"destroyed\" Refer to spec https://github.com/bitjson/cashtokens

try {
    $result = $apiInstance->tokenBurn($token_burn_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->tokenBurn: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
token_burn_request \Mainnet\Model\TokenBurnRequest Perform an explicit token burning by spending a token utxo to an OP_RETURN Behaves differently for fungible and non-fungible tokens: * NFTs are always &quot;destroyed&quot; * FTs' amount is reduced by the amount specified, if 0 FT amount is left and no NFT present, the token is &quot;destroyed&quot; Refer to spec https://github.com/bitjson/cashtokens

Return type

\Mainnet\Model\SendResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tokenDepositAddress

\Mainnet\Model\DepositAddressResponse tokenDepositAddress($serialized_wallet)

Get a token aware deposit address in cash address format

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | Request for a token aware deposit address given a wallet

try {
    $result = $apiInstance->tokenDepositAddress($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->tokenDepositAddress: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet Request for a token aware deposit address given a wallet

Return type

\Mainnet\Model\DepositAddressResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tokenDepositQr

\Mainnet\Model\ScalableVectorGraphic tokenDepositQr($serialized_wallet)

Get receiving token aware cash address as a qrcode

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | Request for a token aware deposit cash address as a Quick Response code (qrcode)

try {
    $result = $apiInstance->tokenDepositQr($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->tokenDepositQr: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet Request for a token aware deposit cash address as a Quick Response code (qrcode)

Return type

\Mainnet\Model\ScalableVectorGraphic

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tokenGenesis

\Mainnet\Model\SendResponse tokenGenesis($token_genesis_request)

Create new token category

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$token_genesis_request = new \Mainnet\Model\TokenGenesisRequest(); // \Mainnet\Model\TokenGenesisRequest | Create new cashtoken, both funglible and/or non-fungible (NFT) Refer to spec https://github.com/bitjson/cashtokens Newly created token identifier can be found in `tokenIds` field.

try {
    $result = $apiInstance->tokenGenesis($token_genesis_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->tokenGenesis: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
token_genesis_request \Mainnet\Model\TokenGenesisRequest Create new cashtoken, both funglible and/or non-fungible (NFT) Refer to spec https://github.com/bitjson/cashtokens Newly created token identifier can be found in `tokenIds` field.

Return type

\Mainnet\Model\SendResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

tokenMint

\Mainnet\Model\SendResponse tokenMint($token_mint_request)

Mint new non-fungible tokens

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$token_mint_request = new \Mainnet\Model\TokenMintRequest(); // \Mainnet\Model\TokenMintRequest | Mint new NFT cashtokens using an existing minting token Refer to spec https://github.com/bitjson/cashtokens Newly minted tokens will retain the parent's `tokenId`.

try {
    $result = $apiInstance->tokenMint($token_mint_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->tokenMint: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
token_mint_request \Mainnet\Model\TokenMintRequest Mint new NFT cashtokens using an existing minting token Refer to spec https://github.com/bitjson/cashtokens Newly minted tokens will retain the parent's `tokenId`.

Return type

\Mainnet\Model\SendResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

utxos

\Mainnet\Model\Utxo[] utxos($serialized_wallet)

Get detailed information about unspent outputs (utxos)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$serialized_wallet = new \Mainnet\Model\SerializedWallet(); // \Mainnet\Model\SerializedWallet | Request detailed list of unspent transaction outputs

try {
    $result = $apiInstance->utxos($serialized_wallet);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->utxos: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
serialized_wallet \Mainnet\Model\SerializedWallet Request detailed list of unspent transaction outputs

Return type

\Mainnet\Model\Utxo[]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

xpubkeys

\Mainnet\Model\XPubKeyResponse xpubkeys($x_pub_key_request)

A set of xpubkeys and paths for the wallet.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Mainnet\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Mainnet\Api\WalletApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_pub_key_request = new \Mainnet\Model\XPubKeyRequest(); // \Mainnet\Model\XPubKeyRequest | x

try {
    $result = $apiInstance->xpubkeys($x_pub_key_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WalletApi->xpubkeys: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
x_pub_key_request \Mainnet\Model\XPubKeyRequest x

Return type

\Mainnet\Model\XPubKeyResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]