Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marchon/502ad27d7acfe9beed3501a7c8fca9d3 to your computer and use it in GitHub Desktop.
Save marchon/502ad27d7acfe9beed3501a7c8fca9d3 to your computer and use it in GitHub Desktop.
Simple steps to start a Stellar Gateway

You can become your own gateway in two simple steps! Here we'll show how easy it is to issue your own currency on the Stellar network.

Extending trust & issuing credit

1: A user extends trust to your gateway account for a "maximum" amount of your currency. Remember, they're trusting you'll honor whatever your currency represents when they give it back to you.

$ curl -X POST https://test.stellar.org:9002  -d '
{
    "method": "submit",
    "params": [
        {
            "secret": "<USER_SECRET>",
            "tx_json": {
                "Account": "<USER_ACCOUNT>",
                "LimitAmount": {
                    "currency": "USD",
                    "issuer": "<GATEWAY_ACCOUNT>",
                    "value": 30
                },
                "TransactionType": "TrustSet"
            }
        }
    ]
}
'

2: Now, you'll issue your credits (currency) to the user (presumably after they've given you something in the real world!).

$ curl -X POST https://test.stellar.org:9002  -d '
{
    "method": "submit",
    "params": [
        {
            "secret": "<GATEWAY_SECRET>",
            "tx_json": {
                "Account": "<GATEWAY_ACCOUNT>",
                "Amount": {
                    "currency": "USD",
                    "issuer": "<GATEWAY_ACCOUNT>",
                    "value": 30
                },
                "Destination": "<USER_ACCOUNT>",
                "TransactionType": "Payment"
            }
        }
    ]
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment