-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
117 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export const baseUrl = 'http://localhost:3333' | ||
export const networkParams = 'network=rococo' | ||
export const landingPageUrl = `${baseUrl}?${networkParams}` | ||
export const settingsPageUrl = `${baseUrl}/settings?${networkParams}` | ||
export const defaultNetwork = 'rococo' | ||
const WATCH_ACCOUNT_ANCHOR = 'watched-accounts' | ||
export const landingPageNetwork = (networkName: string) => `${baseUrl}?network=${networkName}` | ||
export const landingPageUrl = landingPageNetwork('rococo') | ||
export const settingsPageUrl = `${baseUrl}/settings?network=${defaultNetwork}` | ||
export const settingsPageWatchAccountUrl = `${settingsPageUrl}#${WATCH_ACCOUNT_ANCHOR}` | ||
export const landingPageAddressUrl = (address: string) => | ||
`${baseUrl}?${networkParams}&address=${address}` | ||
export const landingPageAddressUrl = (address: string) => `${landingPageUrl}&address=${address}` |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { useMemo } from 'react' | ||
import { useApi } from '../contexts/ApiContext' | ||
|
||
export const useHasIdentityPallet = () => { | ||
const { api } = useApi() | ||
const hasIdentityPallet = useMemo(() => !!api && !!api.tx?.identity?.setIdentity, [api]) | ||
|
||
return hasIdentityPallet | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ApiPromise } from '@polkadot/api' | ||
import { SubmittableExtrinsic } from '@polkadot/api/types' | ||
import { ISubmittableResult } from '@polkadot/types/types' | ||
import { Weight } from '@polkadot/types/interfaces' | ||
import { HexString, MultisigStorageInfo } from '../types' | ||
|
||
interface Params { | ||
api: ApiPromise | ||
threshold: number | ||
otherSignatories: string[] | ||
tx?: SubmittableExtrinsic<'promise', ISubmittableResult> | HexString | ||
weight?: Weight | ||
when?: MultisigStorageInfo['when'] | ||
} | ||
|
||
const LEGACY_ASMULTI_PARAM_LENGTH = 6 | ||
|
||
export const getAsMultiTx = ({ api, threshold, otherSignatories, tx, weight, when }: Params) => { | ||
return api.tx.multisig.asMulti.meta.args.length === LEGACY_ASMULTI_PARAM_LENGTH | ||
? api.tx.multisig.asMulti(threshold, otherSignatories, when || null, tx, false, weight || 0) | ||
: api.tx.multisig.asMulti( | ||
threshold, | ||
otherSignatories, | ||
when || null, | ||
tx, | ||
weight || { | ||
refTime: 0, | ||
proofSize: 0 | ||
} | ||
) | ||
} |
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,2 +1,2 @@ | ||
export const isTypeAccount = (typeName?: string) => | ||
!!typeName && ['AccountIdLookupOf'].includes(typeName) | ||
!!typeName && ['AccountIdLookupOf', 'LookupSource'].includes(typeName) |