|
1 | 1 | use anchor_lang::{prelude::*, system_program};
|
| 2 | +use dyn_fmt::AsStrFormatExt; |
2 | 3 | use libreplex_shared::{create_token_2022_and_metadata, MintAccounts2022, TokenGroupInput};
|
3 | 4 | use spl_pod::optional_keys::OptionalNonZeroPubkey;
|
4 | 5 | use spl_token_metadata_interface::state::TokenMetadata;
|
@@ -99,6 +100,16 @@ pub fn initialise(ctx: Context<InitialiseCtx>, input: InitialiseInput) -> Result
|
99 | 100 | panic!("Only one set of curlies ({{}}) can be specified. name had multiple");
|
100 | 101 | }
|
101 | 102 | };
|
| 103 | + |
| 104 | + let name = match name_is_template { |
| 105 | + true => input.name.format(&["collection"]), |
| 106 | + false => input.name.clone() |
| 107 | + }; |
| 108 | + |
| 109 | + let url: String = match url_is_template { |
| 110 | + true => input.offchain_url.format(&["collection"]), |
| 111 | + false => input.offchain_url.clone() |
| 112 | + }; |
102 | 113 |
|
103 | 114 |
|
104 | 115 | ctx.accounts.editions_deployment.set_inner(EditionsDeployment {
|
@@ -148,9 +159,10 @@ pub fn initialise(ctx: Context<InitialiseCtx>, input: InitialiseInput) -> Result
|
148 | 159 | },
|
149 | 160 | 0,
|
150 | 161 | Some(TokenMetadata {
|
151 |
| - name: editions_deployment.name.clone(), |
| 162 | + name, |
152 | 163 | symbol: editions_deployment.symbol.clone(),
|
153 |
| - uri: editions_deployment.offchain_url.clone(), |
| 164 | + // please let's just call it url ok.... please |
| 165 | + uri: url, |
154 | 166 | update_authority,
|
155 | 167 | mint: group_mint.key(),
|
156 | 168 | additional_metadata: vec![],
|
|
0 commit comments