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

[TypeScript SDK] Parse balance field for coin #1699

Merged
merged 2 commits into from
May 2, 2022
Merged

Conversation

666lcz
Copy link
Contributor

@666lcz 666lcz commented May 2, 2022

We have changed the definition for the Coin object

CleanShot 2022-05-01 at 19 01 27

@666lcz 666lcz requested review from Jibz1 and apburnie May 2, 2022 02:03
@666lcz 666lcz enabled auto-merge (squash) May 2, 2022 02:11
@666lcz 666lcz requested a review from stella3d May 2, 2022 04:18
@@ -100,6 +101,19 @@ class UniqueIDTransformer extends MoveObjectContentTransformer {
}
}

class BalanceTransformer extends MoveObjectContentTransformer {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

transforms

"balance": {
              "fields": {
                "value": 50000
              },
              "type": "0x2::Balance::Balance<0x2::SUI::SUI>"
            }

to

"balance": 50000

@666lcz 666lcz disabled auto-merge May 2, 2022 19:48
Copy link
Contributor

@stella3d stella3d left a comment

Choose a reason for hiding this comment

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

the data transformer pattern should be replaced in the long term (done in the backend), but i i understand why we have it here now.

@666lcz 666lcz force-pushed the chris-explorer-coin branch from 35813ea to a0e509a Compare May 2, 2022 21:17
@666lcz 666lcz merged commit da1e65f into main May 2, 2022
@666lcz 666lcz deleted the chris-explorer-coin branch May 2, 2022 21:23
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