Skip to content

Commit a44cbea

Browse files
committed
chore: prettier
1 parent e2466bb commit a44cbea

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

packages/ethers/src/__tests__/index-test.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ describe("TurnkeySigner", () => {
3434

3535
const apiPublicKey = assertNonEmptyString(
3636
process.env.API_PUBLIC_KEY,
37-
`process.env.API_PUBLIC_KEY`
37+
`process.env.API_PUBLIC_KEY`,
3838
);
3939
const apiPrivateKey = assertNonEmptyString(
4040
process.env.API_PRIVATE_KEY,
41-
`process.env.API_PRIVATE_KEY`
41+
`process.env.API_PRIVATE_KEY`,
4242
);
4343
const baseUrl = assertNonEmptyString(
4444
process.env.BASE_URL,
45-
`process.env.BASE_URL`
45+
`process.env.BASE_URL`,
4646
);
4747
const organizationId = assertNonEmptyString(
4848
process.env.ORGANIZATION_ID,
49-
`process.env.ORGANIZATION_ID`
49+
`process.env.ORGANIZATION_ID`,
5050
);
5151
const privateKeyId = assertNonEmptyString(
5252
process.env.PRIVATE_KEY_ID,
53-
`process.env.PRIVATE_KEY_ID`
53+
`process.env.PRIVATE_KEY_ID`,
5454
);
5555
const expectedPrivateKeyEthAddress = assertNonEmptyString(
5656
process.env.EXPECTED_PRIVATE_KEY_ETH_ADDRESS,
57-
`process.env.EXPECTED_PRIVATE_KEY_ETH_ADDRESS`
57+
`process.env.EXPECTED_PRIVATE_KEY_ETH_ADDRESS`,
5858
);
5959
const expectedWalletAccountEthAddress = assertNonEmptyString(
6060
process.env.EXPECTED_WALLET_ACCOUNT_ETH_ADDRESS,
61-
`process.env.EXPECTED_WALLET_ACCOUNT_ETH_ADDRESS`
61+
`process.env.EXPECTED_WALLET_ACCOUNT_ETH_ADDRESS`,
6262
);
6363
const bannedToAddress = assertNonEmptyString(
6464
process.env.BANNED_TO_ADDRESS,
65-
`process.env.BANNED_TO_ADDRESS`
65+
`process.env.BANNED_TO_ADDRESS`,
6666
);
6767

6868
[
@@ -95,7 +95,7 @@ describe("TurnkeySigner", () => {
9595
new ApiKeyStamper({
9696
apiPublicKey,
9797
apiPrivateKey,
98-
})
98+
}),
9999
);
100100

101101
connectedSigner = new TurnkeySigner({
@@ -110,7 +110,7 @@ describe("TurnkeySigner", () => {
110110
organizationId,
111111
signWith: signingConfig.signWith,
112112
},
113-
provider
113+
provider,
114114
);
115115

116116
chainId = (await connectedSigner.provider!.getNetwork()).chainId;
@@ -123,14 +123,14 @@ describe("TurnkeySigner", () => {
123123
testCase("basics for connected signer", async () => {
124124
expect(connectedSigner.signMessage).toBeTruthy();
125125
expect(await connectedSigner.getAddress()).toBe(
126-
signingConfig.expectedEthAddress
126+
signingConfig.expectedEthAddress,
127127
);
128128
});
129129

130130
testCase("basics for connected signer via constructor", async () => {
131131
expect(connectedSigner.signMessage).toBeTruthy();
132132
expect(await signerWithProvider.getAddress()).toBe(
133-
signingConfig.expectedEthAddress
133+
signingConfig.expectedEthAddress,
134134
);
135135
});
136136

@@ -182,7 +182,7 @@ describe("TurnkeySigner", () => {
182182
expect("this-should-never-be").toBe("reached");
183183
} catch (error) {
184184
expect((error as any as Error).message).toBe(
185-
`Transaction \`tx.from\` address mismatch. Self address: ${signingConfig.expectedEthAddress}; \`tx.from\` address: ${badFromAddress}`
185+
`Transaction \`tx.from\` address mismatch. Self address: ${signingConfig.expectedEthAddress}; \`tx.from\` address: ${badFromAddress}`,
186186
);
187187
}
188188
});
@@ -239,7 +239,7 @@ describe("TurnkeySigner", () => {
239239
}
240240
`);
241241
}
242-
}
242+
},
243243
);
244244

245245
testCase("it signs messages, `eth_sign` style", async () => {
@@ -249,7 +249,7 @@ describe("TurnkeySigner", () => {
249249

250250
expect(signMessageSignature).toMatch(/^0x/);
251251
expect(verifyMessage(message, signMessageSignature)).toEqual(
252-
signingConfig.expectedEthAddress
252+
signingConfig.expectedEthAddress,
253253
);
254254
});
255255

@@ -277,7 +277,7 @@ describe("TurnkeySigner", () => {
277277
const signTypedDataSignature = await connectedSigner.signTypedData(
278278
typedData.domain,
279279
typedData.types,
280-
typedData.message
280+
typedData.message,
281281
);
282282

283283
expect(signTypedDataSignature).toMatch(/^0x/);
@@ -286,8 +286,8 @@ describe("TurnkeySigner", () => {
286286
typedData.domain,
287287
typedData.types,
288288
typedData.message,
289-
signTypedDataSignature
290-
)
289+
signTypedDataSignature,
290+
),
291291
).toEqual(signingConfig.expectedEthAddress);
292292
});
293293

@@ -330,12 +330,12 @@ describe("TurnkeySigner", () => {
330330

331331
expect(deploymentAddress).toMatch(/^0x/);
332332
expect(deploymentTransaction?.from).toEqual(
333-
signingConfig.expectedEthAddress
333+
signingConfig.expectedEthAddress,
334334
);
335335

336336
// Mint
337337
const mintTx = await contract.safeMint(
338-
signingConfig.expectedEthAddress
338+
signingConfig.expectedEthAddress,
339339
);
340340

341341
expect(mintTx.hash).toMatch(/^0x/);
@@ -345,7 +345,7 @@ describe("TurnkeySigner", () => {
345345
// Approve
346346
const approveTx = await contract.approve(
347347
"0x2Ad9eA1E677949a536A270CEC812D6e868C88108",
348-
0 // `tokenId` is `0` because we've only minted once
348+
0, // `tokenId` is `0` because we've only minted once
349349
);
350350
await approveTx.wait();
351351

@@ -490,7 +490,7 @@ describe("TurnkeySigner", () => {
490490

491491
// Get serialized signature
492492
const signatureToVerify = ethers.Signature.from(
493-
signatureAuthorization.signature
493+
signatureAuthorization.signature,
494494
).serialized;
495495
expect(signatureToVerify).toMatch(/^0x/);
496496

@@ -517,14 +517,14 @@ describe("TurnkeySigner", () => {
517517
domain,
518518
types,
519519
message,
520-
signatureToVerify
520+
signatureToVerify,
521521
);
522522

523523
expect(recoveredAddress).toEqual(signingConfig.expectedEthAddress);
524524

525525
// Verify the authorization object
526526
expect(signatureAuthorization.address).toEqual(
527-
signingConfig.expectedEthAddress
527+
signingConfig.expectedEthAddress,
528528
);
529529
expect(signatureAuthorization.chainId).toEqual(chainId);
530530
expect(signatureAuthorization.nonce).toEqual(BigInt(0));
@@ -545,8 +545,8 @@ describe("TurnkeySigner", () => {
545545
if (typeof value === "bigint") return value.toString();
546546
return value;
547547
},
548-
2
549-
)
548+
2,
549+
),
550550
);
551551
throw error;
552552
}

packages/ethers/src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
9393
organizationId: this.organizationId,
9494
signWith: this.signWith,
9595
},
96-
provider
96+
provider,
9797
);
9898
}
9999

@@ -118,7 +118,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
118118
});
119119

120120
ethereumAddress = data.privateKey.addresses.find(
121-
(item: any) => item.format === "ADDRESS_FORMAT_ETHEREUM"
121+
(item: any) => item.format === "ADDRESS_FORMAT_ETHEREUM",
122122
)?.address;
123123

124124
if (typeof ethereumAddress !== "string" || !ethereumAddress) {
@@ -132,7 +132,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
132132
}
133133

134134
private async _signTransactionImpl(
135-
unsignedTransaction: string
135+
unsignedTransaction: string,
136136
): Promise<string> {
137137
if (isHttpClient(this.client)) {
138138
const { activity } = await this.client.signTransaction({
@@ -149,15 +149,15 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
149149
assertActivityCompleted(activity);
150150

151151
return assertNonNull(
152-
activity?.result?.signTransactionResult?.signedTransaction
152+
activity?.result?.signTransactionResult?.signedTransaction,
153153
);
154154
} else {
155155
const { activity, signedTransaction } = await this.client.signTransaction(
156156
{
157157
signWith: this.signWith,
158158
type: "TRANSACTION_TYPE_ETHEREUM",
159159
unsignedTransaction,
160-
}
160+
},
161161
);
162162

163163
assertActivityCompleted(activity);
@@ -167,7 +167,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
167167
}
168168

169169
private async _signTransactionWithErrorWrapping(
170-
message: string
170+
message: string,
171171
): Promise<string> {
172172
let signedTx: string;
173173
try {
@@ -209,7 +209,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
209209
const selfAddress = await this.getAddress();
210210
if (getAddress(from) !== selfAddress) {
211211
throw new Error(
212-
`Transaction \`tx.from\` address mismatch. Self address: ${selfAddress}; \`tx.from\` address: ${from}`
212+
`Transaction \`tx.from\` address mismatch. Self address: ${selfAddress}; \`tx.from\` address: ${from}`,
213213
);
214214
}
215215
}
@@ -298,7 +298,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
298298
async signTypedData(
299299
domain: TypedDataDomain,
300300
types: Record<string, Array<TypedDataField>>,
301-
value: Record<string, any>
301+
value: Record<string, any>,
302302
): Promise<string> {
303303
const populated = await TypedDataEncoder.resolveNames(
304304
domain,
@@ -311,18 +311,18 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
311311
assertNonNull(address);
312312

313313
return address ?? "";
314-
}
314+
},
315315
);
316316

317317
return this._signMessageWithErrorWrapping(
318-
TypedDataEncoder.hash(populated.domain, types, populated.value)
318+
TypedDataEncoder.hash(populated.domain, types, populated.value),
319319
);
320320
}
321321

322322
_signTypedData = this.signTypedData.bind(this);
323323

324324
async signAuthorization(
325-
parameters: TSignAuthorizationParameters
325+
parameters: TSignAuthorizationParameters,
326326
): Promise<SignAuthorizationReturnType> {
327327
try {
328328
const { address, chainId, nonce, code = "0x" } = parameters;
@@ -411,7 +411,7 @@ export class TurnkeySigner extends AbstractSigner implements ethers.Signer {
411411
domain,
412412
types,
413413
message,
414-
signatureString
414+
signatureString,
415415
);
416416
const expectedAddress = await this.getAddress();
417417

0 commit comments

Comments
 (0)