Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(2662)!: 2phase incoming and outgoing payments #2671

Merged
merged 27 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ed0ff8f
feat(2662): 2phase incoming and outgoing payments
koekiebox Apr 22, 2024
c701587
feat(2662): 2phase incoming and outgoing payments test cases, bruno a…
koekiebox Apr 23, 2024
a7f4573
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox Apr 29, 2024
a36cf27
feat(2662): add command to remove images after tear down.
koekiebox Apr 29, 2024
dcb7192
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox May 1, 2024
40ca768
feat(2662): introduce the timeout as optional argument for withdraws.
koekiebox May 1, 2024
0fe676d
feat(2662): fix test cases.
koekiebox May 1, 2024
6d78472
feat(2662): fix front-end issues wgt timeout.
koekiebox May 2, 2024
4801a8c
feat(2662): bruno updates.
koekiebox May 3, 2024
6f12ee8
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox May 6, 2024
e892eb7
feat(2662): doc updates.
koekiebox May 6, 2024
96a4f81
feat(2662): doc updates.
koekiebox May 6, 2024
ffb1c3a
feat(2662): liq test case updates.
koekiebox May 6, 2024
e77d216
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox May 11, 2024
d290417
feat(2662): review updates.
koekiebox May 11, 2024
7b15748
feat(2662): frontend updates.
koekiebox May 11, 2024
d663cc8
feat(2662): bruno updates.
koekiebox May 13, 2024
33b5321
feat(2662): make use of config from config.server.ts.
koekiebox May 14, 2024
fc75108
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox May 14, 2024
4fbb211
feat(2662-2671): review comments.
koekiebox May 14, 2024
3b4b16c
feat(2662/2671): address review feedback.
koekiebox May 14, 2024
6bfaa65
feat(2662/2671): remove variable timeoutOnePhase
koekiebox May 14, 2024
0cb4d3a
Merge branch 'refs/heads/main' into issues/2662-two-phase
koekiebox May 15, 2024
cd92203
feat(2662/2671): document updates.
koekiebox May 15, 2024
c42f811
feat(2662/2671): final doc updates.
koekiebox May 15, 2024
e9e5dac
feat(2662/2671): more dollar fixes.
koekiebox May 15, 2024
0173ad6
feat(2662/2671): more dollar fixes.
koekiebox May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ body:graphql:vars {
"input": {
"id": "02ac56f7-ae5d-4abb-8306-17bf2327b43c",
"walletAddressId": "{{walletAddressId}}",
"idempotencyKey":"{{idempotencyKey}}"
"idempotencyKey":"{{idempotencyKey}}",
"timeoutSeconds": {{withdrawalTimeout}}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ body:graphql:vars {
"id": "{{transferId}}",
"assetId": "{{assetId}}",
"amount": "100",
"idempotencyKey":"{{idempotencyKey}}"
"idempotencyKey":"{{idempotencyKey}}",
"timeoutSeconds": {{withdrawalTimeout}}
}
}

Expand Down
koekiebox marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ post {
}

body:graphql {
mutation WithdrawIncomingPaymentLiquidity($input: WithdrawIncomingPaymentLiquidityInput!) {
withdrawIncomingPaymentLiquidity(input: $input) {
mutation CreateIncomingPaymentWithdrawal($input: CreateIncomingPaymentWithdrawalInput!) {
createIncomingPaymentWithdrawal(input: $input) {
code
error
message
Expand All @@ -25,7 +25,8 @@ body:graphql:vars {
{
"input": {
"incomingPaymentId": "{{incomingPaymentId}}",
"idempotencyKey":"{{idempotencyKey}}"
"idempotencyKey": "{{idempotencyKey}}",
"timeoutSeconds": {{withdrawalTimeout}}
}
}
}
Expand Down
koekiebox marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ post {
}

body:graphql {
mutation WithdrawOutgoingPaymentLiquidity($input: WithdrawOutgoingPaymentLiquidityInput!) {
withdrawOutgoingPaymentLiquidity(input: $input) {
mutation CreateOutgoingPaymentWithdrawal($input: CreateOutgoingPaymentWithdrawalInput!) {
createOutgoingPaymentWithdrawal(input: $input) {
code
error
message
Expand All @@ -25,7 +25,8 @@ body:graphql:vars {
{
"input": {
"outgoingPaymentId": "{{outgoingPaymentId}}",
"idempotencyKey":"{{idempotencyKey}}"
"idempotencyKey": "{{idempotencyKey}}",
"timeoutSeconds": {{withdrawalTimeout}}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ body:graphql:vars {
"id": "{{withdrawalId}}",
"peerId": "{{peerId}}",
"amount": "100",
"idempotencyKey":"{{idempotencyKey}}"
"idempotencyKey":"{{idempotencyKey}}",
"timeoutSeconds": {{withdrawalTimeout}}
}
}

Expand Down
1 change: 1 addition & 0 deletions bruno/collections/Rafiki/environments/Autopeering.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ vars {
receiverWalletAddress: https://ilp.rafiki.money/d99f0eee
signatureUrl: https://kxu5d4mr4blcthphxomjlc4xk40rvdsx.lambda-url.eu-central-1.on.aws/
clientPrivateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1DNENBUUF3QlFZREsyVndCQ0lFSUUvMmFwQXduMlJPek5WNWd1L2ltZzdpT05rOWE1Ui9yakFxWVlUWHozZzgKLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQ==
withdrawalTimeout: 60
}
1 change: 1 addition & 0 deletions bruno/collections/Rafiki/environments/Local Playground.bru
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ vars {
asmithWalletAddress: https://happy-life-bank-backend/accounts/asmith
larsWalletAddress: https://happy-life-bank-backend/accounts/lars
davidWalletAddress: https://happy-life-bank-backend/accounts/david
withdrawalTimeout: 60
}
1 change: 1 addition & 0 deletions bruno/collections/Rafiki/environments/Remote.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ vars {
receiverWalletAddress: https://ilp.rafiki.money/f1475476
signatureUrl: https://kxu5d4mr4blcthphxomjlc4xk40rvdsx.lambda-url.eu-central-1.on.aws/
clientPrivateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1DNENBUUF3QlFZREsyVndCQ0lFSUUvMmFwQXduMlJPek5WNWd1L2ltZzdpT05rOWE1Ui9yakFxWVlUWHozZzgKLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQ==
withdrawalTimeout: 60
}
8 changes: 8 additions & 0 deletions localenv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ pnpm localenv:compose up

// tear down and remove volumes
pnpm localenv:compose down --volumes

// tear down, delete database volumes and remove images
pnpm localenv:compose down --volumes --rmi all
```

If you want to use Postgres as the accounting database instead of TigerBeetle, you can use the `psql` variant of the `localenv:compose` commands:
Expand All @@ -114,6 +117,8 @@ The secondary Happy Life Bank docker compose file (`./happy-life-bank/docker-com
data stores created by the primary Rafiki instance so it can't be run by itself.
The `pnpm localenv:compose up` command starts both the primary instance and the secondary.

See the `frontend` [README](../packages/frontend/README.md#ory-kratos) for more information regarding the Ory Kratos identity and user management system required for Admin UI.

#### Autopeering

If you want to start the local env and peer it automatically to rafiki.money, you can run the following commands:
Expand Down Expand Up @@ -147,6 +152,9 @@ pnpm localenv:compose down

// tear down and delete database volumes
pnpm localenv:compose down --volumes

// tear down, delete database volumes and remove images
pnpm localenv:compose down --volumes --rmi all
```

### Commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ export async function handleIncomingPaymentCompletedExpired(wh: Webhook) {
await apolloClient
.mutate({
mutation: gql`
mutation WithdrawIncomingPaymentLiquidity(
$input: WithdrawIncomingPaymentLiquidityInput!
mutation CreateIncomingPaymentWithdrawal(
koekiebox marked this conversation as resolved.
Show resolved Hide resolved
$input: CreateIncomingPaymentWithdrawalInput!
) {
withdrawIncomingPaymentLiquidity(input: $input) {
createIncomingPaymentWithdrawal(input: $input) {
code
success
message
Expand All @@ -148,7 +148,7 @@ export async function handleIncomingPaymentCompletedExpired(wh: Webhook) {
})
.then((query): LiquidityMutationResponse => {
if (query.data) {
return query.data.withdrawIncomingPaymentLiquidity
return query.data.createIncomingPaymentWithdrawal
} else {
throw new Error('Data was empty')
}
Expand Down
80 changes: 45 additions & 35 deletions localenv/mock-account-servicing-entity/generated/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading