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

938: Implement depositETH and set up the project #4

Merged
merged 14 commits into from
May 21, 2024

Conversation

9inpachi
Copy link
Collaborator

@9inpachi 9inpachi commented May 20, 2024

The depositETH is working. It can be tested using the following HTML file that imports the build. Make sure to first build the SDK using pnpm build or pnpm dev.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Example</title>
  </head>
  <body>
    <button id="button">Deposit</button>

    <script type="module">
      import { PufferClient } from './dist/main.js';

      document.getElementById('button').addEventListener('click', async () => {
        const client = new PufferClient('holesky');
        const [walletAddress] = await client.requestAddresses();

        const { transact, estimate } = client.depositETH(walletAddress);

        console.log(await estimate());
        console.log(await transact(BigInt(1)));
      });
    </script>
  </body>
</html>

@9inpachi 9inpachi changed the title Implement depositETH and set up the project 938: Implement depositETH and set up the project May 20, 2024
@9inpachi 9inpachi merged commit 792477e into 938/smart-contract-code May 21, 2024
1 check passed
@9inpachi 9inpachi deleted the 938/deposit-eth-impl branch May 28, 2024 09:04
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