Skip to content

feat: populate orders and transactions via get-escrows-by-signer (#316)#335

Draft
Benjtalkshow wants to merge 1 commit into
Kaizenode:mainfrom
Benjtalkshow:feature/populate-orders-and-transactions-316
Draft

feat: populate orders and transactions via get-escrows-by-signer (#316)#335
Benjtalkshow wants to merge 1 commit into
Kaizenode:mainfrom
Benjtalkshow:feature/populate-orders-and-transactions-316

Conversation

@Benjtalkshow

Copy link
Copy Markdown
Contributor

Issue

This work is for issue #316.

What this adds

Wallet connection using the Stellar Wallets Kit. A user can connect an existing external Stellar wallet such as Freighter, xBull, Albedo, Lobstr, Rabet, or Hana. The kit opens a modal, the user picks a wallet, and it returns the wallet address. That address is the signer the escrow endpoints need. This flow only connects a wallet. It does not create one.

The data layer for the two lists. This covers the escrow types from the Trustless Work docs, a helper that derives the status from flags and balance, adapters that map an escrow into the order and transaction shapes, a mock client, and a useEscrows hook with page based pagination.

The connect button now shows on the orders page and the transactions page.

What is not done yet

The pages still use mock data. The real call to get-escrows-by-signer is not wired yet. The whole feature sits behind one function, so the swap stays small once the API client is ready.

Blocked on

I am waiting for the following pull requests to be merged before I proceed with the page wiring:

  1. Rewrite lib/trustless-work.ts to match the real Trustless Work API #324 rewrites the Trustless Work API client. The get-escrows-by-signer method does not exist in the current client, so I cannot wire the real call until this lands.
  2. Rotate leaked Trustless Work API key committed in .env.example #328 rotates the leaked API key. This should land before any other Trustless Work work.

Notes

This branch mounts the wallet provider in app/layout.tsx. Issue #323 also plans to edit the layout, so please review the merge order.

Add Stellar wallet connection using the Stellar Wallets Kit. A user can
connect an existing external wallet such as Freighter, xBull, Albedo,
Lobstr, Rabet, or Hana. The kit opens a modal, the user picks a wallet,
and it returns the wallet address. That address is the signer the escrow
endpoints need. This flow only connects a wallet. It does not create one.

Add the data layer for the two lists. This covers the indexer types from
the Trustless Work docs, a helper that derives the status from flags and
balance, adapters that map an escrow into the order and transaction
shapes, a mock client, and a useEscrows hook with page based pagination.

Place the connect button on the orders page and the transactions page.

The pages still use mock data. The real call to get-escrows-by-signer is
not wired yet. The whole feature sits behind one function so the swap
stays small once the API client is ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant