Skip to content

Commit c8fa7df

Browse files
committed
custom decimals for SPL tokens
1 parent 4ec780d commit c8fa7df

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/localnet/src/tokens/createSolanaToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { LAMPORTS_PER_SOL, PublicKey, SystemProgram } from "@solana/web3.js";
88

99
import { ed25519KeyPairTSS as tssKeypair } from "../solanaSetup";
1010

11-
export const createSolanaToken = async (env: any) => {
11+
export const createSolanaToken = async (env: any, decimals: number) => {
1212
const mint = await createMint(
1313
env.gatewayProgram.provider.connection,
1414
tssKeypair,
1515
tssKeypair.publicKey,
1616
null,
17-
9
17+
decimals
1818
);
1919

2020
const GATEWAY_PROGRAM_ID = env.gatewayProgram.programId;

packages/localnet/src/tokens/createToken.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export const createToken = async (
6969
} else {
7070
if (chainID === NetworkID.Solana) {
7171
const [assetAddr, gateway, user] = await createSolanaToken(
72-
contracts.solanaContracts.env
72+
contracts.solanaContracts.env,
73+
decimals
7374
);
7475
asset = assetAddr;
7576
contracts.solanaContracts.addresses.push(

0 commit comments

Comments
 (0)