XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.21k stars 512 forks source link

Aliter: Implement DeliverMax alias in Payment transactions, through autofill method #2689

Closed ckeshava closed 3 months ago

ckeshava commented 5 months ago

High Level Overview of Change

This is an alternative solution for the DeliverMax alias, inspired from this discussion: https://github.com/XRPLF/xrpl.js/pull/2684#discussion_r1588500925

Note: Only one of these two PRs must be merged.

Both the PRs seek to achieve the same objectives, albeit through different means.

Context of Change

Type of Change

Did you update HISTORY.md?

Test Plan

Added unit tests

ckeshava commented 5 months ago

Do you guys have any ideas for complying with lint errors? For instance:

error    Unsafe member access .DeliverMax on an `any` value                                @typescript-eslint/no-unsafe-member-access

error    Unsafe return of type `Promise<any>` from function with return type `Promise<T>`  @typescript-eslint/no-unsafe-return
ckeshava commented 4 months ago

@mvadari Do you have any workarounds for the lint errors? type-erasure does not seem to sit well with the linter.

mvadari commented 4 months ago

@mvadari Do you have any workarounds for the lint errors? type-erasure does not seem to sit well with the linter.

Feel free to disable the linter error for that line.

ckeshava commented 4 months ago

thanks, I've fixed the linter errors and warnings. I didn't realize that I could ignore the errors and get away with it haha

I think it's safe to ignore the linter errors because, a malformed input is sure to through an error in signing or serialization steps.

ckeshava commented 3 months ago

sorry about the forced updates, I had messed up the git history

khancode commented 3 months ago

We should also add integ tests to verify it works for both API versions under packages/xrpl/test/integration/transactions/payment.test.ts

ckeshava commented 3 months ago

Integration tests are set up against rippledv2.2.0-b3 in the current codebase. I tried to execute the integration tests against v1.12.0 (this rippled version contains API v1), but I'm running into some config errors