Skip to content

Commit

Permalink
Merge branch 'main' into 2852/mk/get-or-create-grants
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/backend/src/open_payments/receiver/service.ts
  • Loading branch information
mkurapov committed Aug 22, 2024
2 parents 0e66265 + b08a157 commit 7a36395
Show file tree
Hide file tree
Showing 161 changed files with 6,514 additions and 1,381 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/workflows/rafiki/env-setup
- run: pnpm --filter backend build:deps
- run: NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter backend test:ci
- run: NODE_OPTIONS="--max-old-space-size=4096" pnpm --filter backend test:ci
- name: AsyncAPI extension
run: |
echo "{\"extends\":[\"spectral:oas\",\"spectral:asyncapi\"]}" >> .spectral.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down Expand Up @@ -57,8 +53,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down Expand Up @@ -57,8 +53,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ body:graphql {
error
metadata
id
grantId
walletAddressId
quote {
id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
meta {
name: Approve Incoming Payment
type: graphql
seq: 47
}

post {
url: {{PeerGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation ApproveIncomingPayment($input: ApproveIncomingPaymentInput!) {
approveIncomingPayment(input:$input) {
payment {
id
}
}
}
}

body:graphql:vars {
{
"input": {
"id": "{{incomingPaymentId}}"
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: Cancel Incoming Payment
type: graphql
seq: 48
}

post {
url: {{PeerGraphqlHost}}/graphql
body: graphql
auth: none
}

body:graphql {
mutation CancelIncomingPayment($input: CancelIncomingPaymentInput!) {
cancelIncomingPayment(input: $input) {
payment {
id
}
}
}

}

body:graphql:vars {
{
"input": {
"id": "{{incomingPaymentId}}"
}
}
}

script:pre-request {
const scripts = require('./scripts');

scripts.addApiSignatureHeader();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
estimatedExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down
6 changes: 4 additions & 2 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Asset.bru
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("assetId", body.data.createAsset.asset?.id);

if (body?.data) {
bru.setEnvVar("assetId", body.data.createAsset.asset?.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("incomingPaymentId", body.data.createIncomingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("incomingPaymentId", body.data.createIncomingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("peerId", body.data.createOrUpdatePeerByUrl?.peer.id);

if (body?.data) {
bru.setEnvVar("peerId", body.data.createOrUpdatePeerByUrl?.peer.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
estimatedExchangeRate
receiveAmount {
assetCode
assetScale
Expand Down Expand Up @@ -89,8 +86,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPaymentFromIncomingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPaymentFromIncomingPayment.payment.id);
}
}

tests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
estimatedExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down Expand Up @@ -84,8 +81,10 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);

if (body?.data) {
bru.setEnvVar("outgoingPaymentId", body.data.createOutgoingPayment.payment.id);
}
}

tests {
Expand Down
6 changes: 4 additions & 2 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Peer.bru
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("peerId", body.data.createPeer.peer.id);

if (body?.data) {
bru.setEnvVar("peerId", body.data.createPeer.peer.id);
}
}
10 changes: 4 additions & 6 deletions bruno/collections/Rafiki/Rafiki Admin APIs/Create Quote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ body:graphql {
quote {
createdAt
expiresAt
highEstimatedExchangeRate
id
lowEstimatedExchangeRate
maxPacketAmount
minExchangeRate
walletAddressId
receiveAmount {
assetCode
Expand Down Expand Up @@ -87,6 +83,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("quoteId", body.data.createQuote.quote.id);

if (body?.data) {
bru.setEnvVar("quoteId", body.data.createQuote.quote.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);

if (body?.data) {
bru.setEnvVar("receiverId", body.data.createReceiver.receiver.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ script:pre-request {

script:post-response {
const body = res.getBody();

bru.setEnvVar("walletAddressKeyId", body.data.createWalletAddressKey.walletAddressKey.id);

if (body?.data) {
bru.setEnvVar("walletAddressKeyId", body.data.createWalletAddressKey.walletAddressKey.id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ script:pre-request {

script:post-response {
const body = res.getBody();
bru.setEnvVar("walletAddressId", body.data.createWalletAddress.walletAddress.id);

bru.setEnvVar("walletAddressUrl", body.data.createWalletAddress.walletAddress.url);

bru.setEnvVar('initialWalletAddressRequest',req)

if (body?.data) {
bru.setEnvVar("walletAddressId", body.data.createWalletAddress.walletAddress.id);
bru.setEnvVar("walletAddressUrl", body.data.createWalletAddress.walletAddress.url);
bru.setEnvVar('initialWalletAddressRequest',req)
}
}

tests {
Expand Down
Loading

0 comments on commit 7a36395

Please sign in to comment.