Skip to content

Commit 2c8b80e

Browse files
committed
Fix build
1 parent 6752878 commit 2c8b80e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/thirdweb/src/assets/create-token.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,14 @@ export async function createToken(options: CreateTokenOptions) {
3838

3939
let salt: Hex = "0x";
4040
if (!options.salt) {
41-
salt =
42-
"0x1f" +
43-
toHex(blockNumber, {
44-
size: 32,
45-
}).substring(4);
41+
salt = `0x1f${toHex(blockNumber, {
42+
size: 32,
43+
}).substring(4)}`;
4644
} else {
4745
if (options.salt.startsWith("0x") && options.salt.length === 66) {
48-
salt = options.salt as `0x${string}`;
46+
salt = options.salt;
4947
} else {
50-
salt = "0x1f" + keccakId(options.salt).substring(4);
48+
salt = `0x1f${keccakId(options.salt).substring(4)}`;
5149
}
5250
}
5351

packages/thirdweb/src/assets/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Hex } from "viem";
12
import type { FileOrBufferOrString } from "../storage/upload/types.js";
23
import type { ClientAndChainAndAccount } from "../utils/types.js";
34

@@ -45,7 +46,7 @@ type LaunchConfig =
4546
| { kind: "distribute"; config: DistributeConfig };
4647

4748
export type CreateTokenOptions = ClientAndChainAndAccount & {
48-
salt?: string;
49+
salt?: Hex;
4950
params: TokenParams;
5051
launchConfig?: LaunchConfig;
5152
referrerAddress?: string;

0 commit comments

Comments
 (0)