Skip to content

Commit 399647c

Browse files
chore(transfer): linting
1 parent 7a6d3e5 commit 399647c

15 files changed

Lines changed: 100 additions & 83 deletions

File tree

‎common/config/rush/repo-state.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "a31e420779e3b795c18ccdb0f014563cb09ac915",
3+
"pnpmShrinkwrapHash": "a6b2414ab97b9cd239b6df977803e8dfdf765fdd",
44
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
55
}

‎packages/apps/docs/src/scripts/detectBrokenLinks.mjs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ function getBrokenLinks(filePath, links) {
3232
// places where the link could live
3333
const fileMDX = `${links[index]}.mdx`;
3434
const fileTSX = `${links[index]}.tsx`;
35-
const fileIndex =
36-
links[index]
37-
.split('/')
38-
.slice(0, links[index].split('/').length - 1)
39-
.join('/') + '/index';
35+
const fileIndex = `${links[index]
36+
.split('/')
37+
.slice(0, links[index].split('/').length - 1)
38+
.join('/')}/index`;
4039
const fileIndexMDX = `${fileIndex}.mdx`;
4140
const fileIndexTSX = `${fileIndex}.tsx`;
4241

‎packages/apps/transfer/src/pages/faucet/existing/index.tsx‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ export type RequestStatus = 'not started' | 'pending' | 'succeeded' | 'failed';
3333
interface FundExistingAccountResponseBody {
3434
result: {
3535
status: string;
36-
error: undefined | {
37-
message: string;
38-
};
36+
error:
37+
| undefined
38+
| {
39+
message: string;
40+
};
3941
};
4042
}
4143

42-
interface FundExistingAccountResponse extends Record<string, FundExistingAccountResponseBody> {}
44+
interface FundExistingAccountResponse
45+
extends Record<string, FundExistingAccountResponseBody> {}
4346

4447
const ExistingAccountFaucetPage: FC = () => {
4548
const { t } = useTranslation('common');
@@ -59,24 +62,27 @@ const ExistingAccountFaucetPage: FC = () => {
5962
setRequestStatus({ status: 'pending' });
6063

6164
try {
62-
const result = await fundExistingAccount(
65+
const result = (await fundExistingAccount(
6366
accountName,
6467
chainID,
6568
AMOUNT_OF_COINS_FUNDED,
66-
) as FundExistingAccountResponse;
69+
)) as FundExistingAccountResponse;
6770

68-
const error = Object.values(result).find(response => response.result.status === 'failure');
71+
const error = Object.values(result).find(
72+
(response) => response.result.status === 'failure',
73+
);
6974

7075
if (error) {
71-
setRequestStatus({ status: 'failed', message: error.result.error?.message || t('An error occurred.')});
76+
setRequestStatus({
77+
status: 'failed',
78+
message: error.result.error?.message || t('An error occurred.'),
79+
});
7280
return;
7381
}
7482

7583
setRequestStatus({ status: 'succeeded' });
7684
} catch (err) {
77-
let message = err instanceof Error
78-
? err.message
79-
: String(err);
85+
const message = err instanceof Error ? err.message : String(err);
8086

8187
setRequestStatus({ status: 'failed', message });
8288
}

‎packages/apps/transfer/src/pages/transfer/module-explorer/index.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Breadcrumbs, TextField } from '@kadena/react-ui';
2+
23
import {
34
StyledAccountForm,
45
StyledForm,

‎packages/apps/transfer/src/pages/transfer/module-explorer/networks/[network]/chains/[chain]/modules/[module]/functions/[defun].tsx‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Pact, signWithChainweaver, getClient, isSignedCommand } from '@kadena/client';
1+
import {
2+
getClient,
3+
isSignedCommand,
4+
Pact,
5+
signWithChainweaver,
6+
} from '@kadena/client';
27
import { Button } from '@kadena/react-components';
38

49
import { Container, EditorGrid } from './styles';
@@ -40,7 +45,13 @@ const FunctionPage = () => {
4045
setOutput('');
4146
const scopedEval = new ScopedEval();
4247
console.log(code);
43-
scopedEval.eval(code, { Pact, getClient, signWithChainweaver, isSignedCommand, Logger });
48+
scopedEval.eval(code, {
49+
Pact,
50+
getClient,
51+
signWithChainweaver,
52+
isSignedCommand,
53+
Logger,
54+
});
4455
};
4556

4657
useEffect(() => {
@@ -95,7 +106,12 @@ const FunctionPage = () => {
95106
</Button>
96107
)}
97108
</>
98-
<AceViewer code={code} width={'100%'} readonly={false} onChange={(value: string) => setCode(value)} />
109+
<AceViewer
110+
code={code}
111+
width={'100%'}
112+
readonly={false}
113+
onChange={(value: string) => setCode(value)}
114+
/>
99115
</div>
100116
<div>
101117
<h3>{t('Output')}</h3>

‎packages/apps/transfer/src/services/cross-chain-transfer-finish/get-transfer-data.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
ChainwebChainId,
3-
ICommandResult,
4-
} from '@kadena/chainweb-node-client';
1+
import { ChainwebChainId, ICommandResult } from '@kadena/chainweb-node-client';
52
import { getClient } from '@kadena/client';
63
import { IPactEvent, IPactExec, PactValue } from '@kadena/types';
74

@@ -73,7 +70,7 @@ export async function getTransferData({
7370
});
7471
const chainInfos = await Promise.all(chainInfoPromises);
7572

76-
const request = chainInfos.find(chainInfo => requestKey in chainInfo);
73+
const request = chainInfos.find((chainInfo) => requestKey in chainInfo);
7774

7875
if (!request) {
7976
return { error: t('No request key found') };
@@ -93,13 +90,12 @@ export async function getTransferData({
9390
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9491
found?.continuation?.continuation.args as Array<any>;
9592

96-
const { step, stepHasRollback, pactId } = found
97-
?.continuation as IPactExec;
93+
const { step, stepHasRollback, pactId } = found?.continuation as IPactExec;
9894

9995
return {
10096
tx: {
10197
sender: {
102-
chain: "1", // todo: fix typing. // found.chainId.toString() as ChainwebChainId,
98+
chain: '1', // todo: fix typing. // found.chainId.toString() as ChainwebChainId,
10399
account: senderAccount,
104100
},
105101
receiver: {

‎packages/apps/transfer/src/services/faucet/index.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { ChainwebChainId, ChainwebNetworkId } from '@kadena/chainweb-node-client';
1+
import {
2+
ChainwebChainId,
3+
ChainwebNetworkId,
4+
} from '@kadena/chainweb-node-client';
25
import { getClient, isSignedCommand, Pact } from '@kadena/client';
36
import { genKeyPair, sign } from '@kadena/cryptography-utils';
47
import { PactNumber } from '@kadena/pactjs';
@@ -69,10 +72,7 @@ export const fundExistingAccount = async (
6972
chainId,
7073
});
7174

72-
transaction.sigs = [
73-
{ sig: signature1.sig },
74-
{ sig: signature2.sig },
75-
];
75+
transaction.sigs = [{ sig: signature1.sig }, { sig: signature2.sig }];
7676

7777
const { submit, pollStatus } = getClient(apiHost);
7878

‎packages/apps/transfer/src/services/modules/describe-module.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChainwebChainId } from '@kadena/chainweb-node-client';
2-
import { Pact, getClient } from '@kadena/client';
2+
import { getClient, Pact } from '@kadena/client';
33
import { createExp } from '@kadena/pactjs';
44

55
import {
@@ -29,10 +29,12 @@ export const describeModule = async (
2929
): Promise<IModuleResult> => {
3030
debug(describeModule.name);
3131
const networkId = chainNetwork[network].network;
32-
const { local } = getClient(getKadenaConstantByNetwork(network).apiHost({
33-
networkId,
34-
chainId,
35-
}));
32+
const { local } = getClient(
33+
getKadenaConstantByNetwork(network).apiHost({
34+
networkId,
35+
chainId,
36+
}),
37+
);
3638

3739
const transaction = Pact.builder
3840
.execution(Pact.modules['describe-module'](moduleName))

‎packages/apps/transfer/src/services/modules/list-module.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChainwebChainId } from '@kadena/chainweb-node-client';
2-
import { Pact, getClient } from '@kadena/client';
2+
import { getClient, Pact } from '@kadena/client';
33
import { createExp } from '@kadena/pactjs';
44

55
import {
@@ -27,10 +27,12 @@ export const listModules = async (
2727
): Promise<IModulesResult> => {
2828
debug(listModules.name);
2929
const networkId = chainNetwork[network].network;
30-
const { local } = getClient(getKadenaConstantByNetwork(network).apiHost({
31-
networkId,
32-
chainId,
33-
}));
30+
const { local } = getClient(
31+
getKadenaConstantByNetwork(network).apiHost({
32+
networkId,
33+
chainId,
34+
}),
35+
);
3436

3537
const transaction = Pact.builder
3638
.execution(Pact.modules['list-modules']())

‎packages/apps/transfer/src/services/transfer-tracker/get-transfer-status.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ChainwebNetworkId,
44
} from '@kadena/chainweb-node-client';
55
import { getContCommand, pollSpvProof } from '@kadena/client';
6+
67
import { getTransferData } from '../cross-chain-transfer-finish/get-transfer-data';
78

89
import {

0 commit comments

Comments
 (0)