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

Debug account creation #3

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@metamask/providers": "^17.0.0",
"@wharfkit/account-creation-plugin-metamask": "git+https://github.com/wharfkit/account-creation-plugin-metamask.git#master",
"@wharfkit/session": "next",
"@wharfkit/transact-plugin-resource-provider": "^1.1.1",
"@wharfkit/wallet-plugin-metamask": "next",
Expand Down
15 changes: 10 additions & 5 deletions packages/site/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { type Writable, writable } from 'svelte/store';
import { TransactPluginResourceProvider } from '@wharfkit/transact-plugin-resource-provider';
import { WalletPluginMetaMask } from '@wharfkit/wallet-plugin-metamask';
import { AccountCreationPluginMetamask } from '@wharfkit/account-creation-plugin-metamask';
import CreateAccount from '../components/CreateAccount.svelte';

let provider: MetaMaskInpageProvider;
Expand All @@ -25,7 +26,8 @@
walletPlugins: [new WalletPluginMetaMask()]
},
{
transactPlugins: [new TransactPluginResourceProvider()]
transactPlugins: [new TransactPluginResourceProvider()],
accountCreationPlugins: [new AccountCreationPluginMetamask()]
}
);

Expand Down Expand Up @@ -56,6 +58,12 @@
await kit.logout();
}

async function createAccount() {
console.log('calling createAccount');
const result = await kit.createAccount();
alert(`Account created: ${result.accountName}`);
}

async function test() {
if ($session) {
const action = {
Expand Down Expand Up @@ -103,9 +111,6 @@
<button on:click={logout}>Logout</button>
{:else}
<button on:click={login} disabled={!$isMetaMaskReady}>Login</button>
<button on:click={createAccount} disabled={!$isMetaMaskReady}>Create Account</button>
{/if}

<hr />

<CreateAccount />
{/if}
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/template-snap-monorepo.git"
},
"source": {
"shasum": "4X7nZ0EHhVDhRIBfDNzV/T5771WqvxgL3qEEaYZwPmU=",
"shasum": "iO/FZiDyyd6PCdWN771xEnZJOWJt6lNuoerat3C0m60=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Loading
Loading