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

1169: Add documentation data #7

Merged
merged 3 commits into from
May 24, 2024
Merged

1169: Add documentation data #7

merged 3 commits into from
May 24, 2024

Conversation

9inpachi
Copy link
Collaborator

No description provided.

@9inpachi 9inpachi requested review from guestn and rish-puffer May 24, 2024 11:52
const [walletAddress] = await pufferClient.requestAddresses();
```

With the wallet address at hand, make the transacation.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix in next PR. Thanks for the catch.

@9inpachi 9inpachi merged commit ab84b71 into main May 24, 2024
1 check passed
Copy link

@rish-puffer rish-puffer left a comment

Choose a reason for hiding this comment

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

left a few comments, none are blockers until we go public.

} from '@pufferfinance/puffer-sdk';

// highlight-start
const walletClient = PufferClientHelpers.createWalletClient({

Choose a reason for hiding this comment

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

we should enlist, or add a link to another doc of supported inputs here.

createWalletClient function definition would also be ideal.

Copy link
Collaborator Author

@9inpachi 9inpachi May 24, 2024

Choose a reason for hiding this comment

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

createWalletClient function definition would also be ideal.

The name overlaps with viem's function, so I thought it might be better to have it inside a class kind of like a namespace to avoid confusion.

Our function here gives a more simpler interface to create a wallet. Which is to use either RPC URLs or the JSON-RPC API (window.ethereum). It's possible with viem but it's not as much intuitive since it's a low-level library.

### 3. Interact with the Contract

```ts
const { transact, estimate } = pufferClient.depositETH(walletAddress);

Choose a reason for hiding this comment

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

similar comment, somewhere we should document what depositETH returns, and what other functions can we call using pufferClient

Copy link
Collaborator Author

@9inpachi 9inpachi May 24, 2024

Choose a reason for hiding this comment

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

This is coming as part of the API reference documentation in the next PR.

@@ -0,0 +1,40 @@
---

Choose a reason for hiding this comment

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

If we're going the guides route, there should be multiple examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right now, we only have the depositETH method which only does either a transaction or an estimate. Will add more once the SDK has more functionality.

@9inpachi 9inpachi deleted the 1169/docs-data branch May 28, 2024 08:34
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