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

feat(top-up): init top-up with stripe checkout command PE-6635 #149

Merged
merged 7 commits into from
Sep 6, 2024

Conversation

fedellen
Copy link
Collaborator

@fedellen fedellen commented Sep 3, 2024

> node lib/esm/cli/cli.js top-up --wallet-file ../wallets/zarweave-keyfile-jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU_dereks.json --value 10      
Got Checkout Session
{"url":"https://checkout.stripe.com/c/pay/cs_live_a14J22sFvvu5jifp9dlIS0869DXMzMS78B0t0Sieid3qbECjQs34rdTTSW#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl","paymentAmount":1000,"winc":"367209971237"}
Opening checkout session in browser...

@fedellen fedellen self-assigned this Sep 3, 2024
Base automatically changed from PE-6635-balance-command to alpha September 3, 2024 22:03
@fedellen fedellen force-pushed the PE-6635-top-up-command branch from 772e621 to ca41dd7 Compare September 4, 2024 15:35
@fedellen fedellen marked this pull request as ready for review September 4, 2024 15:45
@fedellen fedellen requested a review from a team as a code owner September 4, 2024 15:45
@fedellen fedellen requested a review from dtfiedler September 4, 2024 15:45
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 93.54839% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.62%. Comparing base (feab3c6) to head (c023361).
Report is 12 commits behind head on alpha.

Files with missing lines Patch % Lines
src/types.ts 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha     #149      +/-   ##
==========================================
- Coverage   91.63%   91.62%   -0.01%     
==========================================
  Files          30       30              
  Lines        3670     3690      +20     
  Branches      162      162              
==========================================
+ Hits         3363     3381      +18     
- Misses        307      309       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.md Outdated

Fund a wallet with Turbo Credits by submitting a payment transaction for the crypto amount to the Turbo wallet and then submitting that transaction id to Turbo Payment Service for top up processing.
Get the balance of a wallet or native address in Turbo Credits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anywhere here (or in linked docs) we disambiguate wallet address and native address?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so. I'd say those would be the same thing to a user, they'd expect wallet address to be their native address. The one thats different could be perceived arweave b64 encoded address

Copy link
Contributor

Choose a reason for hiding this comment

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

We could link out the docs.ar.io glossary if we want and use the term "normalized address" rather than "wallet address":
https://docs.ar.io/glossary.html#normalized-address
https://docs.ar.io/glossary.html#native-address

README.md Outdated

Command Options:

- `-v, --value <value>` - Amount of tokens in the token type's smallest unit value to fund the wallet with
- `-a, --address <address>` - Address to get the balance of
Copy link
Contributor

Choose a reason for hiding this comment

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

Use either normalized address or native address. Address is now ambiguous.

README.md Outdated

e.g:

```shell
turbo crypto-fund --value 0.0001 --token kyve --private-key 'b27...45c'
turbo balance --address 'crypto-wallet-public-native-address'
Copy link
Contributor

Choose a reason for hiding this comment

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

How can you just pass a native address without specifying the chain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

here we are defaulting to arweave. but I think it would be possible to regex the address to derive the chain type 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel like we could make that refactor in payment service side to derive token when not provided then plumb that down to here

README.md Outdated
```

##### `balance`
```shell
turbo balance --wallet-file '../path/to/my/wallet.json'
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this only work with Arweave wallets? If so, we might want to say so.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, it will also work with sol.secretKey.json wtih secretKey as a uintarray, eth/kyve.privateKey.txt where content is a string of the privateKey

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is included in the global options section above:

image

README.md Outdated
- `-a, --address <address>` - Address to get the balance of
- `-a, --address <address>` - Address to top up
- `-c, --currency <currency>` - Currency to top up with
- `-v, --value <value>` - Amount to top up with in the currency's smallest unit value
Copy link
Contributor

@arielmelendez arielmelendez Sep 5, 2024

Choose a reason for hiding this comment

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

in the currency's smallest unit value

You should provide an example or two here

@fedellen fedellen merged commit 043efa9 into alpha Sep 6, 2024
9 checks passed
@fedellen fedellen deleted the PE-6635-top-up-command branch September 6, 2024 15:32
@dtfiedler
Copy link
Collaborator

🎉 This PR is included in version 1.13.0-alpha.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dtfiedler
Copy link
Collaborator

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants