From 750cb07979384a96b284ff57cc70e1e01ecd46d0 Mon Sep 17 00:00:00 2001 From: golobitch Date: Thu, 7 Nov 2024 22:08:45 +0100 Subject: [PATCH] docs(bruno): add webhook event samples for asset and peer liquidity high --- .../Asset Liquidity High.bru | 32 +++++++++++++++++++ .../Peer Liquidity High.bru | 32 +++++++++++++++++++ .../Peer Liquidity Low.bru | 5 ++- .../Wallet Address Web Monetization.bru | 2 +- .../generated/graphql.ts | 4 ++- .../src/graphql/generated/graphql.schema.json | 14 +++++++- .../backend/src/graphql/generated/graphql.ts | 4 ++- packages/backend/src/graphql/schema.graphql | 4 ++- packages/frontend/app/generated/graphql.ts | 4 ++- .../src/generated/graphql.ts | 4 ++- test/integration/lib/generated/graphql.ts | 4 ++- 11 files changed, 98 insertions(+), 11 deletions(-) create mode 100644 bruno/collections/Rafiki/Sample Webhook Events/Asset Liquidity High.bru create mode 100644 bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity High.bru diff --git a/bruno/collections/Rafiki/Sample Webhook Events/Asset Liquidity High.bru b/bruno/collections/Rafiki/Sample Webhook Events/Asset Liquidity High.bru new file mode 100644 index 0000000000..c65494efe1 --- /dev/null +++ b/bruno/collections/Rafiki/Sample Webhook Events/Asset Liquidity High.bru @@ -0,0 +1,32 @@ +meta { + name: Asset Liquidity High + type: http + seq: 9 +} + +post { + url: {{cloudNineWalletWebhookUrl}} + body: json + auth: none +} + +body:json { + { + "id": "{{uuid}}", + "type": "asset.liquidity_low", + "data": { + "id": "{{assetId}}", + "asset": { + "id": "{{assetId}}", + "code": "EUR", + "scale": 2 + }, + "liquidityThresholdHigh": "9950", + "balance": "9980" + } + } +} + +script:pre-request { + bru.setVar('uuid', require("uuid").v4()); +} \ No newline at end of file diff --git a/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity High.bru b/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity High.bru new file mode 100644 index 0000000000..f2efb15f06 --- /dev/null +++ b/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity High.bru @@ -0,0 +1,32 @@ +meta { + name: Peer Liquidity High + type: http + seq: 11 +} + +post { + url: {{cloudNineWalletWebhookUrl}} + body: json + auth: none +} + +body:json { + { + "id": "{{uuid}}", + "type": "peer.liquidity_low", + "data": { + "id": "{{peerId}}", + "asset": { + "id": "{{assetId}}", + "code": "USD", + "scale": 2 + }, + "liquidityThresholdHigh": "9800", + "balance": "9850" + } + } +} + +script:pre-request { + bru.setVar('uuid', require("uuid").v4()); +} diff --git a/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity Low.bru b/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity Low.bru index e9b528ca7f..888af1dde6 100644 --- a/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity Low.bru +++ b/bruno/collections/Rafiki/Sample Webhook Events/Peer Liquidity Low.bru @@ -1,7 +1,7 @@ meta { name: Peer Liquidity Low type: http - seq: 9 + seq: 10 } post { @@ -21,8 +21,7 @@ body:json { "code": "USD", "scale": 2 }, - "liquidityThresholdLow": "10000", - "liquidityThresholdHigh": "1000000", + "liquidityThreshold": "10000", "balance": "9850" } } diff --git a/bruno/collections/Rafiki/Sample Webhook Events/Wallet Address Web Monetization.bru b/bruno/collections/Rafiki/Sample Webhook Events/Wallet Address Web Monetization.bru index 17b4c390e7..1610d5db0e 100644 --- a/bruno/collections/Rafiki/Sample Webhook Events/Wallet Address Web Monetization.bru +++ b/bruno/collections/Rafiki/Sample Webhook Events/Wallet Address Web Monetization.bru @@ -1,7 +1,7 @@ meta { name: Wallet Address Web Monetization type: http - seq: 10 + seq: 12 } post { diff --git a/localenv/mock-account-servicing-entity/generated/graphql.ts b/localenv/mock-account-servicing-entity/generated/graphql.ts index da9f49993c..2a52305733 100644 --- a/localenv/mock-account-servicing-entity/generated/graphql.ts +++ b/localenv/mock-account-servicing-entity/generated/graphql.ts @@ -243,8 +243,10 @@ export type CreateOrUpdatePeerByUrlInput = { assetId: Scalars['String']['input']; /** Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency). */ idempotencyKey?: InputMaybe; + /** A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value. */ + liquidityThresholdHigh?: InputMaybe; /** A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value. */ - liquidityThreshold?: InputMaybe; + liquidityThresholdLow?: InputMaybe; /** Amount of liquidity to deposit for the peer. */ liquidityToDeposit?: InputMaybe; /** Maximum packet amount that the peer accepts. */ diff --git a/packages/backend/src/graphql/generated/graphql.schema.json b/packages/backend/src/graphql/generated/graphql.schema.json index 159433ccdc..77b176bca6 100644 --- a/packages/backend/src/graphql/generated/graphql.schema.json +++ b/packages/backend/src/graphql/generated/graphql.schema.json @@ -1391,7 +1391,19 @@ "deprecationReason": null }, { - "name": "liquidityThreshold", + "name": "liquidityThresholdHigh", + "description": "A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value.", + "type": { + "kind": "SCALAR", + "name": "UInt64", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "liquidityThresholdLow", "description": "A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value.", "type": { "kind": "SCALAR", diff --git a/packages/backend/src/graphql/generated/graphql.ts b/packages/backend/src/graphql/generated/graphql.ts index da9f49993c..2a52305733 100644 --- a/packages/backend/src/graphql/generated/graphql.ts +++ b/packages/backend/src/graphql/generated/graphql.ts @@ -243,8 +243,10 @@ export type CreateOrUpdatePeerByUrlInput = { assetId: Scalars['String']['input']; /** Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency). */ idempotencyKey?: InputMaybe; + /** A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value. */ + liquidityThresholdHigh?: InputMaybe; /** A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value. */ - liquidityThreshold?: InputMaybe; + liquidityThresholdLow?: InputMaybe; /** Amount of liquidity to deposit for the peer. */ liquidityToDeposit?: InputMaybe; /** Maximum packet amount that the peer accepts. */ diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql index fa6d4a7e23..fa637c0b4b 100644 --- a/packages/backend/src/graphql/schema.graphql +++ b/packages/backend/src/graphql/schema.graphql @@ -423,7 +423,9 @@ input CreateOrUpdatePeerByUrlInput { "Internal name for the peer, used to override auto-peering default names." name: String "A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value." - liquidityThreshold: UInt64 + liquidityThresholdLow: UInt64 + "A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value." + liquidityThresholdHigh: UInt64 "Amount of liquidity to deposit for the peer." liquidityToDeposit: UInt64 "Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency)." diff --git a/packages/frontend/app/generated/graphql.ts b/packages/frontend/app/generated/graphql.ts index 70771b5aae..294bfd295b 100644 --- a/packages/frontend/app/generated/graphql.ts +++ b/packages/frontend/app/generated/graphql.ts @@ -243,8 +243,10 @@ export type CreateOrUpdatePeerByUrlInput = { assetId: Scalars['String']['input']; /** Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency). */ idempotencyKey?: InputMaybe; + /** A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value. */ + liquidityThresholdHigh?: InputMaybe; /** A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value. */ - liquidityThreshold?: InputMaybe; + liquidityThresholdLow?: InputMaybe; /** Amount of liquidity to deposit for the peer. */ liquidityToDeposit?: InputMaybe; /** Maximum packet amount that the peer accepts. */ diff --git a/packages/mock-account-service-lib/src/generated/graphql.ts b/packages/mock-account-service-lib/src/generated/graphql.ts index da9f49993c..2a52305733 100644 --- a/packages/mock-account-service-lib/src/generated/graphql.ts +++ b/packages/mock-account-service-lib/src/generated/graphql.ts @@ -243,8 +243,10 @@ export type CreateOrUpdatePeerByUrlInput = { assetId: Scalars['String']['input']; /** Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency). */ idempotencyKey?: InputMaybe; + /** A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value. */ + liquidityThresholdHigh?: InputMaybe; /** A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value. */ - liquidityThreshold?: InputMaybe; + liquidityThresholdLow?: InputMaybe; /** Amount of liquidity to deposit for the peer. */ liquidityToDeposit?: InputMaybe; /** Maximum packet amount that the peer accepts. */ diff --git a/test/integration/lib/generated/graphql.ts b/test/integration/lib/generated/graphql.ts index da9f49993c..2a52305733 100644 --- a/test/integration/lib/generated/graphql.ts +++ b/test/integration/lib/generated/graphql.ts @@ -243,8 +243,10 @@ export type CreateOrUpdatePeerByUrlInput = { assetId: Scalars['String']['input']; /** Unique key to ensure duplicate or retried requests are processed only once. For more information, refer to [idempotency](https://rafiki.dev/apis/graphql/admin-api-overview/#idempotency). */ idempotencyKey?: InputMaybe; + /** A webhook event will notify the Account Servicing Entity if peer liquidity is higher than this value. */ + liquidityThresholdHigh?: InputMaybe; /** A webhook event will notify the Account Servicing Entity if peer liquidity falls below this value. */ - liquidityThreshold?: InputMaybe; + liquidityThresholdLow?: InputMaybe; /** Amount of liquidity to deposit for the peer. */ liquidityToDeposit?: InputMaybe; /** Maximum packet amount that the peer accepts. */