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

safe-global / safe-core-sdk / 11029255652

25 Sep 2024 08:18AM CUT coverage: 77.534%. Remained the same
11029255652

push

github

dasanra
chore: set release versions

261 of 410 branches covered (63.66%)

Branch coverage included in aggregate %.

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

14.29
/packages/sdk-starter-kit/src/utils/sendTransaction.ts
1
import Safe from '@safe-global/protocol-kit'
2
import { Transaction } from '@safe-global/safe-core-sdk-types'
3
import { AbstractSigner } from 'ethers'
4

5
/**
6
 * Sends a transaction using the signer (owner)
7
 * It's useful to deploy Safe accounts
8
 *
9
 * @param {Transaction} transaction  The transaction.
10
 * @param {Safe} protocolKit The protocolKit instance
11
 * @returns {Promise<string | undefined>} A promise that resolves with the transaction hash
12
 */
13
export const sendTransaction = async ({
6✔
14
  transaction,
15
  protocolKit
16
}: {
17
  transaction: Transaction
18
  protocolKit: Safe
19
}): Promise<string | undefined> => {
20
  const signer = (await protocolKit
×
21
    .getSafeProvider()
22
    .getExternalSigner()) as unknown as AbstractSigner
23
  const txResponsePromise = await signer.sendTransaction({
×
24
    from: (await protocolKit.getSafeProvider().getSignerAddress()) || '0x',
×
25
    ...transaction
26
  })
27

28
  const txResponse = await txResponsePromise.wait()
×
29

30
  return txResponse?.hash
×
31
}
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