Skip to content

Instantly share code, notes, and snippets.

@vindard
Last active March 29, 2022 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vindard/2415974ffb1c138bedfe175e5d3e483f to your computer and use it in GitHub Desktop.
Save vindard/2415974ffb1c138bedfe175e5d3e483f to your computer and use it in GitHub Desktop.
Galoy graphql api demo for #LightningHackdayIST

Description

This gist contains 3 files that can be imported into postman to play with our api:

  • grapqhql_api collection which has our queries and mutations
  • devnet environment variables for local testing (uses regtest network)
  • staging environment variables for testing against our staging endpoint (uses testnet network)
{
"id": "b83e4600-64ca-4bed-addf-57213f5811e8",
"name": "1. devnet",
"values": [
{
"key": "protocol",
"value": "http",
"enabled": true
},
{
"key": "domain",
"value": "localhost",
"enabled": true
},
{
"key": "port",
"value": "4002",
"enabled": true
},
{
"key": "currency",
"value": "BTC",
"enabled": true
},
{
"key": "phone",
"value": "+16505554322",
"enabled": true
},
{
"key": "code",
"value": "321432",
"enabled": true
},
{
"key": "token",
"value": "",
"enabled": true
},
{
"key": "walletId",
"value": "",
"enabled": true
},
{
"key": "testnet-p2pkh-address",
"value": "mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt",
"enabled": true
},
{
"key": "testnet-p2sh-address",
"value": "2NGYHfoNUterKvuLVyVU5npmJPKmBwtoMzu",
"enabled": true
},
{
"key": "testnet-segwitV0-address",
"value": "tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt",
"enabled": true
},
{
"key": "twoFASecret",
"value": "",
"type": "any",
"enabled": true
},
{
"key": "walletIdUsd",
"value": "",
"type": "any",
"enabled": true
},
{
"key": "walletIdBtc",
"value": "",
"type": "any",
"enabled": true
},
{
"key": "regtest-segwitV0-address",
"value": "bcrt1qy7msr5csmlmcwfqpafzvaapjr29ez9y40h40ge",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2022-03-08T19:07:59.750Z",
"_postman_exported_using": "Postman/9.14.11"
}
{
"info": {
"_postman_id": "36c8cbc6-1fd8-420b-9748-88a71a271c35",
"name": "graphql_api",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "notoken",
"item": [
{
"name": "queries",
"item": [
{
"name": "prices",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "# Write your query or mutation here\nquery btcPriceList($range: PriceGraphRange!) {\n btcPriceList(range: $range) {\n \ttimestamp\n price {\n base\n offset\n currencyUnit\n formattedAmount\n }\n }\n}\n",
"variables": "{\"range\": \"ONE_DAY\"}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "mobileVersions",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var moment = require('moment')",
"",
"pm.test(\"validate build parameters are set\", function () {",
" if (pm.environment.name != \"devnet\") {",
" const jsonData = pm.response.json();",
" const {commitHash, buildTime} = jsonData.data.buildParameters",
" pm.expect(commitHash.length).to.eql(40);",
" pm.expect(buildTime.substring(0,4)).to.eql(\"2020\")",
" }",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query mobileVersions {\n mobileVersions {\n platform\n currentSupported\n minSupported\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "nodesIds",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"validate build parameters are set\", function () {",
" if (pm.environment.name != \"devnet\") {",
" const jsonData = pm.response.json();",
" const {peersCount, channelsCount} = jsonData.data.nodeStats",
" pm.expect(peersCount).to.be.above(1);",
" pm.expect(channelsCount).to.be.above(2);",
" }",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query globals {\n globals {\n nodesIds\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "earnList",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query quizQuestions {\n quizQuestions {\n id\n earnAmount\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "usernameExists",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"expect usernameExists to return true for test username\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.data.usernameExists).to.be(true);",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query usernameAvailable($username: Username!) {\n usernameAvailable(username: $username)\n}",
"variables": "{\n \"username\": \"xyz\"\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
]
},
{
"name": "mutations",
"item": [
{
"name": "requestPhoneCode",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting a code\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.data.requestPhoneCode.success).to.eql(true);",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation userRequestAuthCode($input: UserRequestAuthCodeInput!) {\n userRequestAuthCode(input: $input) {\n success\n }\n}",
"variables": "{\n \"input\": {\n \"phone\": \"{{phone}}\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "userLogin",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting a token\", function () {",
" const jsonData = pm.response.json();",
" const token = jsonData.data.userLogin.authToken",
" // token should have two dot \".\"",
" const parts = token.split(\".\")",
" pm.expect(parts.length).to.eql(3);",
" pm.environment.set(\"token\", token)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation userLogin($input: UserLoginInput!) {\n userLogin(input: $input) {\n authToken\n }\n}",
"variables": "{\n \"input\": {\n \"phone\": \"{{phone}}\",\n \"code\": \"{{code}}\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "addPublicInvoice",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"invoice starts with lnbcrt\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.data.publicInvoice.addInvoice.slice(0,6)).to.be('lnbcrt');",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation publicInvoice ($username: String) {\n publicInvoice (username: $username) {\n addInvoice\n }\n}",
"variables": "{\n \"username\": \"xyz\"\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
]
}
]
},
{
"name": "token",
"item": [
{
"name": "queries",
"item": [
{
"name": "me",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting me data\", function () {",
" const jsonData = pm.response.json();",
" const walletId = jsonData.data.me.defaultAccount.defaultWalletId",
" // walletId should have 5 groups separated by dashes \"-\"",
" const parts = walletId.split(\"-\")",
" pm.expect(parts.length).to.eql(5);",
" pm.environment.set(\"walletId\", walletId)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query me {\n me {\n id\n phone\n username\n language\n quizQuestions {\n question {\n id\n earnAmount\n }\n completed\n }\n contacts {\n id\n username\n alias\n transactionsCount\n }\n twoFAEnabled\n createdAt\n defaultAccount {\n id\n defaultWalletId\n wallets {\n id\n walletCurrency\n balance\n }\n }\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "balance",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query me {\n me {\n defaultAccount {\n wallets {\n walletCurrency\n balance\n }\n }\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "contacts",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query me {\n me {\n contacts {\n id\n username\n alias\n transactionsCount\n }\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "quiz questions",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query me {\n me {\n quizQuestions {\n question {\n id\n earnAmount\n }\n completed\n }\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "transactions",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query transactionsListForContact($first: Int, $after: String) {\n me {\n defaultAccount {\n wallets {\n walletCurrency\n transactions(first: $first, after: $after) {\n pageInfo {\n hasNextPage\n }\n edges {\n cursor\n node {\n __typename\n id\n settlementAmount\n settlementFee\n status\n direction\n settlementPrice {\n base\n offset\n # currencyUnit\n # formattedAmount\n }\n memo\n createdAt\n initiationVia {\n ... on InitiationViaOnChain {\n __typename\n address\n }\n ... on InitiationViaLn {\n __typename\n paymentHash\n }\n ... on InitiationViaIntraLedger {\n __typename\n counterPartyWalletId\n counterPartyUsername\n }\n }\n settlementVia {\n ... on SettlementViaOnChain {\n __typename\n transactionHash\n }\n ... on SettlementViaLn {\n __typename\n paymentSecret\n preImage\n }\n ... on SettlementViaIntraLedger {\n __typename\n counterPartyWalletId\n counterPartyUsername\n }\n }\n }\n }\n }\n }\n }\n }\n}\n",
"variables": "{\n \"first\": 10,\n \"after\": null\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "main query",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting me data\", function () {",
" const jsonData = pm.response.json();",
" const walletId = jsonData.data.me.defaultAccount.defaultWalletId",
" // walletId should have 5 groups separated by dashes \"-\"",
" const parts = walletId.split(\"-\")",
" pm.expect(parts.length).to.eql(5);",
" pm.environment.set(\"walletId\", walletId)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query mainQuery($hasToken: Boolean!) {\n globals {\n nodesIds\n __typename\n }\n quizQuestions {\n id\n earnAmount\n __typename\n }\n me @include(if: $hasToken) {\n id\n language\n username\n phone\n quizQuestions {\n question {\n id\n earnAmount\n __typename\n }\n completed\n __typename\n }\n defaultAccount {\n id\n defaultWalletId\n wallets {\n id\n balance\n walletCurrency\n transactions(first: 3) {\n ...TransactionList\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n mobileVersions {\n platform\n currentSupported\n minSupported\n __typename\n }\n}\n\nfragment TransactionList on TransactionConnection {\n pageInfo {\n hasNextPage\n __typename\n }\n edges {\n cursor\n node {\n __typename\n id\n status\n direction\n memo\n createdAt\n settlementAmount\n settlementFee\n settlementPrice {\n base\n offset\n __typename\n }\n initiationVia {\n __typename\n ... on InitiationViaIntraLedger {\n counterPartyUsername\n __typename\n }\n ... on InitiationViaLn {\n paymentHash\n __typename\n }\n }\n settlementVia {\n __typename\n ... on SettlementViaIntraLedger {\n counterPartyUsername\n __typename\n }\n ... on SettlementViaLn {\n paymentSecret\n __typename\n }\n }\n }\n __typename\n }\n __typename\n}",
"variables": "{\n \"hasToken\": true\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "userDefaultWalletId",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query userDefaultWalletId($username: Username!) {\n userDefaultWalletId(username: $username)\n }",
"variables": "{\n \"username\": \"userB\"\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "accountDefaultWallet",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query accountDefaultWallet($username: Username!) {\n accountDefaultWallet(username: $username) {\n id\n walletCurrency\n }\n}",
"variables": "{\n \"username\": \"userB\"\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "usernameAvailable",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query usernameAvailable($username: Username!) {\n usernameAvailable(username: $username)\n}",
"variables": "{\n \"username\": \"userB\"\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "btcPrice",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query btcPrice {\n btcPrice {\n base\n currencyUnit\n formattedAmount\n offset \n }\n}",
"variables": ""
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "globals",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query globals {\n globals {\n buildInformation {\n buildTime\n commitHash\n helmRevision\n }\n nodesIds\n }\n}",
"variables": ""
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "mobileVersions",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query mobileVersions {\n mobileVersions {\n currentSupported\n minSupported\n platform\n }\n}",
"variables": ""
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
]
},
{
"name": "mutations",
"item": [
{
"name": "onChainAddressCreate",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation onChainAddressCreate($input: OnChainAddressCreateInput!) {\n onChainAddressCreate(input: $input) {\n address\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "onChainAddressCurrent",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation onChainAddressCurrent($input: OnChainAddressCurrentInput!) {\n onChainAddressCurrent(input: $input) {\n address\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "onChainPaymentSend",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation onChainPaymentSend($input: OnChainPaymentSendInput!) {\n onChainPaymentSend(input: $input) {\n errors {\n message\n }\n status\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletIdBtc}}\",\n \"address\": \"{{regtest-segwitV0-address}}\",\n \"amount\": 5000,\n \"memo\": \"\",\n \"targetConfirmations\": 2\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "onChainTxFee",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query onChainTxFee($walletId: WalletId!, $address: OnChainAddress!, $amount: SatAmount!, $targetConfirmations: TargetConfirmations) {\n onChainTxFee(walletId: $walletId, address: $address, amount: $amount, targetConfirmations: $targetConfirmations) {\n amount\n targetConfirmations\n }\n}\n",
"variables": "{\n \"walletId\": \"{{walletId}}\",\n \"address\": \"{{regtest-segwitV0-address}}\",\n \"amount\": \"5000\",\n \"targetConfirmations\": 3\n} "
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnInvoiceCreate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnInvoiceCreateInput($input: LnInvoiceCreateInput!) {\n lnInvoiceCreate(input: $input) {\n invoice {\n paymentRequest\n paymentHash\n paymentSecret\n satoshis\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"amount\": 313000,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnUsdInvoiceCreate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnUsdInvoiceCreate($input: LnUsdInvoiceCreateInput!) {\n lnUsdInvoiceCreate(input: $input) {\n invoice {\n paymentRequest\n paymentHash\n paymentSecret\n satoshis\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"amount\": 30,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnInvoiceFeeProbe",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnInvoiceFeeProbe($input: LnInvoiceFeeProbeInput!) {\n lnInvoiceFeeProbe(input: $input) {\n errors {\n message\n }\n amount\n }\n}\n",
"variables": "{\"input\": {\n \"paymentRequest\": \"lntb10u1psl9twkpp5ammq48np46tkq3hly876v0022s6caxlt46avzhwav45qmgwxu4zqdqqcqzpgxqyz5vqsp54mktulgp89lfnxe649n26s738xjhk0z52wanr2h6tu4jjkyl7vns9qyyssqcvk98eye2rt3eec2yyskzapq0dzr6fhu5jqlxawakp24kjq2u6h932mv6wj7rr76jcmsfqg9tx0u0x8ghxaf3twajmkcud49y90gmgspv3ak00\",\n \"walletId\": \"{{walletId}}\"\n}\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnInvoicePaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnInvoicePaymentSend($input: LnInvoicePaymentInput!) {\n lnInvoicePaymentSend(input:$input) {\n status\n errors {\n message\n }\n }\n}",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"paymentRequest\": \"lntb100u1pse2klwpp5s546q897f9ayuqn03x6430pdsgt04amsm7gxyf983ajqlg8jqhmsdqqcqzpgxqyz5vqsp5wpxht57ymt0refl75f8ep20qldnz9kpq3hasqk002tndcwymwvss9qyyssq4aevv6yra2faaqqk2fjtum3xermcpm4m6kxcdw0kqd8ggeu2g7phxka9ntnjhgtlsy0zsy7zu2x9sau7tru0jc7m4jhs2zj50xkv6gqqjhuk7d\",\n \"memo\": \"Test\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "intraledgerPaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation intraLedgerPaymentSend($input: IntraLedgerPaymentSendInput!) {\n intraLedgerPaymentSend(input:$input) {\n status\n errors {\n message\n path\n }\n }\n}",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletIdBtc}}\",\n \"amount\": 100,\n \"recipientWalletId\": \"2ac41da6-1cbe-499a-a7b0-cf24b26e8a01\",\n \"memo\": \"Test\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountInvoiceCreate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnNoAmountInvoiceCreate($input: LnNoAmountInvoiceCreateInput!) {\n lnNoAmountInvoiceCreate(input: $input) {\n invoice {\n paymentRequest\n paymentHash\n paymentSecret\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountInvoiceFeeProbe",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation LnNoAmountInvoiceFeeProbe($input: LnNoAmountInvoiceFeeProbeInput!) {\n lnNoAmountInvoiceFeeProbe(input: $input) {\n errors {\n message\n }\n amount\n }\n}\n",
"variables": "{\n \"input\": {\n \"paymentRequest\": \"lntb1psecnzvpp5rvdaupfd2aztvyhypmycgayq8xjg3qfx6l0rtl9qr8z9z49yw27qdq823jhxaqcqzpuxqyz5vqsp5mprs6nvzjuqmtwqum0hnf6wxg9vkj7ug8up2fxe5tn34q0yglqrs9qyyssqp9m56rp6jnxyfu3t37hzfqxph98navlylakpq9fxwlg5jrjtvqthnluk3suvw2h9wt33ltpj0x90yas7nen204fe7gj69gaqeqca8tsq4nykqz\",\n \"amount\": 10,\n \"walletId\": \"{{walletId}}\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountInvoicePaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnNoAmountInvoicePaymentSend($input: LnNoAmountInvoicePaymentInput!) {\n lnNoAmountInvoicePaymentSend(input:$input) {\n status\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletIdBtc}}\",\n \"paymentRequest\": \"lntb1p3p3e2jpp59cvgj0r0ttuaxw6k5867twrmkhyjp7kf8eujfzjlefus39sjmweqsp59fk3mx7uh87z6aqtml7gc6ugusz2mvhr36qft55hdc0ezt5jsw5qdqqcqzynxqyz5vq9qxpq9qsqrzjqd4hzv9j0g3adlsa2hqa80keumd959cfqkytpq6wsgqwp4gwu6yx5gy7ccqqqpcqqqqqqqlgqqqqqqgq9qrzjqv43we5lgmdwmn8gldtfwc9jm2an0qkjvmtvlwg96dvz4rcaw4746gy7cuqqqpsqqyqqqqlgqqqq86qq9qrzjqt4dhk0824eh29salzmyvam22379e0pwjkesw8kgz4fl3mpvagaccgqd7qqqq0cqqqqqqqlgqqqqqqgq9qx7snq2ye2jszkjj872f0r35xumprt06h853yz3kdnypf2mry00q8c4d8jlun59aantpzc62atc4xx6nwxqvhlcd8sssezp7mn4qr8egq9mlc42\",\n \"amount\": 10,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountUsdInvoicePaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnNoAmountUsdInvoicePaymentSend($input: LnNoAmountUsdInvoicePaymentInput!) {\n lnNoAmountUsdInvoicePaymentSend(input:$input) {\n status\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"paymentRequest\": \"lntb1psecnzvpp5rvdaupfd2aztvyhypmycgayq8xjg3qfx6l0rtl9qr8z9z49yw27qdq823jhxaqcqzpuxqyz5vqsp5mprs6nvzjuqmtwqum0hnf6wxg9vkj7ug8up2fxe5tn34q0yglqrs9qyyssqp9m56rp6jnxyfu3t37hzfqxph98navlylakpq9fxwlg5jrjtvqthnluk3suvw2h9wt33ltpj0x90yas7nen204fe7gj69gaqeqca8tsq4nykqz\",\n \"amount\": 10,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "userQuizQuestionCompleted",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation userQuizQuestionUpdateCompleted($input: UserQuizQuestionUpdateCompletedInput!) {\n userQuizQuestionUpdateCompleted(input: $input) {\n userQuizQuestion {\n completed\n question {\n earnAmount\n id\n }\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"id\": \"sat\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "setUsername",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation setUsername($input: UserUpdateUsernameInput!) {\n userUpdateUsername(input:$input) {\n errors {\n message\n }\n user {\n username\n }\n }\n}",
"variables": "{\n \"input\": {\n \"username\": \"Bob\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "updateDefaultWalletId",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation updateDefaultWalletId($input: AccountUpdateDefaultWalletIdInput!) {\n accountUpdateDefaultWalletId(input:$input) {\n errors {\n message\n }\n account {\n defaultWalletId\n }\n }\n}",
"variables": "{\n \"input\": {\n \"walletId\": \"4ab79e9e-ca96-4cd1-a5ae-11bef2051fee\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "twoFAGenerate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting TwoFA generate\", function () {",
" const jsonData = pm.response.json();",
" const twoFASecret = jsonData.data.twoFAGenerate.twoFASecret.secret",
" pm.environment.set(\"twoFASecret\", twoFASecret)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation twoFAGenerate {\n twoFAGenerate {\n errors {\n message\n }\n twoFASecret {\n secret\n uri\n }\n }\n}",
"variables": ""
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "twoFASave",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation twoFASave($input: TwoFASaveInput!) {\n twoFASave(input: $input) {\n errors {\n message\n }\n success\n }\n}",
"variables": "{\n \"input\": {\n \"secret\": \"{{twoFASecret}}\",\n \"token\": \"123456\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "USD mutations",
"item": [
{
"name": "lnInvoiceFeeProbe",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnInvoiceFeeProbe($input: LnInvoiceFeeProbeInput!) {\n lnInvoiceFeeProbe(input: $input) {\n errors {\n message\n }\n amount\n }\n}\n",
"variables": "{\"input\": {\n \"paymentRequest\": \"lntb10u1psl9twkpp5ammq48np46tkq3hly876v0022s6caxlt46avzhwav45qmgwxu4zqdqqcqzpgxqyz5vqsp54mktulgp89lfnxe649n26s738xjhk0z52wanr2h6tu4jjkyl7vns9qyyssqcvk98eye2rt3eec2yyskzapq0dzr6fhu5jqlxawakp24kjq2u6h932mv6wj7rr76jcmsfqg9tx0u0x8ghxaf3twajmkcud49y90gmgspv3ak00\",\n \"walletId\": \"{{walletId}}\"\n}\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountInvoiceFeeProbe",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation LnNoAmountInvoiceFeeProbe($input: LnNoAmountInvoiceFeeProbeInput!) {\n lnNoAmountInvoiceFeeProbe(input: $input) {\n errors {\n message\n }\n amount\n }\n}\n",
"variables": "{\n \"input\": {\n \"paymentRequest\": \"lntb1psecnzvpp5rvdaupfd2aztvyhypmycgayq8xjg3qfx6l0rtl9qr8z9z49yw27qdq823jhxaqcqzpuxqyz5vqsp5mprs6nvzjuqmtwqum0hnf6wxg9vkj7ug8up2fxe5tn34q0yglqrs9qyyssqp9m56rp6jnxyfu3t37hzfqxph98navlylakpq9fxwlg5jrjtvqthnluk3suvw2h9wt33ltpj0x90yas7nen204fe7gj69gaqeqca8tsq4nykqz\",\n \"amount\": 10,\n \"walletId\": \"{{walletId}}\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnUsdInvoiceCreate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnUsdInvoiceCreate($input: LnUsdInvoiceCreateInput!) {\n lnUsdInvoiceCreate(input: $input) {\n invoice {\n paymentRequest\n paymentHash\n paymentSecret\n satoshis\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"amount\": 30,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountInvoiceCreate",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnNoAmountInvoiceCreate($input: LnNoAmountInvoiceCreateInput!) {\n lnNoAmountInvoiceCreate(input: $input) {\n invoice {\n paymentRequest\n paymentHash\n paymentSecret\n }\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletId}}\",\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnInvoicePaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnInvoicePaymentSend($input: LnInvoicePaymentInput!) {\n lnInvoicePaymentSend(input:$input) {\n status\n errors {\n message\n }\n }\n}",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletIdUsd}}\",\n \"paymentRequest\": \"lntb13323560n1p3pfer8pp5typknzlacpspm2nnrn7uyjf6xddnc9cxc0zrmxhrqpfu5x9e0ktqsp5qqzzshvw2a4hfcsxelqm4h0ps6w9efx0y6uzas08d37y08g8tgusdqdgfex2cttyp5hgcqzynxqyz5vq9qxpq9qsqrzjqd4hzv9j0g3adlsa2hqa80keumd959cfqkytpq6wsgqwp4gwu6yx5gy7ccqqqpcqqqqqqqlgqqqqqqgq9qrzjqt4dhk0824eh29salzmyvam22379e0pwjkesw8kgz4fl3mpvagaccgqd7qqqq0cqqqqqqqlgqqqqqqgq9qrzjqv43we5lgmdwmn8gldtfwc9jm2an0qkjvmtvlwg96dvz4rcaw4746gy7cuqqqpsqqyqqqqlgqqqq86qq9qrmdxj72c0yeallna7m06w00y525zx6y4j0decnvktxgvef459k7ztk2l9epcdwrvmzl4u20j2gg4p6a0apanh5uj7ryclkc40lnk6tqqa5ed5w\",\n \"memo\": \"Test\"\n }\n}\n"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "lnNoAmountUsdInvoicePaymentSend",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"add invoice\", function () {",
" const jsonData = pm.response.json();",
" const invoice = jsonData.data.invoice.addInvoice",
" pm.expect(invoice.substring(0,2)).to.eql(\"ln\")",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation lnNoAmountUsdInvoicePaymentSend($input: LnNoAmountUsdInvoicePaymentInput!) {\n lnNoAmountUsdInvoicePaymentSend(input:$input) {\n status\n errors {\n message\n }\n }\n}\n",
"variables": "{\n \"input\": {\n \"walletId\": \"{{walletIdUsd}}\",\n \"paymentRequest\": \"lntb1p3p3e2jpp59cvgj0r0ttuaxw6k5867twrmkhyjp7kf8eujfzjlefus39sjmweqsp59fk3mx7uh87z6aqtml7gc6ugusz2mvhr36qft55hdc0ezt5jsw5qdqqcqzynxqyz5vq9qxpq9qsqrzjqd4hzv9j0g3adlsa2hqa80keumd959cfqkytpq6wsgqwp4gwu6yx5gy7ccqqqpcqqqqqqqlgqqqqqqgq9qrzjqv43we5lgmdwmn8gldtfwc9jm2an0qkjvmtvlwg96dvz4rcaw4746gy7cuqqqpsqqyqqqqlgqqqq86qq9qrzjqt4dhk0824eh29salzmyvam22379e0pwjkesw8kgz4fl3mpvagaccgqd7qqqq0cqqqqqqqlgqqqqqqgq9qx7snq2ye2jszkjj872f0r35xumprt06h853yz3kdnypf2mry00q8c4d8jlun59aantpzc62atc4xx6nwxqvhlcd8sssezp7mn4qr8egq9mlc42\",\n \"amount\": 600,\n \"memo\": \"Test\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "login flow",
"item": [
{
"name": "userLogin",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting a token\", function () {",
" const jsonData = pm.response.json();",
" const token = jsonData.data.userLogin.authToken",
" // token should have two dot \".\"",
" const parts = token.split(\".\")",
" pm.expect(parts.length).to.eql(3);",
" pm.environment.set(\"token\", token)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation userLogin($input: UserLoginInput!) {\n userLogin(input: $input) {\n authToken\n }\n}",
"variables": "{\n \"input\": {\n \"phone\": \"{{phone}}\",\n \"code\": \"{{code}}\"\n }\n}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
},
{
"name": "me",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"requesting me data\", function () {",
" const jsonData = pm.response.json();",
" const walletIdUsd = jsonData.data.me.defaultAccount.wallets.find((wallet) => wallet.walletCurrency === \"USD\")?.id",
" const walletIdBtc = jsonData.data.me.defaultAccount.wallets.find((wallet) => wallet.walletCurrency === \"BTC\")?.id",
" const defaultWalletId = jsonData.data.me.defaultAccount.defaultWalletId",
" // walletId should have 5 groups separated by dashes \"-\"",
" let parts = defaultWalletId.split(\"-\")",
" pm.expect(parts.length).to.eql(5);",
" pm.environment.set(\"walletId\", defaultWalletId)",
"",
" parts = walletIdUsd.split(\"-\")",
" pm.expect(parts.length).to.eql(5);",
" pm.environment.set(\"walletIdUsd\", walletIdUsd)",
"",
" parts = walletIdBtc.split(\"-\")",
" pm.expect(parts.length).to.eql(5);",
" pm.environment.set(\"walletIdBtc\", walletIdBtc)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query me {\n me {\n defaultAccount {\n defaultWalletId\n wallets {\n id\n walletCurrency\n balance\n }\n }\n }\n}",
"variables": "{}"
}
},
"url": {
"raw": "{{protocol}}://{{domain}}:{{port}}/graphql",
"protocol": "{{protocol}}",
"host": [
"{{domain}}"
],
"port": "{{port}}",
"path": [
"graphql"
]
}
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "protocol",
"value": "http"
},
{
"key": "domain",
"value": "localhost"
},
{
"key": "port",
"value": "4000"
}
]
}
{
"id": "0dc0e8e1-8b36-4ffd-a878-2449c5dcc065",
"name": "2. staging",
"values": [
{
"key": "protocol",
"value": "https",
"enabled": true
},
{
"key": "domain",
"value": "api.staging.galoy.io",
"enabled": true
},
{
"key": "port",
"value": "443",
"enabled": true
},
{
"key": "currency",
"value": "BTC",
"enabled": true
},
{
"key": "phone",
"value": "",
"enabled": true
},
{
"key": "code",
"value": "",
"enabled": true
},
{
"key": "token",
"value": "",
"enabled": true
},
{
"key": "walletId",
"value": "",
"enabled": true
},
{
"key": "walletIdUsd",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "walletIdBtc",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "testnet-p2pkh-address",
"value": "mv4rnyY3Su5gjcDNzbMLKBQkBicCtHUtFB",
"enabled": true
},
{
"key": "testnet-p2sh-address",
"value": "2NGYHfoNUterKvuLVyVU5npmJPKmBwtoMzu",
"enabled": true
},
{
"key": "testnet-segwitV0-address",
"value": "tb1q796740jaeyppwsdfte5jqgay5yqvyvksmuxk6g",
"enabled": true
},
{
"key": "twoFASecret",
"value": "",
"type": "any",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2022-03-08T19:08:16.240Z",
"_postman_exported_using": "Postman/9.14.11"
}
@openoms
Copy link

openoms commented Mar 29, 2022

Download links to the files for wget:

wget https://gist.github.com/vindard/2415974ffb1c138bedfe175e5d3e483f/raw/249e96da47ce7ddb115b59f4552c95e7761df3b5/devnet.postman_environment.json

wget https://gist.github.com/vindard/2415974ffb1c138bedfe175e5d3e483f/raw/249e96da47ce7ddb115b59f4552c95e7761df3b5/graphql_api.postman_collection.json

wget https://gist.github.com/vindard/2415974ffb1c138bedfe175e5d3e483f/raw/249e96da47ce7ddb115b59f4552c95e7761df3b5/staging.postman_environment.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment