Zeph Logo
MenuClose
Zephyr Protocol Integration

Basic guide

Zephyr Protocol Documentation

As Zephyr is a Monero fork; it has both a daemon-RPC and a wallet-RPC.

Wallet RPC: https://www.zephyrprotocol.com/documentation/wallet-rpcDaemon RPC: https://www.zephyrprotocol.com/documentation/daemon-rpcExchanges/Other Integrations: If you already support or are familiar with Monero then the integration for Zephyr Protocol is very similar; with some important key differences.

Quick Overview/Important Information

Zephyr has four Native assets:

- Zephyr (Main/Base Coin)
- Zephyr Stable Dollar (Stable Coin)
- Zephyr Reserve Share (Reserve Coin)
- Zephyr Yield Share (ZSD Yield Coin)
Native assets are differentiated by asset_type.
Post-Audit: (Hardfork v11/v2.3.0)+
TickerNameasset_type
$ZEPHZephyrZPH
$ZSDZephyr Stable DollarZSD
$ZRSZephyr Reserve ShareZRS
$ZYSZephyr Yield ShareZYS
Note: "ZPH" is the asset_type for $ZEPH (Zephyr). This is to differentiate it from the old/unaudited "ZEPH" asset_type.
Supporting any Zephyr asset ($ZEPH, $ZSD, $ZRS or $ZYS) is as simple as checking and accounting for the asset_type field.
Even if you are only adding $ZEPH, you still need to check forasset_type == "ZPH" to ensure that ZSD/ZRS/ZYS transactions are not creditted as $ZEPH.
Pre-Audit asset_type Information:
Zephyr Protocol has undergone an audit and therefore we now use the asset_types above.
Old/Unaudited asset_typeNew/Audited asset_type
ZEPHZPH
ZEPHUSDZSD
ZEPHRSVZRS
ZYIELDZYS
Note: It is no longer possible to send/receive unaudited assets. They are effectively invalid and unusable - but techincally still exist.

Running RPC Wallet:

zephyr-wallet-rpc allows you to interact with the Zephyr wallet. You must also run the Zephyr daemon (zephyrd) in order to use the wallet.
Example command to run the RPC wallet:
copy
./zephyr-wallet-rpc --rpc-bind-port 17777 --disable-rpc-login --wallet-file <WALLET_NAME> --password <YOUR_PASSWORD> --daemon-address 127.0.0.1:17767 --trusted-daemon

Managing Deposits/transactions:

A typical approach to managing deposits/transactions is to use the get_transfer_by_txid method:https://www.zephyrprotocol.com/documentation/wallet-rpc#get_transfer_by_txidImportant: asset_type == "ZPH" || "ZSD" || "ZRS" || "ZYS".Example Call:
copy
curl http://localhost:17777/json_rpc -d '{ "jsonrpc":"2.0", "id":"0", "method":"get_transfer_by_txid", "params":{ "txid":"ea51d898065d145e29df9d933cf5879c9a0d28f27f54b8a22fd4c5bc350e752c" } }' -H 'Content-Type: application/json'
Example Response:
copy
{ "id": "0", "jsonrpc": "2.0", "result": { "transfer": { "address": "ZEPHs6xVWGFWTfEYJsJUFDPU4KxxvQmpmeFuw78x4L2vPHBbWtMtbhdLJFMdiXEXBA1kFStyDMkrLYuEvgWyAtjA8PynYZNFBm1", "amount": 1000000000000, "amounts": [1000000000000], "asset_type": "ZPH", "confirmations": 58606, "double_spend_seen": false, "fee": 1260840000, "height": 3383, "locked": false, "note": "", "payment_id": "0000000000000000", "subaddr_index": { "major": 0, "minor": 1 }, "subaddr_indices": [{ "major": 0, "minor": 1 }], "suggested_confirmations_threshold": 1, "timestamp": 1685688983, "txid": "ea51d898065d145e29df9d933cf5879c9a0d28f27f54b8a22fd4c5bc350e752c", "type": "in", "unlock_time": 0 }, "transfers": [{ "address": "ZEPHs6xVWGFWTfEYJsJUFDPU4KxxvQmpmeFuw78x4L2vPHBbWtMtbhdLJFMdiXEXBA1kFStyDMkrLYuEvgWyAtjA8PynYZNFBm1", "amount": 1000000000000, "amounts": [1000000000000], "asset_type": "ZEPH", "confirmations": 58606, "double_spend_seen": false, "fee": 1260840000, "height": 3383, "locked": false, "note": "", "payment_id": "0000000000000000", "subaddr_index": { "major": 0, "minor": 1 }, "subaddr_indices": [{ "major": 0, "minor": 1 }], "suggested_confirmations_threshold": 1, "timestamp": 1685688983, "txid": "ea51d898065d145e29df9d933cf5879c9a0d28f27f54b8a22fd4c5bc350e752c", "type": "in", "unlock_time": 0 }] } }

Get Wallet Balance

Get your wallet balance using the get_balance method:https://www.zephyrprotocol.com/documentation/wallet-rpc#get_balanceE.G. "asset_type":"ZPH" - or pass in no params to get the balance of all asset_types
copy
curl http://127.0.0.1:17777/json_rpc -d '{ "jsonrpc":"2.0", "id":"0", "method":"get_balance", "params":{"asset_type":"ZPH"} }' -H 'Content-Type: application/json'
copy
{ "id": "0", "jsonrpc": "2.0", "result": { "balances": [{ "asset_type": "ZPH", "balance": 213905531498710183, "blocks_to_unlock": 0, "multisig_import_needed": false, "per_subaddress": [{ "account_index": 0, "address": "ZPHTje79Hf22DpoBFrjhPXDXz9M3Dgx4Q6DPEYxZLziGTx1AVSV6uvbYmdCarUL5ABF5hJQZZzEu23PKzqJuC8p4Y8eC6S7BpuB", "address_index": 0, "balance": 213905531498710183, "blocks_to_unlock": 0, "label": "Primary account", "num_unspent_outputs": 6, "time_to_unlock": 0, "unlocked_balance": 213905531498710183 }], "time_to_unlock": 0, "unlocked_balance": 213905531498710183 }] } }

Transfer (Withdraw/Conversion/Send) a Transaction:

By default source_asset and destination_asset is set to "ZPH" ($ZEPH/Zephyr).
To enable withdrawing ZSD from an exchange the source_asset and destination_assetwill need to be set to "ZSD"
Note: Conversions between asset_types are done by the Transfer method too.
This is done by setting the source_asset and destination_asset to different asset_types.
https://www.zephyrprotocol.com/documentation/wallet-rpc#transfer

Example: Send 1 $ZEPH

Use the transfer method to send 1 $ZEPH (with asset_type: "ZPH") to a recipient address:
copy
curl http://127.0.0.1:17777/json_rpc -d '{ "jsonrpc": "2.0", "id": "0", "method": "transfer", "params": { "destinations": [ { "address": "ZEPHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "amount": 1000000000000 } ], "source_asset": "ZPH", "destination_asset": "ZPH" } }' -H 'Content-Type: application/json'
Note: Amounts are in atomic units. 1 $ZEPH = 1000000000000 (1 trillion/10^12 atomic units).
Replace ZEPHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX with your recipients address.
Blog & News

The thinking, ideas, and technology

Join the Zephyr Protocol now

Zeph Logo
Design & DevSimtech SolutionsArrow Up
© 2024 Zephyr Protocol, All Rights Reserved