diff --git a/bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru b/bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru index 8eb7adb841..037f54df4f 100644 --- a/bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru +++ b/bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru @@ -51,25 +51,34 @@ body:graphql:vars { script:pre-request { // Create an additional wallet address to represent the account that will be sending money - + const fetch = require('node-fetch'); const scripts = require('./scripts'); - + const randomInt = Math.floor(Math.random() * (1001)); - - const initialRequest = bru.getEnvVar("initialWalletAddressRequest"); - const postRequestBody = { - query: initialRequest.body.query, - variables: { - "input": { - "assetId": bru.getEnvVar("assetId"), - "url": "https://" + bru.getEnvVar("OpenPaymentsHost") + "/simon/" + randomInt, - "publicName": "Simon" + + const createWalletAddressQuery = ` + mutation CreateWalletAddress($input: CreateWalletAddressInput!) { + createWalletAddress(input: $input) { + walletAddress { + id + } } + } + `; + + const postRequestBody = { + query: createWalletAddressQuery, + variables: { + input: { + assetId: bru.getEnvVar("assetId"), + url: "https://" + bru.getEnvVar("OpenPaymentsHost") + "/simon/" + randomInt, + publicName: "Simon" } } - - const signature = scripts.generateBackendApiSignature(postRequestBody) + }; + + const signature = scripts.generateBackendApiSignature(postRequestBody); const postRequest = { method: 'post', headers: { @@ -79,11 +88,12 @@ script:pre-request { }, body: JSON.stringify(postRequestBody) }; - - const response = await fetch(`${initialRequest.url}`, postRequest); + + const graphqlUrl = bru.getEnvVar("RafikiGraphqlHost") + "/graphql"; + const response = await fetch(graphqlUrl, postRequest); const body = await response.json(); bru.setEnvVar("secondWalletAddressId", body.data.createWalletAddress.walletAddress.id); - + scripts.addApiSignatureHeader(); } diff --git a/bruno/collections/Rafiki/Rafiki Admin APIs/Create Wallet Address.bru b/bruno/collections/Rafiki/Rafiki Admin APIs/Create Wallet Address.bru index c93e99844e..2dc181e1d8 100644 --- a/bruno/collections/Rafiki/Rafiki Admin APIs/Create Wallet Address.bru +++ b/bruno/collections/Rafiki/Rafiki Admin APIs/Create Wallet Address.bru @@ -65,7 +65,6 @@ script:post-response { if (body?.data) { bru.setEnvVar("walletAddressId", body.data.createWalletAddress.walletAddress.id); bru.setEnvVar("walletAddressUrl", body.data.createWalletAddress.walletAddress.url); - bru.setEnvVar('initialWalletAddressRequest',req) } }