-
Notifications
You must be signed in to change notification settings - Fork 502
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 coinbase-wallet-sdk #904
Adds coinbase-wallet-sdk #904
Conversation
@erin-at-work Let us know when this is ready for review! Closes #885 |
8053f91
to
c17d96f
Compare
@aaronbarnardsound This is now updated, checked & ready for review! LMK of any changes! |
Hey @erin-at-work, this looks great and everything works as expected, thanks for the PR! I was thinking we could simplify/shorten the naming so that the folder name is just Also if we could update the |
3ac2e5d
to
2ede628
Compare
Made the update!
Maybe it should be done on a followup PR after the package is published? |
Yeah good point, that would probably best. |
One more thing, could you please remove the |
Actually I can do that, so all good. |
Sorry I missed this.. Thank you! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{#if $wallets$}
<button on:click={() => onboard.state.actions.updateBalances()}
>Update Wallet Balance</button
>
<div class="notify-chain-container">
<div class="notify-action-container">
<button
on:click={() =>
onboard.state.actions.customNotification({
type: 'hint',
message: 'This is a custom DApp hint',
autoDismiss: 0
})}>Send Hint Notification</button
>
<button
on:click={() => {
const { update, dismiss } =
onboard.state.actions.customNotification({
type: 'pending',
message:
'This is a custom DApp pending notification to use however you want',
autoDismiss: 0
})
setTimeout(
() =>
update({
eventCode: 'dbUpdateSuccess',
message: 'Updated status for custom notification',
type: 'success',
autoDismiss: 0
}),
4000
)
}}>Send Success Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom DApp success notification to use however you want',
autoDismiss: 0,
type: 'pending'
})}>Send Pending Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
type: 'error',
message:
'This is a custom DApp Error notification to use however you want',
autoDismiss: 0
})}>Send Error Notification</button
>
<button
on:click={() =>
onboard.state.actions.customNotification({
message:
'This is a custom non-descript DApp notification to use however you want',
autoDismiss: 0
})}>Send DApp Notification</button
>
</div>
<div class="switch-chain-container">
<button on:click={() => onboard.setChain({ chainId: '0x1' })}
>Set Chain to Mainnet</button
>
<button on:click={() => onboard.setChain({ chainId: '0x4' })}
>Set Chain to Rinkeby</button
>
<button on:click={() => onboard.setChain({ chainId: '0x89' })}
>Set Chain to Matic</button
>
</div>
</div>
{/if}
{#if
{#each
<div>Chains: {JSON.stringify(chains, null, 2)}</div>
{#each accounts as { address, ens, balance }}
<div
class="account-info"
style="margin-top: 0.25rem; margin-bottom: 0.25rem; padding: 0.25rem; border: 1px solid gray;"
>
<div>Address: {address}</div>
{#if balance}
<div>Balances:</div>
{#each Object.entries(balance) as [token, amount]}
<div style="margin-left: 1rem;">{token}: {amount}</div>
{/each}
{/if}
{#if ens}
<div>ENS Name: {(ens && ens.name) || ''}</div>
{/if}
</div>
<div>
<input
id="sign-msg-input"
type="text"
class="text-input"
placeholder="Message..."
bind:value={signMsg}
/>
<button on:click={signMessage(provider, address)}>
Sign Message
</button>
</div>
<div>
<input
id="sign-type-msg-input"
type="text"
class="text-input"
placeholder="Typed message..."
bind:value={signTypedMsg}
/>
<button on:click={signTypedMessage(provider, address)}>
Sign Typed Message
</button>
</div>
<div>
<input
type="text"
class="text-input"
placeholder="0x..."
bind:value={toAddress}
/>
<button on:click={sendTransaction(provider)}>
Send Transaction
</button>
</div>
<div>
<input
type="text"
class="text-input"
placeholder="0x..."
bind:value={toAddress}
/>
<button on:click={sendTransactionWithPreFlight(provider, balance)}>
Send with Preflight Notifications
</button>
</div>
<div class="sign-transaction">
<textarea
bind:value={transactionObject}
id="sign-transaction-input"
type="text"
class="sign-transaction-textarea"
/>
<button
on:click={signTransactionMessage(provider)}
style="margin: 0 0 0 .5rem"
>
Sign Transaction
</button>
</div>
{/each}
<button
style="margin-top: 0.5rem;"
on:click={() => onboard.disconnectWallet({ label })}
>
Disconnect Wallet
</button>
</div>
{/each}
{/if}
Description
Adds support for the updated coinbase-wallet-sdk and deprecates walletlink.
Checked against locally run demo:
Checklist
package.json
is incremented following semantic versioning