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

adds wallet sdk docs for sep7 #926

Merged
merged 4 commits into from
Aug 21, 2024
Merged

adds wallet sdk docs for sep7 #926

merged 4 commits into from
Aug 21, 2024

Conversation

aristidesstaffieri
Copy link
Contributor

Adds docs and walkthrough for wallet-sdk sep7 classes.
Adds examples of how to use the tx and pay operations.

@stellar-jenkins
Copy link

@CassioMG
Copy link
Contributor

CassioMG commented Aug 20, 2024

@aristidesstaffieri I think the content from this PR is great, but I noticed it's mostly exploring only the part of parsing a given existing string to a Sep7Pay or Sep7Tx object.

There is this other positive aspect of the SDK which is creating those Sep7 objects using the existing getters and setters of the Sep7 class, so devs don't need to worry about decoding/encoding stuff. Like the below:

    const uri = Sep7Tx.forTransaction(tx);
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.toString(); // encodes everything and converts to a uri string

    const uri = Sep7Pay.forDestination("G...");
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.assetCode = "USDC";
    uri.assetIssuer = "G...";
    uri.amount = "10";
    uri.toString(); // encodes everything and converts to a uri string

There is also the addSignature and verifySignature functions which would be nice to highlight! :)

What do you think?

@aristidesstaffieri
Copy link
Contributor Author

@aristidesstaffieri I think the content from this PR is great, but I noticed it's mostly exploring only the part of parsing a given existing string to a Sep7Pay or Sep7Tx object.

There is this other positive aspect of the SDK which is creating those Sep7 objects using the existing getters and setters of the Sep7 class, so devs don't need to worry about decoding/encoding stuff. Like the below:

    const uri = Sep7Tx.forTransaction(tx);
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.toString(); // encodes everything and converts to a uri string

    const uri = Sep7Pay.forDestination("G...");
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.assetCode = "USDC";
    uri.assetIssuer = "G...";
    uri.amount = "10";
    uri.toString(); // encodes everything and converts to a uri string

There is also the addSignature and verifySignature functions which would be nice to highlight! :)

What do you think?

Yeah totally, I could expand on using a few setters for each operation. I'll show the signature helpers as well. 👍

@stellar-jenkins
Copy link

@aristidesstaffieri
Copy link
Contributor Author

@aristidesstaffieri I think the content from this PR is great, but I noticed it's mostly exploring only the part of parsing a given existing string to a Sep7Pay or Sep7Tx object.
There is this other positive aspect of the SDK which is creating those Sep7 objects using the existing getters and setters of the Sep7 class, so devs don't need to worry about decoding/encoding stuff. Like the below:

    const uri = Sep7Tx.forTransaction(tx);
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.toString(); // encodes everything and converts to a uri string

    const uri = Sep7Pay.forDestination("G...");
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.assetCode = "USDC";
    uri.assetIssuer = "G...";
    uri.amount = "10";
    uri.toString(); // encodes everything and converts to a uri string

There is also the addSignature and verifySignature functions which would be nice to highlight! :)
What do you think?

Yeah totally, I could expand on using a few setters for each operation. I'll show the signature helpers as well. 👍

@CassioMG I added these in 86543bb. What do you think?

@stellar-jenkins
Copy link

@CassioMG
Copy link
Contributor

@aristidesstaffieri I think the content from this PR is great, but I noticed it's mostly exploring only the part of parsing a given existing string to a Sep7Pay or Sep7Tx object.
There is this other positive aspect of the SDK which is creating those Sep7 objects using the existing getters and setters of the Sep7 class, so devs don't need to worry about decoding/encoding stuff. Like the below:

    const uri = Sep7Tx.forTransaction(tx);
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.toString(); // encodes everything and converts to a uri string

    const uri = Sep7Pay.forDestination("G...");
    uri.callback = "https://example.com/callback";
    uri.msg = "here goes a message";
    uri.assetCode = "USDC";
    uri.assetIssuer = "G...";
    uri.amount = "10";
    uri.toString(); // encodes everything and converts to a uri string

There is also the addSignature and verifySignature functions which would be nice to highlight! :)
What do you think?

Yeah totally, I could expand on using a few setters for each operation. I'll show the signature helpers as well. 👍

@CassioMG I added these in 86543bb. What do you think?

@aristidesstaffieri looks good, thanks for the changes :) I left a few comments

Copy link
Contributor

@CassioMG CassioMG left a comment

Choose a reason for hiding this comment

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

LGTM

@stellar-jenkins
Copy link

@aristidesstaffieri aristidesstaffieri merged commit ee80b8a into main Aug 21, 2024
2 checks passed
@aristidesstaffieri aristidesstaffieri deleted the as-wallet-sep7 branch August 21, 2024 15:15
janewang pushed a commit that referenced this pull request Sep 12, 2024
* adds wallet sdk docs for sep7

* adds asset code and issuer to payment op, uses parseSep7Uri to parse uri before instantiation

* adds examples of parameter setters and examples for addSignature and verifySignature

* tweaks params and fixes typo
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.

3 participants