Skip to content

Commit 29ea21a

Browse files
authored
ran turbo linter (#630)
* ran turbo linter * fmt code review
1 parent 798f967 commit 29ea21a

File tree

37 files changed

+51
-46
lines changed

37 files changed

+51
-46
lines changed

connect/src/protocols/tokenBridge/tokenTransfer.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,10 @@ export namespace TokenTransfer {
507507
return lookup as TokenId<DC>;
508508
}
509509

510-
if (srcChain.chain === 'Aptos') {
511-
lookup.address = new UniversalAddress(encoding.hex.encode(sha3_256(lookup.address.toString()), true));
510+
if (srcChain.chain === "Aptos") {
511+
lookup.address = new UniversalAddress(
512+
encoding.hex.encode(sha3_256(lookup.address.toString()), true),
513+
);
512514
}
513515

514516
// otherwise, figure out what the token address representing the wormhole-wrapped token we're transferring
@@ -702,7 +704,10 @@ export namespace TokenTransfer {
702704

703705
// when native gas is requested on solana, the amount must be at least the rent-exempt amount
704706
// or the transaction could fail if the account does not have enough lamports
705-
if (dstChain.chain === "Solana" && _destinationNativeGas < solanaMinBalanceForRentExemptAccount) {
707+
if (
708+
dstChain.chain === "Solana" &&
709+
_destinationNativeGas < solanaMinBalanceForRentExemptAccount
710+
) {
706711
throw new Error(
707712
`Native gas amount must be at least ${solanaMinBalanceForRentExemptAccount} lamports`,
708713
);

connect/src/routes/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
ValidatedTransferParams,
1212
ValidationResult,
1313
} from "./types.js";
14-
import { ChainAddress } from "@wormhole-foundation/sdk-definitions";
14+
import type { ChainAddress } from "@wormhole-foundation/sdk-definitions";
1515

1616
export abstract class Route<
1717
N extends Network,

connect/src/wormhole.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import {
2222
toNative,
2323
} from "@wormhole-foundation/sdk-definitions";
2424
import { getCircleAttestationWithRetry } from "./circle-api.js";
25-
import { WormholeConfig, applyWormholeConfigOverrides, WormholeConfigOverrides } from "./config.js";
25+
import type { WormholeConfig, WormholeConfigOverrides } from "./config.js";
26+
import { applyWormholeConfigOverrides } from "./config.js";
2627
import { DEFAULT_TASK_TIMEOUT } from "./config.js";
2728
import { CircleTransfer } from "./protocols/cctp/cctpTransfer.js";
2829
import { TokenTransfer } from "./protocols/tokenBridge/tokenTransfer.js";

core/definitions/src/chain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { getTokenByAddress } from "@wormhole-foundation/sdk-base/tokens";
1010
import type { ChainAddress, UniversalOrNative } from "./address.js";
1111
import { toNative } from "./address.js";
1212
import type { WormholeMessageId } from "./attestation.js";
13-
import {
13+
import type {
1414
AutomaticCircleBridge,
1515
CircleBridge,
1616
Contracts,

core/definitions/src/layout-items/boolean.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CustomConversion, UintLayoutItem } from "@wormhole-foundation/sdk-base";
1+
import type { CustomConversion, UintLayoutItem } from "@wormhole-foundation/sdk-base";
22

33
export const boolItem = {
44
binary: "uint",

core/definitions/src/protocol.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, Network, Platform, PlatformToChains } from "@wormhole-foundation/sdk-base";
22
import { chainToPlatform, isChain } from "@wormhole-foundation/sdk-base";
3-
import { Contracts } from "./contracts.js";
3+
import type { Contracts } from "./contracts.js";
44
import type { WormholeRegistry } from "./registry.js";
55
import type { RpcConnection } from "./rpc.js";
66
import type { ChainsConfig } from "./types.js";

core/definitions/src/protocols/circleBridge/circleBridge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { UnsignedTransaction } from "../../unsignedTransaction.js";
1313
import "./automaticCircleBridgeLayout.js";
1414
import { circleMessageLayout } from "./circleBridgeLayout.js";
1515

16-
import { EmptyPlatformMap } from "../../protocol.js";
16+
import type { EmptyPlatformMap } from "../../protocol.js";
1717
import { keccak256 } from "../../utils.js";
1818
import type { ProtocolPayload, ProtocolVAA } from "./../../vaa/index.js";
1919
import { payloadDiscriminator } from "./../../vaa/index.js";

core/definitions/src/protocols/core/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { UnsignedTransaction } from "../../unsignedTransaction.js";
66
import type { VAA } from "./../../vaa/index.js";
77

88
import "../../registry.js";
9-
import { EmptyPlatformMap } from "../../protocol.js";
9+
import type { EmptyPlatformMap } from "../../protocol.js";
1010
declare module "../../registry.js" {
1111
export namespace WormholeRegistry {
1212
interface ProtocolToInterfaceMapping<N, C> {

core/definitions/src/protocols/governance/gateway.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
22

3-
import { EmptyPlatformMap } from "../../protocol.js";
3+
import type { EmptyPlatformMap } from "../../protocol.js";
44
import "../../registry.js";
55
declare module "../../registry.js" {
66
export namespace WormholeRegistry {

core/definitions/src/protocols/governance/generalPurpose.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
22

3-
import { EmptyPlatformMap } from "../../protocol.js";
3+
import type { EmptyPlatformMap } from "../../protocol.js";
44
import "../../registry.js";
55
declare module "../../registry.js" {
66
export namespace WormholeRegistry {

core/definitions/src/protocols/governance/ibcReceiver.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
22

3-
import { EmptyPlatformMap } from "../../protocol.js";
3+
import type { EmptyPlatformMap } from "../../protocol.js";
44
import "../../registry.js";
55
declare module "../../registry.js" {
66
export namespace WormholeRegistry {

core/definitions/src/protocols/governance/wormchainGovernance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
22

3-
import { EmptyPlatformMap } from "../../protocol.js";
3+
import type { EmptyPlatformMap } from "../../protocol.js";
44
import "../../registry.js";
55
declare module "../../registry.js" {
66
export namespace WormholeRegistry {

core/definitions/src/protocols/ibc/ibc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { TokenAddress, TokenId, TxHash } from "../../types.js";
66
import type { UnsignedTransaction } from "../../unsignedTransaction.js";
77

88
import "../../registry.js";
9-
import { EmptyPlatformMap } from "../../protocol.js";
9+
import type { EmptyPlatformMap } from "../../protocol.js";
1010
declare module "../../registry.js" {
1111
export namespace WormholeRegistry {
1212
interface ProtocolToInterfaceMapping<N, C> {

core/definitions/src/protocols/nftBridge/nftBridge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EmptyPlatformMap } from "../../protocol.js";
1+
import type { EmptyPlatformMap } from "../../protocol.js";
22
import "../../registry.js";
33
declare module "../../registry.js" {
44
export namespace WormholeRegistry {

core/definitions/src/protocols/portico/portico.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { TokenAddress, TokenId } from "../../types.js";
55
import type { UnsignedTransaction } from "../../unsignedTransaction.js";
66
import type { ProtocolVAA } from "./../../vaa/index.js";
77
import { porticoFlagSetLayout, porticoPayloadLayout } from "./porticoLayout.js";
8-
import { EmptyPlatformMap } from "../../protocol.js";
8+
import type { EmptyPlatformMap } from "../../protocol.js";
99

1010
import "../../registry.js";
1111
declare module "../../registry.js" {

core/definitions/src/protocols/relayer/relayer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Chain } from "@wormhole-foundation/sdk-base";
22
import type { TokenAddress } from "../../types.js";
33

4-
import { EmptyPlatformMap } from "../../protocol.js";
4+
import type { EmptyPlatformMap } from "../../protocol.js";
55
import "../../registry.js";
66
declare module "../../registry.js" {
77
export namespace WormholeRegistry {

core/definitions/src/protocols/tokenBridge/tokenBridge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "./tokenBridgeLayout.js";
1010

1111
export const ErrNotWrapped = (token: string) => new Error(`Token ${token} is not a wrapped asset`);
1212

13-
import { EmptyPlatformMap } from "../../protocol.js";
13+
import type { EmptyPlatformMap } from "../../protocol.js";
1414
import "../../registry.js";
1515
declare module "../../registry.js" {
1616
export namespace WormholeRegistry {

core/definitions/src/registry.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Chain, Network } from "@wormhole-foundation/sdk-base";
1+
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
22

33
/**
44
* WormholeRegistry is a namespace to provide consumers and downstream packages

core/definitions/src/testing/mocks/guardian.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Chain, guardians } from "@wormhole-foundation/sdk-base";
1+
import type { Chain} from "@wormhole-foundation/sdk-base";
2+
import { guardians } from "@wormhole-foundation/sdk-base";
3+
import type { PayloadLiteral, VAA } from "../../index.js";
24
import {
3-
PayloadLiteral,
45
Signature,
56
SignatureUtils,
6-
VAA,
77
createVAA,
88
deserialize,
99
serialize,
1010
} from "../../index.js";
11-
import { UniversalAddress } from "../../universalAddress.js";
11+
import type { UniversalAddress } from "../../universalAddress.js";
1212
import { keccak256 } from "../../utils.js";
1313

1414
interface Guardian {

core/definitions/src/vaa/functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { DistributiveVAA, LayoutLiteralToPayload, Payload, VAA } from "./va
1313
import { baseLayout, decomposeLiteral, envelopeLayout, headerLayout } from "./vaa.js";
1414

1515
import { sequenceItem, universalAddressItem } from "../layout-items/index.js";
16-
import { ProtocolName } from "../protocol.js";
16+
import type { ProtocolName } from "../protocol.js";
1717
import { keccak256 } from "../utils.js";
1818

1919
export function getPayloadLayout<LL extends LayoutLiteral>(layoutLiteral: LL) {

core/definitions/src/vaa/registration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Layout } from "@wormhole-foundation/sdk-base";
22
import type { WormholeRegistry } from "../registry.js";
3-
import { ProtocolName } from "../protocol.js";
3+
import type { ProtocolName } from "../protocol.js";
44

55
// //LayoutLiteralToLayoutMapping is the compile-time analog/complement to the runtime
66
// // payload factory. It uses TypeScript's interface merging mechanic to "dynamically" extend known

core/definitions/src/vaa/vaa.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from "./../layout-items/index.js";
1010

1111
import type { LayoutLiteral, PayloadLiteral, LayoutOf, ComposeLiteral } from "./registration.js";
12-
import { ProtocolName } from "../protocol.js";
12+
import type { ProtocolName } from "../protocol.js";
1313

1414
export type LayoutLiteralToPayload<LL extends LayoutLiteral> = LayoutToType<LayoutOf<LL>>;
1515

core/icons/src/constants/chainIcons.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THIS FILE IS AUTO-GENERATED WITH `npm run gen`
22

3-
import { Chain } from "@wormhole-foundation/sdk-base";
3+
import type { Chain } from "@wormhole-foundation/sdk-base";
44

55
const PREFIX = "data:image/svg+xml;base64,";
66

platforms/algorand/src/signer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
Signer,
66
UnsignedTransaction,
77
} from "@wormhole-foundation/sdk-connect";
8-
import algosdk from "algosdk";
8+
import type algosdk from "algosdk";
99
import { assignGroupID, mnemonicToSecretKey } from "algosdk";
1010
import type { AlgorandChains, TransactionSignerPair } from "./types.js";
1111
import { AlgorandPlatform } from "./platform.js";

platforms/solana/protocols/core/src/postMessageLayout.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { Layout } from '@wormhole-foundation/sdk-connect';
1+
import type { Layout, LayoutToType } from '@wormhole-foundation/sdk-connect';
22
import {
3-
LayoutToType,
43
deserializeLayout,
54
layoutItems,
65
} from '@wormhole-foundation/sdk-connect';

platforms/solana/src/signer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import type {
44
Transaction,
55
TransactionInstruction,
66
VersionedTransaction,
7-
} from '@solana/web3.js';
7+
8+
PublicKey} from '@solana/web3.js';
89
import {
910
ComputeBudgetProgram,
1011
Keypair,
11-
PublicKey,
1212
SendTransactionError,
1313
TransactionExpiredBlockheightExceededError,
1414
TransactionMessage,

platforms/solana/src/utils/anchor/common.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Idl, IdlField, IdlTypeDef, IdlType } from './idl.js';
1+
import type { Idl, IdlField, IdlTypeDef, IdlType } from './idl.js';
22
import { IdlError } from './error.js';
33

44
export function accountSize(idl: Idl, idlAccount: IdlTypeDef) {

platforms/sui/src/address.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ declare module "@wormhole-foundation/sdk-connect" {
133133
}
134134
}
135135

136-
registerNative('Sui', SuiAddress);
136+
registerNative("Sui", SuiAddress);

sdk/src/algorand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/algorand/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const algorand = async (): Promise<PlatformDefinition<"Algorand">> =>
44
(await import("./platforms/algorand.js")).default;
55
export default algorand;

sdk/src/aptos.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/aptos/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const aptos = async (): Promise<PlatformDefinition<"Aptos">> =>
44
(await import("./platforms/aptos.js")).default;
55
export default aptos;

sdk/src/cosmwasm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/cosmwasm/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const cosmwasm = async (): Promise<PlatformDefinition<"Cosmwasm">> =>
44
(await import("./platforms/cosmwasm.js")).default;
55
export default cosmwasm;

sdk/src/evm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/evm/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const evm = async (): Promise<PlatformDefinition<"Evm">> =>
44
(await import("./platforms/evm.js")).default;
55
export default evm;

sdk/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import type {
44
Platform,
55
ProtocolName,
66
ChainConfigOverrides,
7-
} from "@wormhole-foundation/sdk-connect";
8-
import {
7+
98
ChainContext,
109
NativeAddressCtr,
1110
PlatformToChains,
1211
PlatformUtils,
1312
RpcConnection,
14-
Signer,
13+
Signer} from "@wormhole-foundation/sdk-connect";
14+
import {
1515
Wormhole,
1616
} from "@wormhole-foundation/sdk-connect";
1717

sdk/src/platforms/algorand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as _algorand from "@wormhole-foundation/sdk-algorand";
22
import { applyChainsConfigConfigOverrides } from "@wormhole-foundation/sdk-connect";
3-
import { PlatformDefinition } from "../index.js";
3+
import type { PlatformDefinition } from "../index.js";
44

55
/** Platform and protocol definitions for Algorand */
66
const algorand: PlatformDefinition<typeof _algorand._platform> = {

sdk/src/platforms/aptos.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _aptos from "@wormhole-foundation/sdk-aptos";
2-
import { PlatformDefinition } from "../index.js";
2+
import type { PlatformDefinition } from "../index.js";
33
import { applyChainsConfigConfigOverrides } from "@wormhole-foundation/sdk-connect";
44

55
/** Platform and protocol definitions for Aptos */

sdk/src/solana.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/solana/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const solana = async (): Promise<PlatformDefinition<"Solana">> =>
44
(await import("./platforms/solana.js")).default;
55
export default solana;

sdk/src/sui.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path="../../platforms/sui/src/index.ts" />
2-
import { PlatformDefinition } from "./index.js";
2+
import type { PlatformDefinition } from "./index.js";
33
const sui = async (): Promise<PlatformDefinition<"Sui">> =>
44
(await import("./platforms/sui.js")).default;
55
export default sui;

0 commit comments

Comments
 (0)