@@ -21,9 +21,13 @@ import { createNoopSigner } from 'gill';
2121 * @param symbol - The symbol of the arcade token.
2222 * @param decimals - The number of decimals for the arcade token.
2323 * @param uri - The URI pointing to the arcade token's metadata.
24- * @param authority - The address with authority over the mint.
24+ * @param mintAuthority - The address with authority over the mint.
2525 * @param mint - The address of the mint account to initialize.
2626 * @param feePayer - The address that will pay the transaction fees.
27+ * @param metadataAuthority - The address with authority over the metadata.
28+ * @param pausableAuthority - The address with authority over the pausable functionality.
29+ * @param confidentialBalancesAuthority - The address with authority over the confidential balances extension.
30+ * @param permanentDelegateAuthority - The address with authority over the permanent delegate.
2731 * @returns A promise that resolves to a FullTransaction object for initializing the arcade token mint.
2832 */
2933export const createArcadeTokenInitTransaction = async (
@@ -32,16 +36,20 @@ export const createArcadeTokenInitTransaction = async (
3236 symbol : string ,
3337 decimals : number ,
3438 uri : string ,
35- authority : Address ,
39+ mintAuthority : Address ,
3640 mint : Address ,
37- feePayer : Address
41+ feePayer : Address ,
42+ metadataAuthority ?: Address ,
43+ pausableAuthority ?: Address ,
44+ confidentialBalancesAuthority ?: Address ,
45+ permanentDelegateAuthority ?: Address
3846) : Promise <
3947 FullTransaction < TransactionVersion , TransactionMessageWithFeePayer >
4048> => {
4149 const tx = await new Token ( )
4250 . withMetadata ( {
4351 mintAddress : mint ,
44- authority : authority ,
52+ authority : metadataAuthority || mintAuthority ,
4553 metadata : {
4654 name,
4755 symbol,
@@ -50,14 +58,14 @@ export const createArcadeTokenInitTransaction = async (
5058 // TODO: add additional metadata
5159 additionalMetadata : new Map ( ) ,
5260 } )
53- . withPausable ( authority )
61+ . withPausable ( pausableAuthority || mintAuthority )
5462 . withDefaultAccountState ( true )
55- . withConfidentialBalances ( authority )
56- . withPermanentDelegate ( authority )
63+ . withConfidentialBalances ( confidentialBalancesAuthority || mintAuthority )
64+ . withPermanentDelegate ( permanentDelegateAuthority || mintAuthority )
5765 . buildTransaction ( {
5866 rpc,
5967 decimals,
60- authority,
68+ authority : mintAuthority ,
6169 mint : createNoopSigner ( mint ) ,
6270 feePayer : createNoopSigner ( feePayer ) ,
6371 } ) ;
0 commit comments