node package manager

stellar-sandbox

Stellar sandbox

This package is a sandbox for working around with stellar.

It contains code to create an anchor, federation server and anchor resolution service.

Federation

GET /federation

Resolve Stellar federation addresses

Query params:

  • q: Real world address or Stellar address
  • type: [name, id, keypair]
    • name: search by federation address or by account ID
    • id: search by account ID
    • keypair: resolve account_id + seed from federation_address + password
  • password: (optional) Password when fetching keypair

Examples:

localhost:3000/federation?q=pac*ngfar.io&type=name

localhost:3000/federation?q=GCR24ALUHA3SMI4W4D7MDSF53BUFHWYYPZZRB44BTC5ZDQPFIR5W4NVM&type=id

localhost:3000/federation?q=pac*ngfar.io&password=mypassword&type=keypair

PUT /federation

Register a federation address. The user that wants to register must sign the request.

An account ID can only have one federation address associated.

Body content:

  • federation_address Federation address to store
  • account_id Account ID to store

Headers:

  • signature Signature of data with Keypair.

Example

curl -X PUT -H "Content-Type: application/json" -H "signature: i0S/MPl9x9BKWHC46SsxKhz6i1CBLXML1/Tl575VBjhMSCEq67DQMP6NzeZvQh9CfqsU6MIezd5G2Y5q8HzYAw==" -d '{ 
  "account_id": "GCCTVV6FT2ZEB2TMY25GND6S4T2N3IS76F5RK3Z2MXD4IBQKRMZGOV6V",
  "federation_address": "roberto*ngfar.io"
}
' "http://localhost:3000/federation"

DELETE /federation

Removes an account from federation server (federation or account ID)

Body content:

  • federation_address Stellar address to remove

Headers:

  • signature Signature of data with Keypair.

Account Manager

POST /federation

Creates a stellar account with encrypted seed and register to federation (testnet)

Body content:

  • federation_address Federation address
  • password Account password

PATCH /federation

Patches a stellar account to store its encrypted seed with password in the account data

Body content:

  • seed Seed of the account to patch
  • password Password to set

Wilson, the Anchor asset resolver

Wilson is a kind cosmonaut that serves as translator between different anchors. If you want to deposit or withdraw any kind of assets, tell him which one and where you want to receive the funds and it will give you back a payment address.

GET /resolution

Resolve anchor address for deposit/withdrawals

Query params:

  • q: Real world address or Stellar address
  • issuer: Asset issuer address
  • code: Asset code
  • type: [deposit, withdraw, info]
    • deposit: you give a stellar address and he gives you a real-world address to deposit your funds.
    • withdraw: you give the address where you want to get real-world assets and he gives you a stellar address to send your assets
    • info: give you info about the asset's anchor Examples:

Deposit to NaoBTC

localhost:3000/federation?type=deposit&issuer=GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH&code=BTC&q=GDG4LKMTODR227EQQXKHAWIOYBLNGXRJEW6TJTNQ766UUGVMFWDGAVT6

Withdraw from Stellereum

localhost:3000/resolution?type=withdraw&issuer=GDIR44J6EE3SVP4OAOAF7FAJGBXIHELRKHGC3RFAYXDE4I73S6ZNNW2F&code=ETH&q=0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae

Info about Stellereum

localhost:3000/resolution?type=info&issuer=GDIR44J6EE3SVP4OAOAF7FAJGBXIHELRKHGC3RFAYXDE4I73S6ZNNW2F&code=ETH


GET /resolution?type=list

Return list of supported anchors

StellarAnchor

OUTDATED