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

SDK Example (do not merge & keep alive) #13

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

SDK Example (do not merge & keep alive) #13

wants to merge 20 commits into from

Conversation

izri16
Copy link
Collaborator

@izri16 izri16 commented Dec 20, 2023

This PR showcases a very raw NuFi dapp SDK integration into the example dapp. Please do not mind all the changes as this requires a properly polished example, that is yet to be made.
Instead, consider the below comments which should give you a good enough baseline for integration.

setHideWidget(() => hideWidget)
didInject = true;
}
initNufiDappSdk();
Copy link
Collaborator Author

@izri16 izri16 Dec 20, 2023

Choose a reason for hiding this comment

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

  1. Initialize core sdk

setCandidateWallet(walletName === 'nufiSSO' ? 'sso' : 'standard')

if (walletName === 'nufiSSO') {
initNufiDappCardanoSdk('sso');
Copy link
Collaborator Author

@izri16 izri16 Dec 20, 2023

Choose a reason for hiding this comment

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

  1. Init SSO sdk when user choose it. If not supporting metamask snap SDK you can call this immediatelly during initial load.

setIsDisconnecting(true);
resetStatus();
await signOut({ redirect: false });
setIsDisconnecting(false);
hideWidget?.()
hideWidget()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. Hide widget on disconnect.

@@ -14,7 +14,8 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@fontsource/jetbrains-mono": "^4.5.11",
"@nufi/dapp-client-cardano": "link:../nufi/packages/dapp-client/cardano",
"@nufi/dapp-client-cardano": "https://github.com/nufi-official/nufi-dapp-sdk/releases/download/v0.1.0/nufi-dapp-client-cardano-0.1.0.tgz",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  1. Install dependencies.

@izri16 izri16 changed the title SDK Example (do not close & do not merge) SDK Example (do not merge & keep alive) Jan 8, 2024
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