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

Fix TrustlineTransaction type #1458

Closed
mrosendin opened this issue Jul 12, 2021 · 4 comments · Fixed by #1460
Closed

Fix TrustlineTransaction type #1458

mrosendin opened this issue Jul 12, 2021 · 4 comments · Fixed by #1460

Comments

@mrosendin
Copy link
Contributor

The typings for FormattedTrustlineTransaction need to be updated.

Gives TypeScript errors like Property 'limit' does not exist on type 'FormattedTrustline'. for each property.

Screen Shot 2021-07-12 at 4 24 53 PM

The error goes away if I instead do transaction.specification.specification.limit!, but this property doesn't exist on the object.

This leads me to believe that the typings are somehow incorrect for FormattedTrustline
(see FormattedTrustlineTransaction and FormattedTrustlineSpecification)

Example of a trust line object returned from the API:

{
  "type": "trustline",
  "address": "ranRvKcpressC7Ctkwi37qBacSwYEzFuqR",
  "sequence": 19183454,
  "id": "61F997882C45C7D9111E9E6F620BF6DA1A36CED755D46EDC9CF1EB199D8EF9FC",
  "specification": {
    "limit": "999999999",
    "currency": "AUR",
    "counterparty": "rJCygsdUaeUgsngvxSUsBjzMLfYrzpkAVj",
    "memos": [
      {
        "type": "test",
        "format": "text/plain",
        "data": "StablePay App"
      }
    ],
    "qualityIn": 1,
    "qualityOut": 1,
    "ripplingDisabled": false,
    "frozen": false
  },
  "outcome": {
    "result": "tesSUCCESS",
    "timestamp": "2021-07-12T21:15:00.000Z",
    "fee": "0.000012",
    "balanceChanges": {
      "ranRvKcpressC7Ctkwi37qBacSwYEzFuqR": [
        {
          "currency": "XRP",
          "value": "-0.000012"
        }
      ]
    },
    "orderbookChanges": {},
    "ledgerVersion": 19183460,
    "indexInLedger": 0
  }

I can submit a PR to fix this.

@mrosendin mrosendin changed the title Fix trust line transaction typings Fix TrustlineTransaction type Jul 12, 2021
mrosendin added a commit to trustline-inc/ripple-lib that referenced this issue Jul 12, 2021
@mrosendin
Copy link
Contributor Author

I am unable to create a branch, but I pushed the fix to a fork: c3013dd

@intelliot
Copy link
Collaborator

@mrosendin You should be able to create a PR for this repo from your fork

@mrosendin
Copy link
Contributor Author

@intelliot PR created: #1460

@mvadari mvadari linked a pull request Jul 14, 2021 that will close this issue
@mvadari mvadari closed this as completed Jul 14, 2021
@intelliot
Copy link
Collaborator

Released in ripple-lib version 1.9.7

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 a pull request may close this issue.

3 participants