Skip to content

Commit

Permalink
feat: release pkg 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweigh committed Sep 20, 2024
1 parent 5fa4a08 commit af30b0f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xterio-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xterio-sdk/auth",
"version": "0.0.5",
"version": "0.0.6",
"description": "xterio-auth",
"author": "xterio platform",
"license": "ISC",
Expand Down
2 changes: 1 addition & 1 deletion xterio-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@xterio-sdk/wallet",
"private": false,
"version": "0.0.5",
"version": "0.0.6",
"description": "xterio-wallet",
"author": "xterio platform",
"license": "ISC",
Expand Down
14 changes: 11 additions & 3 deletions xterio-wallet/src/contexts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ interface IWalletContextState extends Pick<IPnWalletState, 'signMessage' | 'sign

const WalletContext = createContext<IWalletContextState>(initState as IWalletContextState)

const WalletContextProvider: React.FC<PropsWithChildren<IXterioWalletContextProps>> = ({ children, env, ...rest }) => {
const WalletContextProvider: React.FC<PropsWithChildren<IXterioWalletContextProps>> = ({
children,
env,
enableAuthInit = true,
...rest
}) => {
const [mounted, setMounted] = useState<boolean>()
const [aaAddress, setAaAddress] = useState('')
const [userinfo, setUserInfo] = useState<IUserInfo | undefined>(XterioAuth.userinfo)
Expand Down Expand Up @@ -165,12 +170,15 @@ const WalletContextProvider: React.FC<PropsWithChildren<IXterioWalletContextProp
if (mounted) return
setMounted(true)
log('xterio wallet initial')
XterioAuth.init(rest, env)
if (enableAuthInit) {
log('auth initial in wallet')
XterioAuth.init(rest, env)
}
XterioAuth.getUserInfo((info) => {
log('emiter auth userinfo=', info)
initLogic(info)
})
}, [env, initLogic, mounted, rest])
}, [enableAuthInit, env, initLogic, mounted, rest])

return (
<WalletContext.Provider
Expand Down
2 changes: 1 addition & 1 deletion xterio-wallet/src/contexts/pnWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const usePnWallet = (init_address?: string, _env?: Env): IPnWalletState =
return userInfo
})
.catch((error: Error) => {
log('connect pn eoa error', error)
log('connect pn eoa error', error, targetChain, chains)
return undefined
})
return res
Expand Down
1 change: 1 addition & 0 deletions xterio-wallet/src/interfaces/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Env, ISSoTokensParams } from '@xterio-sdk/auth'

export interface IXterioWalletContextProps extends Partial<ISSoTokensParams> {
env?: Env
enableAuthInit?: boolean
}

export type PnUserInfoType = import('@particle-network/auth-core').UserInfo | undefined
Expand Down

0 comments on commit af30b0f

Please sign in to comment.