Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
fess-v committed Sep 27, 2023
1 parent 381938d commit 77a6942
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/common/signature/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export function getStructuredDataPayloadFromToken(requestToken: string) {
return {
...(result as unknown as CommonSignaturePayload),
message: deserializeCV(Buffer.from(result.message, 'hex')),
domain: deserializeCV(Buffer.from(result.domain, 'hex')) as StructuredMessageDataDomain,
domain: deserializeCV(Buffer.from(result.domain, 'hex')),
};
}
2 changes: 1 addition & 1 deletion src/app/common/transactions/stacks/is-sip-10-transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ContractCallPayload, StacksTransaction } from '@stacks/transactions';

export function isSip10Transfer(tx: StacksTransaction) {
if (!tx.payload || !('functionName' in tx.payload)) return false;
const payload = tx.payload as ContractCallPayload;
const payload = tx.payload;
return (
payload.functionName.content === 'transfer' &&
(payload.functionArgs.length === 3 || payload.functionArgs.length === 4)
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/utils/use-waiting-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useInterval } from './use-interval';
export type WaitingMessages = Record<number, string>;

function messageForSecondsPassed(waitingMessages: WaitingMessages, seconds: number) {
return waitingMessages[seconds as keyof typeof waitingMessages];
return waitingMessages[seconds];
}

export const useWaitingMessage = (
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/errors/app-error-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
borderRadius="12px"
backgroundColor="ink.1000"
width="100%"
code={value as string}
code={value}
language="bash"
Prism={Prism as any}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function useLatestLedgerError() {
const state = location.state;
if (!state || state === null) return null;
if (typeof state === 'object') {
const error = (state as any).latestLedgerError;
const error = state.latestLedgerError;
if (error) return error;
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/app/query/bitcoin/ordinals/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function getTaprootAddress({ index, keychain, network }: GetTaprootAddres
throw new Error('Expected publicKey to be defined');
}

const payment = getTaprootPayment(addressIndex.publicKey!, network);
const payment = getTaprootPayment(addressIndex.publicKey, network);

if (!payment.address) throw new Error('Expected address to be defined');

Expand Down
6 changes: 2 additions & 4 deletions src/app/query/stacks/bns/bns.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ async function fetchBnsxName(client: StacksClient, address: string): Promise<str
});
if (!res.okay || !res.result) return null;
const { result } = res;
const cv = deserializeCV(result) as OptionalCV<
TupleCV<{ name: BufferCV; namespace: BufferCV }>
>;
const cv = deserializeCV(result);
if (cv.type === ClarityType.OptionalNone) return null;
const { name, namespace } = cv.value.data;
const fullName = `${bytesToAscii(name.buffer)}.${bytesToAscii(namespace.buffer)}`;
Expand Down Expand Up @@ -83,7 +81,7 @@ async function fetchBnsxOwner(client: StacksClient, fqn: string): Promise<string

if (!res.okay || !res.result) return null;
const { result } = res;
const cv = deserializeCV(result) as OptionalCV<TupleCV<{ owner: PrincipalCV; id: UIntCV }>>;
const cv = deserializeCV(result);
if (cv.type === ClarityType.OptionalNone) return null;
const ownerCV = cv.value.data.owner;
return principalToString(ownerCV);
Expand Down
2 changes: 1 addition & 1 deletion src/app/query/stacks/nonce/account-nonces.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function fetchAccountNonces(client: StacksClient, limiter: RateLimiter) {
await limiter.removeTokens(1);
return client.accountsApi.getAccountNonces({
principal,
}) as Promise<AddressNonces>;
});
};
}

Expand Down

0 comments on commit 77a6942

Please sign in to comment.