File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
packages/thirdweb/src/assets Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 1+ import { toUnits } from "src/utils/units.js" ;
12import { distributeAsset } from "../extensions/assets/__generated__/AssetEntrypointERC20/write/distributeAsset.js" ;
2- import { sendTransaction } from "../transaction/actions/send-transaction.js" ;
33import type { ClientAndChainAndAccount } from "../utils/types.js" ;
44import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js" ;
55import type { DistributeContent } from "./types.js" ;
@@ -16,14 +16,11 @@ export async function distributeToken(options: DistrbuteTokenParams) {
1616 throw new Error ( `Entrypoint not found on chain: ${ options . chain . id } ` ) ;
1717 }
1818
19- const transaction = distributeAsset ( {
19+ return distributeAsset ( {
2020 contract : entrypoint ,
2121 asset : options . tokenAddress ,
22- contents : options . contents ,
23- } ) ;
24-
25- return await sendTransaction ( {
26- transaction,
27- account : options . account ,
22+ contents : options . contents . map ( ( a ) => {
23+ return { ...a , amount : toUnits ( a . amount . toString ( ) , 18 ) } ;
24+ } ) ,
2825 } ) ;
2926}
You can’t perform that action at this time.
0 commit comments