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" ;
1
2
import { distributeAsset } from "../extensions/assets/__generated__/AssetEntrypointERC20/write/distributeAsset.js" ;
2
- import { sendTransaction } from "../transaction/actions/send-transaction.js" ;
3
3
import type { ClientAndChainAndAccount } from "../utils/types.js" ;
4
4
import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js" ;
5
5
import type { DistributeContent } from "./types.js" ;
@@ -16,14 +16,11 @@ export async function distributeToken(options: DistrbuteTokenParams) {
16
16
throw new Error ( `Entrypoint not found on chain: ${ options . chain . id } ` ) ;
17
17
}
18
18
19
- const transaction = distributeAsset ( {
19
+ return distributeAsset ( {
20
20
contract : entrypoint ,
21
21
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
+ } ) ,
28
25
} ) ;
29
26
}
You can’t perform that action at this time.
0 commit comments