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

feat: support resolving tzero id w siws #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/multisig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@talismn/connect-wallets": "^1.1.3",
"@talismn/dot-pool-selector": "snapshot",
"@talismn/icons": "workspace:^",
"@talismn/siws": "0.0.8",
"@talismn/siws": "0.0.12",
"@talismn/ui": "workspace:^",
"@talismn/util": "^0.2.0",
"@uiw/codemirror-themes": "^4.21.13",
Expand Down
3 changes: 2 additions & 1 deletion apps/multisig/src/domains/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useMemo, useState } from 'react'
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
import { web3FromSource } from '@polkadot/extension-dapp'
import { SiwsMessage } from '@talismn/siws'
import { Siws, SiwsMessage } from '@talismn/siws'
import { InjectedAccount, accountsState } from '../extension'
import persistAtom from '../persist'
import { captureException } from '@sentry/react'
Expand Down Expand Up @@ -114,6 +114,7 @@ export const useSignIn = () => {
statement: 'Welcome to Signet! Please sign in to continue.',
chainName: 'Substrate',
azeroId: resolve(ss58Address)?.a0id,
version: Siws.CURRENT_VERSION,
})

// sign payload for backend verification
Expand Down
4 changes: 2 additions & 2 deletions apps/multisig/src/domains/azeroid/AzeroIDResolver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
resolveDomainToAddress,
alephzero,
alephzeroTestnet,
CONTRACT_ADDRESSES,
SupportedChainId,
} from '@azns/resolver-core'
import { ApiPromise, WsProvider } from '@polkadot/api'
import { Address } from '@util/addresses'
Expand Down Expand Up @@ -57,8 +57,8 @@ const resolveAzeroIDQuery = async (query: string, api: ApiPromise, testnetApi?:
if (!address) return resolve({})

const testnetAzeroIdQuery = resolveAddressToDomain(query, {
chainId: SupportedChainId.AlephZeroTestnet,
customApi: testnetApi,
customContractAddresses: CONTRACT_ADDRESSES['alephzero-testnet'],
})
const azeroIdQuery = resolveAddressToDomain(query, { customApi: api })
const [testnetAzeroId, azeroId] = await Promise.all([testnetAzeroIdQuery, azeroIdQuery])
Expand Down
6 changes: 3 additions & 3 deletions apps/multisig/src/layouts/Dapps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const Dapps: React.FC = () => {
<Tabs defaultValue="apps">
<TabsList>
<TabsTrigger value="apps">Dapps</TabsTrigger>
<TabsTrigger value="custom-input">Custom Input</TabsTrigger>
<TabsTrigger value="custom-url">Custom URL</TabsTrigger>
</TabsList>
<TabsContent value="apps">
<div className="flex flex-wrap gap-[12px]">
Expand All @@ -247,7 +247,7 @@ export const Dapps: React.FC = () => {
))}
</div>
</TabsContent>
<TabsContent value="custom-input">
<TabsContent value="custom-url">
<div className="w-full">
<form className="flex flex-col sm:flex-row items-center w-full gap-[12px]" onSubmit={handleVisitDapp}>
<div className="w-full [&>div]:w-full">
Expand All @@ -257,7 +257,7 @@ export const Dapps: React.FC = () => {
Visit Dapp
</Button>
</form>
<div className="w-full p-[16px] mt-[12px] bg-gray-700 rounded-[20px] border-gray-400 border">
<div className="w-full p-[16px] mt-[12px] bg-gray-700 rounded-[16px] border-gray-400 border">
<p>
Note that dapps have to integrate with the{' '}
<Link
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10734,7 +10734,7 @@ __metadata:
"@talismn/development": "workspace:^"
"@talismn/dot-pool-selector": snapshot
"@talismn/icons": "workspace:^"
"@talismn/siws": 0.0.8
"@talismn/siws": 0.0.12
"@talismn/ui": "workspace:^"
"@talismn/util": ^0.2.0
"@testing-library/jest-dom": ^5.16.5
Expand Down Expand Up @@ -10870,16 +10870,16 @@ __metadata:
languageName: unknown
linkType: soft

"@talismn/siws@npm:0.0.8":
version: 0.0.8
resolution: "@talismn/siws@npm:0.0.8"
"@talismn/siws@npm:0.0.12":
version: 0.0.12
resolution: "@talismn/siws@npm:0.0.12"
dependencies:
"@azns/resolver-core": ^1.6.0
"@types/jest": ^29.5.8
peerDependencies:
"@polkadot/api": ^10.10.1
"@polkadot/extension-dapp": ^0.46.5
checksum: 5338e6350b4eb5da178d4b09264c6460f986d907b3bda2878c92b04a3b21dfcc7204162e72de27cbe2b77e093d7589dc103344de15c457407e920ba43db7ad27
checksum: 633403ce2e06aa4ff4baed1f5ca0bfb3fecc2508657d2b7e829554a75744f93f6c24b0e0240b2cbd512c85aaf29c2e0388713c93f5087b1d787f7fa6658e2252
languageName: node
linkType: hard

Expand Down