-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into tc/fix-leap-snap-overload
- Loading branch information
Showing
35 changed files
with
6,778 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Integrate Capsule | ||
|
||
## Install Leap Login Capsule UI | ||
|
||
```bash | ||
yarn add @leapwallet/cosmos-social-login-capsule-provider-ui | ||
``` | ||
|
||
## Fill your Capsule Config in `GrazProvider` | ||
|
||
```javascript | ||
<GrazProvider | ||
grazOptions={{ | ||
chains, | ||
capsuleConfig: { | ||
apiKey: process.env.NEXT_PUBLIC_CAPSULE_API_KEY, | ||
env: process.env.NEXT_PUBLIC_CAPSULE_ENV, | ||
}, | ||
}} | ||
/> | ||
``` | ||
|
||
## Next JS Usage | ||
|
||
For Next JS we recommend to load the module dynamically to avoid SSR issues. And use `useCapsule` hook to get the client and other capsule related states. | ||
|
||
```javascript | ||
const LeapSocialLogin = dynamic( | ||
() => import("@leapwallet/cosmos-social-login-capsule-provider-ui").then((m) => m.CustomCapsuleModalView), | ||
{ ssr: false }, | ||
); | ||
|
||
const HomePage = () => { | ||
const { client, modalState, onAfterLoginSuccessful, setModalState, onLoginFailure } = useCapsule(); | ||
|
||
return ( | ||
<div> | ||
<LeapSocialLogin | ||
capsule={client?.getClient() || undefined} | ||
onAfterLoginSuccessful={() => { | ||
onAfterLoginSuccessful?.(); | ||
}} | ||
onLoginFailure={() => { | ||
onLoginFailure(); | ||
}} | ||
setShowCapsuleModal={setModalState} | ||
showCapsuleModal={modalState} | ||
/> | ||
</div> | ||
); | ||
}; | ||
``` | ||
Thats it, now you can use capsule as your wallet provider. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Update Wallet Default Options | ||
|
||
to set default options for the wallet. | ||
|
||
```javascript | ||
<GrazProvider | ||
grazOptions={{ | ||
chains: mainnetChains, | ||
walletDefaultOptions: { | ||
sign: { | ||
preferNoSetFee: true, | ||
disableBalanceCheck: true, | ||
preferNoSetMemo: true | ||
}, | ||
}, | ||
}} | ||
> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# useCapsule | ||
|
||
Hook to interact with [@leapwallet/cosmos-social-login-capsule-provider-ui](https://www.npmjs.com/package/@leapwallet/cosmos-social-login-capsule-provider-ui) | ||
|
||
#### Usage | ||
|
||
```javascript | ||
const LeapSocialLogin = dynamic( | ||
() => import("@leapwallet/cosmos-social-login-capsule-provider-ui").then((m) => m.CustomCapsuleModalView), | ||
{ ssr: false }, | ||
); | ||
|
||
const HomePage = () => { | ||
const { client, modalState, onAfterLoginSuccessful, setModalState, onLoginFailure } = useCapsule(); | ||
|
||
return ( | ||
<div> | ||
<LeapSocialLogin | ||
capsule={client?.getClient() || undefined} | ||
onAfterLoginSuccessful={() => { | ||
onAfterLoginSuccessful?.(); | ||
}} | ||
onLoginFailure={() => { | ||
onLoginFailure(); | ||
}} | ||
setShowCapsuleModal={setModalState} | ||
showCapsuleModal={modalState} | ||
/> | ||
</div> | ||
); | ||
}; | ||
``` | ||
#### Return Value | ||
```tsx | ||
{ | ||
setModalState: (state: boolean) => void; | ||
modalState: boolean; | ||
client: CapsuleProvider | null; | ||
onAfterLoginSuccessful: (() => Promise<void>) | undefined; | ||
onLoginFailure: () => void; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
declare namespace NodeJS { | ||
interface ProcessEnv { | ||
readonly EXPORT_DOCS?: string; | ||
readonly NEXT_PUBLIC_CAPSULE_ENV?: "DEV" | "SANDBOX" | "BETA" | "PROD"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
declare namespace NodeJS { | ||
interface ProcessEnv { | ||
readonly EXPORT_DOCS?: string; | ||
readonly NEXT_PUBLIC_CAPSULE_ENV?: "DEV" | "SANDBOX" | "BETA" | "PROD"; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "graz", | ||
"description": "React hooks for Cosmos", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": "Griko Nibras <[email protected]>", | ||
"repository": "https://github.com/graz-sh/graz.git", | ||
"homepage": "https://github.com/graz-sh/graz", | ||
|
@@ -47,7 +47,9 @@ | |
"@cosmjs/proto-signing": "*", | ||
"@cosmjs/stargate": "*", | ||
"@cosmjs/tendermint-rpc": "*", | ||
"long": "*", | ||
"@leapwallet/cosmos-social-login-capsule-provider": "^0.0.30", | ||
"@leapwallet/cosmos-social-login-capsule-provider-ui": "^0.0.47", | ||
"long": "^4", | ||
"react": ">=17" | ||
}, | ||
"peerDependenciesMeta": { | ||
|
@@ -70,7 +72,7 @@ | |
"cac": "^6.7.14", | ||
"cosmos-directory-client": "0.0.6", | ||
"wadesta": "^0.0.5", | ||
"zustand": "^4.4.1" | ||
"zustand": "^4.5.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.17.15", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.