-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
add .tgz packed filed of locally imported packcages to allow deploymnet
Add packed local packages
update local packages
map Web3 auth to window.cardano.nufiSSO [DEMO]
setHideWidget(() => hideWidget) | ||
didInject = true; | ||
} | ||
initNufiDappSdk(); |
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.
- Initialize core sdk
setCandidateWallet(walletName === 'nufiSSO' ? 'sso' : 'standard') | ||
|
||
if (walletName === 'nufiSSO') { | ||
initNufiDappCardanoSdk('sso'); |
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.
- 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() |
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.
- 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", |
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.
- Install dependencies.
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.