Skip to content

User events endpoints#384

Open
Cauterization wants to merge 36 commits into
Preliminary-Off-Chain-for-Tx-Ordersfrom
user-events-endpoints
Open

User events endpoints#384
Cauterization wants to merge 36 commits into
Preliminary-Off-Chain-for-Tx-Ordersfrom
user-events-endpoints

Conversation

@Cauterization

Copy link
Copy Markdown
Contributor

Closes #379

Comment thread demo/midgard-node/src/commands/listen.ts Outdated
Comment thread demo/midgard-sdk/src/common.ts Outdated
Comment thread demo/midgard-sdk/src/common.ts Outdated

@keyan-m keyan-m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Avoid using Schema from effect, Data from LE should suffice
  • Deposits should go to MidgardAddresses, but withdrawals must go to Cardano addresses.
  • All refund addresses must also be Cardano addresses.

@keyan-m keyan-m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look at examples from effect, it seems a hybrid approach would suit us best. Now that you've trimmed down the payload fields, we can use Schema to avoid all those (body as any) checks.

Comment thread demo/midgard-node/src/commands/listen.ts Outdated
Comment thread demo/midgard-node/src/commands/listen.ts Outdated
txOrderScriptAddress: txOrderAuthValidator.spendScriptAddress,
mintingPolicy: txOrderAuthValidator.mintScript,
policyId: txOrderAuthValidator.policyId,
refundAddress: refundAddress,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this field from TxOrderParams is not LE.Address (which is just an alias for string), fix it there too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't understand that one. This field isn't a string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, I think I got it

Comment thread demo/midgard-node/src/commands/listen.ts Outdated
Comment thread demo/midgard-node/src/commands/listen.ts Outdated
@Cauterization

Copy link
Copy Markdown
Contributor Author

Taking a look at examples from effect, it seems a hybrid approach would suit us best. Now that you've trimmed down the payload fields, we can use Schema to avoid all those (body as any) checks.

Adding .setPayload from your example triggers a lot of changes due to incompatibility with our current router implementation. I hope just adding schema and parsing the request body with decodeUnknownEither fits that hybrid approach.

@Cauterization Cauterization marked this pull request as ready for review November 27, 2025 11:21
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.

2 participants