11import { bytesToHex , randomBytes } from "@noble/hashes/utils" ;
22import type { Hex } from "viem" ;
3- import { parseEventLogs } from "../event/actions/parse-logs.js" ;
4- import { createdEvent } from "../extensions/tokens/__generated__/ERC20Entrypoint/events/Created.js" ;
53import { createById } from "../extensions/tokens/__generated__/ERC20Entrypoint/write/createById.js" ;
6- import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js" ;
74import { padHex , toHex } from "../utils/encoding/hex.js" ;
85import { DEFAULT_DEVELOPER_ADDRESS } from "./constants.js" ;
96import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js" ;
@@ -15,9 +12,9 @@ import {
1512import type { CreateTokenOptions } from "./types.js" ;
1613
1714export async function createToken ( options : CreateTokenOptions ) {
18- const { client, account , params, launchConfig } = options ;
15+ const { client, params, launchConfig } = options ;
1916
20- const creator = params . owner || account . address ;
17+ const creator = params . owner ;
2118 const encodedInitData = await encodeInitParams ( {
2219 client,
2320 creator,
@@ -47,18 +44,5 @@ export async function createToken(options: CreateTokenOptions) {
4744 creator,
4845 } ) ;
4946
50- const receipt = await sendAndConfirmTransaction ( { account, transaction } ) ;
51- const assetEvent = createdEvent ( ) ;
52- const decodedEvent = parseEventLogs ( {
53- events : [ assetEvent ] ,
54- logs : receipt . logs ,
55- } ) ;
56-
57- if ( decodedEvent . length === 0 || ! decodedEvent [ 0 ] ) {
58- throw new Error (
59- `No AssetCreated event found in transaction: ${ receipt . transactionHash } ` ,
60- ) ;
61- }
62-
63- return decodedEvent [ 0 ] ?. args . asset ;
47+ return transaction ;
6448}
0 commit comments