diff --git a/docs/api/auth.mdx b/docs/api/auth.mdx index cab7bf8e..f0b42a3a 100644 --- a/docs/api/auth.mdx +++ b/docs/api/auth.mdx @@ -1,6 +1,6 @@ --- id: auth -title: Get an authentication token +title: Authentication slug: /api/auth --- @@ -12,7 +12,7 @@ There are multiple ways to obtain an auth token to be used with the API. ## Log in with email through the REST API :::tip -Make sure you have [registered your email address](/api/start#set-up-the-email-login) in the Blink app to use this method. +Make sure you have [registered your email address](/api/start#add-an-email-address) in the Blink app to use this method. ::: @@ -26,7 +26,9 @@ The authentication token provides access to your wallet balance, save it securel Use it to make authenticated requests on the next pages or set it in the header as `Authorization` `Bearer `. ::: -## Copy the token from the Blink app +--- + +## Copy the authentication token from the Blink app * `Create new account`, `Start with trial account` or `Log back in with Phone or Email` * tap the menu on the top right and scroll down diff --git a/docs/api/b-usd-ln-receive.mdx b/docs/api/b-usd-ln-receive.mdx deleted file mode 100644 index e4560305..00000000 --- a/docs/api/b-usd-ln-receive.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -id: usd-ln-receive -title: Receive USD on Lightning -slug: /api/usd-ln-receive ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataUsd } from '/src/components/apiTutorial/GetWalletDataUsd'; -import { LnUsdInvoiceCreate } from '/src/components/apiTutorial/LnUsdInvoiceCreate'; -import { GetBalance } from '/src/components/apiTutorial/GetBalance'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Generate a Stablesats invoice - -Using Stablesats a merchant can generate invoices denominated in USD cents.
-Use the `paymentRequest` from the response and pay it with a lightning wallet.
-The satoshi amount of the invoice will reflect the current USD/BTC exchange rate and the balance will be kept at the dollar value. - -**The body of the GraphQL request** - -```graphql -mutation lnUsdInvoiceCreate($input: LnUsdInvoiceCreateInput!) { - lnUsdInvoiceCreate(input: $input) { - invoice { - paymentRequest - paymentHash - paymentSecret - satoshis - } - errors { - message - } - } -} -``` - - - ---- - -### Once paid check the balance again - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - walletCurrency - balance - } - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ed78e464-9874-4bf7-9b7b-92e5a898db83) to find examples in multiple programming languages. -::: diff --git a/docs/api/c-usd-ln-send.mdx b/docs/api/c-usd-ln-send.mdx deleted file mode 100644 index 187065cd..00000000 --- a/docs/api/c-usd-ln-send.mdx +++ /dev/null @@ -1,94 +0,0 @@ ---- -id: usd-ln-send -title: Send USD over Lightning -slug: /api/usd-ln-send ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataUsd } from '/src/components/apiTutorial/GetWalletDataUsd'; -import { LnUsdInvoiceFeeProbe } from '/src/components/apiTutorial/LnUsdInvoiceFeeProbe'; -import { LnInvoicePaymentSend } from '/src/components/apiTutorial/LnInvoicePaymentSend'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Estimate the payment fee (probe) - -Estimate the cost of paying a lightning invoice.
-Payments to an other Blink user and to nodes with a direct channel are free. - -**The body of the GraphQL request** - -```graphql -mutation lnUsdInvoiceFeeProbe($input: LnUsdInvoiceFeeProbeInput!) { - lnUsdInvoiceFeeProbe(input: $input) { - errors { - message - } - amount - } -} -``` - - - ---- - -### Pay a lightning invoice - -Pay a BOLT11 invoice from your USD balance. - -**The body of the GraphQL request** - -```graphql -mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) { - lnInvoicePaymentSend(input: $input) { - status - errors { - message - path - code - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ed78e464-9874-4bf7-9b7b-92e5a898db83) to find examples in multiple programming languages. -::: diff --git a/docs/api/d-btc-ln-receive.mdx b/docs/api/d-btc-ln-receive.mdx deleted file mode 100644 index b92efbd8..00000000 --- a/docs/api/d-btc-ln-receive.mdx +++ /dev/null @@ -1,95 +0,0 @@ ---- -id: btc-ln-receive -title: Receive BTC on Lightning -slug: /api/btc-ln-receive ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataBtc } from '/src/components/apiTutorial/GetWalletDataBtc'; -import { LnInvoiceCreate } from '/src/components/apiTutorial/LnInvoiceCreate'; -import { GetBalance } from '/src/components/apiTutorial/GetBalance'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - ---- - -### Generate a lightning invoice -Receive satoshis to your BTC balance.
-Use the `paymentRequest` from the response and pay it with a lightning wallet. - -**The body of the GraphQL request** - -```graphql -mutation LnInvoiceCreate($input: LnInvoiceCreateInput!) { - lnInvoiceCreate(input: $input) { - invoice { - paymentRequest - paymentHash - paymentSecret - satoshis - } - errors { - message - } - } -} -``` - - - ---- - -### Once paid check the balance again - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - walletCurrency - balance - } - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ac3751d8-c116-408b-9129-d6e365da590b) to find examples in multiple programming languages. -::: diff --git a/docs/api/e-btc-ln-send.mdx b/docs/api/e-btc-ln-send.mdx deleted file mode 100644 index 57114c4c..00000000 --- a/docs/api/e-btc-ln-send.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -id: btc-ln-send -title: Send BTC over Lightning -slug: /api/btc-ln-send ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataBtc } from '/src/components/apiTutorial/GetWalletDataBtc'; -import { LnInvoiceFeeProbe } from '/src/components/apiTutorial/LnInvoiceFeeProbe'; -import { LnInvoicePaymentSend } from '/src/components/apiTutorial/LnInvoicePaymentSend'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - ---- - -### Estimate the payment fee (probe) - -Estimate the cost of paying a lightning invoice.
-Payments to an other Blink user and to nodes with a direct channel are free. - -**The body of the GraphQL request** - -```graphql -mutation lnInvoiceFeeProbe($input: LnInvoiceFeeProbeInput!) { - lnInvoiceFeeProbe(input: $input) { - errors { - message - } - amount - } -} -``` - - - ---- - -### Pay a lightning invoice - -Pay a BOLT11 invoice from your BTC balance. - -**The body of the GraphQL request** - -```graphql -mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) { - lnInvoicePaymentSend(input: $input) { - status - errors { - message - path - code - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ac3751d8-c116-408b-9129-d6e365da590b) to find examples in multiple programming languages. -::: diff --git a/docs/api/f-usd-onchain-receive.mdx b/docs/api/f-usd-onchain-receive.mdx deleted file mode 100644 index 7f50ad44..00000000 --- a/docs/api/f-usd-onchain-receive.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -id: usd-onchain-receive -title: Receive USD onchain -slug: /api/usd-onchain-receive ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataUsd } from '/src/components/apiTutorial/GetWalletDataUsd'; -import { OnChainAddressCreateUsd } from '/src/components/apiTutorial/OnChainAddressCreateUsd'; -import { GetBalanceWithPending } from '/src/components/apiTutorial/GetBalanceWithPending'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Generate a new address to receive USD - -Using Stablesats a merchant can generate and onchain address where the bitcoin received will be denominated in USD cents.
-Use the `address` from the response and send to it from any bitcoin wallet.
-The received satoshi amount will reflect the USD/BTC exchange rate at the time it was received and the balance will be kept at the dollar value. - -**The body of the GraphQL request** - -```graphql -mutation onChainAddressCreate($input: OnChainAddressCreateInput!) { - onChainAddressCreate(input: $input) { - address - errors { - message - } - } -} -``` - - - ---- - -### Once paid check the balance again - -The balance will be updated once the transaction is confirmed on the blockchain.
-Until the confirmation the new incoming amount will show in the `pendingIncomingBalance` field. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - walletCurrency - balance - pendingIncomingBalance - } - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ed78e464-9874-4bf7-9b7b-92e5a898db83) to find examples in multiple programming languages. -::: diff --git a/docs/api/g-usd-onchain-send.mdx b/docs/api/g-usd-onchain-send.mdx deleted file mode 100644 index 5e8aaad7..00000000 --- a/docs/api/g-usd-onchain-send.mdx +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: usd-onchain-send -title: Send USD onchain -slug: /api/usd-onchain-send ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataUsd } from '/src/components/apiTutorial/GetWalletDataUsd'; -import { OnChainUsdTxFee } from '/src/components/apiTutorial/OnChainUsdTxFee'; -import { OnChainUsdPaymentSend } from '/src/components/apiTutorial/OnChainUsdPaymentSend'; -import { OnChainUsdPaymentSendAsBtcDenominated } from '/src/components/apiTutorial/OnChainUsdPaymentSendAsBtcDenominated'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Estimate - -Estimate how many satoshis the transaction will cost. - -**The body of the GraphQL request** - -```graphql -query onChainUsdTxFee($walletId: WalletId!, $address: OnChainAddress!, $amount: CentAmount!) { - onChainUsdTxFee(walletId: $walletId, address: $address, amount: $amount) { - amount - } -} -``` - - - -### Send a transaction in USD cents - -Send a transaction onchain from your USD account with the amount denominated in USD cents.
-The satoshi amount will be calculated based on the current exchange rate. - -**The body of the GraphQL request** - -```graphql -mutation onChainPaymentSend($input: OnChainPaymentSendInput!) { - onChainPaymentSend(input: $input) { - errors { - message - } - status - } -} -``` - - - ---- - -### Send a transaction in satoshis - -Send a transaction onchain from your USD account with the amount denominated in satoshis.
- -**The body of the GraphQL request** - -```graphql -mutation onChainUsdPaymentSendAsBtcDenominated($input: OnChainUsdPaymentSendAsBtcDenominatedInput!) { - onChainUsdPaymentSendAsBtcDenominated(input: $input) { - errors { - message - } - status - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ed78e464-9874-4bf7-9b7b-92e5a898db83) to find examples in multiple programming languages. -::: diff --git a/docs/api/h-btc-onchain-receive.mdx b/docs/api/h-btc-onchain-receive.mdx deleted file mode 100644 index 64ecb641..00000000 --- a/docs/api/h-btc-onchain-receive.mdx +++ /dev/null @@ -1,95 +0,0 @@ ---- -id: btc-onchain-receive -title: Receive BTC onchain -slug: /api/btc-onchain-receive ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataBtc } from '/src/components/apiTutorial/GetWalletDataBtc'; -import { OnChainAddressCreateBtc } from '/src/components/apiTutorial/OnChainAddressCreateBtc'; -import { GetBalanceWithPending } from '/src/components/apiTutorial/GetBalanceWithPending'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Generate a new address to receive BTC -Receive satoshis to your BTC balance.
-Use the `address` from the response and send to it from any bitcoin wallet. - -**The body of the GraphQL request** - -```graphql -mutation onChainAddressCreate($input: OnChainAddressCreateInput!) { - onChainAddressCreate(input: $input) { - address - errors { - message - } - } -} -``` - - - ---- - -### Once paid check the balance again - -The balance will be updated once the transaction is confirmed on the blockchain.
-Until the confirmation the new incoming amount will show in the `pendingIncomingBalance` field. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - walletCurrency - balance - pendingIncomingBalance - } - } - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ac3751d8-c116-408b-9129-d6e365da590b) to find examples in multiple programming languages. -::: diff --git a/docs/api/k-btc-onchain-send.mdx b/docs/api/k-btc-onchain-send.mdx deleted file mode 100644 index a4b9f465..00000000 --- a/docs/api/k-btc-onchain-send.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: btc-onchain-send -title: Send BTC onchain -slug: /api/btc-onchain-send ---- - -import { AuthProvider } from '/src/components/apiTutorial/AuthContext'; -import { SetApiEndpoint } from '/src/components/apiTutorial/SetApiEndpoint'; -import { SetAuthToken } from '/src/components/apiTutorial/SetAuthToken'; -import { GetWalletDataUsd } from '/src/components/apiTutorial/GetWalletDataUsd'; -import { OnChainTxFee } from '/src/components/apiTutorial/OnChainTxFee'; -import { OnChainPaymentSend } from '/src/components/apiTutorial/OnChainPaymentSend'; - - - - - - - -### Get the wallet IDs and check the balances - -Can run this query at any stage to confirm the change in the balances.
-The "BTC" wallet balance is denominated in satoshis.
-The "USD" wallet balance is in cents. - -**The body of the GraphQL request** - -```graphql -query Me { - me { - defaultAccount { - wallets { - id - walletCurrency - balance - } - } - } -} -``` - - - ---- - -### Estimate - -Estimate how many satoshis the transaction will cost. - -**The body of the GraphQL request** - -```graphql -query onChainTxFee($walletId: WalletId!, $address: OnChainAddress!, $amount: SatAmount!) { - onChainTxFee(walletId: $walletId, address: $address, amount: $amount) { - amount - } -} -``` - - - ---- - -### Send a transaction - -Send a transaction onchain from your BTC account. - -**The body of the GraphQL request** - -```graphql -mutation onChainUsdPaymentSend($input: OnChainUsdPaymentSendInput!) { - onChainUsdPaymentSend(input: $input) { - errors { - message - } - status - } -} -``` - - - -
- -:::tip -To test the GraphQL requests further use the GraphQL playground at [api.blink.sv/graphql](https://api.blink.sv/graphql) for mainnet or [api.staging.galoy.io/graphql](https://api.staging.galoy.io/graphql) for staging. -Can also use the [Galoy API Postman collection](https://documenter.getpostman.com/view/29391384/2s9YCAQq3z#ac3751d8-c116-408b-9129-d6e365da590b) to find examples in multiple programming languages. -::: diff --git a/docs/api/start.md b/docs/api/start.md index c0891c97..7342b375 100644 --- a/docs/api/start.md +++ b/docs/api/start.md @@ -10,19 +10,26 @@ slug: /api/start * visit [get.blink.sv](https://get.blink.sv) for the App Store / Google Play / App Gallery links * or download the Android apk from [github.com/GaloyMoney/galoy-mobile/releases](https://github.com/GaloyMoney/galoy-mobile/releases) -## Set up the email login -### Upgrade the account with a phone number -* select the menu on the top right and tap `Account` -* `Backup/upgrade account` -* complete the Account set up with a phone number +--- -### Add an email address for login +## Add a phone number +* `Create a new account` with a phone number +* or if you have started with a `Trial account` + * select the menu on the top right and tap `Account` + * select `Backup/upgrade account` + * complete the account set up with a phone number + +--- + +## Add an email address * only available if a phone number was added previously * select the menu on the top right and tap `Account` * select `Email (for login)` * enter an email address and complete the verification to enable login with email * now can delete the phone number if desired +--- + ## For testing and development connect to our Staging environment :::note New registrations to the staging environment are currently limited. Please contact us on our Community Mattermost Server on [chat.galoy.io](https://chat.galoy.io) to request access. diff --git a/docs/intro.md b/docs/intro.md index 8a76601e..bb76120b 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -44,14 +44,14 @@ A detailed FAQ entry on [pricing](https://faq.blink.sv/transaction-fees/what-are * **Open source** – Transition to self-hosted * **USD-enabled** – Synthetic USD via Stablesats. Dive deeper on [stablesats.com](https://stablesats.com/) -## Get started: [Register in 2 minutes](/api/start) +## Get started: [register in 2 minutes](/api/start) ➡️ Registering and logging into the Blink API is simple and can be done in under a minute. * Register account with phone number (note: unavailable in the US and some other countries) * Add email for 2FA * Start building! -## Interactive tutorials: [Try it out](/api#-tutorials) +## Interactive tutorials: [try it out](/api#-tutorials) 🧪 API integration made easy Sending and receiving Bitcoin and Stablesats via API is simple, and available using both Lightning and onchain. Check out these simple interactive tutorials: @@ -67,8 +67,6 @@ Blink is built on the Galoy open source bitcoin banking stack.
When you're ready, you can host the API on your own terms and seamlessly transition everything to your own infrastructure.
Visit [dev.galoy.io](https://dev.galoy.io) for more information on our open-source offerings. -[Join our Mattermost](https://chat.galoy.io/) - -[Start with the API](https://dev.blink.sv/api/start) +## [Join our Mattermost](https://chat.galoy.io/) Join us in enabling a Bitcoin-powered future with the Blink API powered by Galoy!