• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-core-sdk / 10524884658

23 Aug 2024 11:24AM UTC coverage: 77.534% (+0.3%) from 77.282%
10524884658

push

github

web-flow
Passkey support (#808)

* Add passkey support

* Add support for passkeys to 4337

* verificationGasLimit adjustment

* feat(relay-kit): add dummy signature as a passkey signature (#857)

* feat(relay-kit): Tests for using passkey with 4337 (#846)

261 of 410 branches covered (63.66%)

Branch coverage included in aggregate %.

55 of 59 new or added lines in 3 files covered. (93.22%)

5 existing lines in 1 file now uncovered.

978 of 1188 relevant lines covered (82.32%)

3.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.76
/packages/sdk-starter-kit/src/utils/index.ts
1
import { validateEthereumAddress } from '@safe-global/protocol-kit'
6✔
2
import { TransactionResult } from '@safe-global/safe-core-sdk-types'
3
import { ContractTransactionReceipt, TransactionResponse } from 'ethers'
4

5
import { MESSAGES, SafeClientTxStatus } from '@safe-global/sdk-starter-kit/constants'
6✔
6
import { SafeClientResult, SafeConfig } from '@safe-global/sdk-starter-kit/types'
7

8
export const isValidAddress = (address: string): boolean => {
6✔
9
  try {
×
10
    validateEthereumAddress(address)
×
11
    return true
×
12
  } catch {
13
    return false
×
14
  }
15
}
16

17
export const isValidSafeConfig = (config: SafeConfig): boolean => {
6✔
18
  if (!config.owners || !config.threshold) return false
×
19

20
  return true
×
21
}
22

23
export const waitSafeTxReceipt = async (
6✔
24
  txResult: TransactionResult
25
): Promise<ContractTransactionReceipt | null | undefined> => {
26
  const receipt =
27
    txResult.transactionResponse &&
×
28
    (await (txResult.transactionResponse as TransactionResponse).wait())
29

30
  return receipt as ContractTransactionReceipt
×
31
}
32

33
export const createSafeClientResult = ({
6✔
34
  status,
35
  safeAddress,
36
  deploymentTxHash,
37
  safeTxHash,
38
  txHash,
39
  messageHash,
40
  userOperationHash,
41
  safeOperationHash
42
}: {
43
  status: SafeClientTxStatus
44
  safeAddress: string
45
  deploymentTxHash?: string
46
  safeTxHash?: string
47
  txHash?: string
48
  messageHash?: string
49
  userOperationHash?: string
50
  safeOperationHash?: string
51
}): SafeClientResult => {
52
  return {
15✔
53
    safeAddress,
54
    description: MESSAGES[status],
55
    status,
56
    transactions: txHash || safeTxHash ? { ethereumTxHash: txHash, safeTxHash } : undefined,
42✔
57
    messages: messageHash ? { messageHash } : undefined,
15✔
58
    safeOperations:
59
      userOperationHash || safeOperationHash ? { userOperationHash, safeOperationHash } : undefined,
43✔
60
    safeAccountDeployment: deploymentTxHash ? { ethereumTxHash: deploymentTxHash } : undefined
15✔
61
  }
62
}
63

64
export * from './sendTransaction'
6✔
65
export * from './proposeTransaction'
6✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc