-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathmint_cnft.rs
47 lines (42 loc) · 1.89 KB
/
mint_cnft.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use helius::error::Result;
use helius::types::*;
use helius::Helius;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<()> {
let api_key: &str = "your_api_key";
let cluster: Cluster = Cluster::MainnetBeta;
let helius: Helius = Helius::new(api_key, cluster).unwrap();
let request: MintCompressedNftRequest = MintCompressedNftRequest {
name: "Exodia the Forbidden One".to_string(),
symbol: "ETFO".to_string(),
owner: "DCQnfUH6mHA333mzkU22b4hMvyqcejUBociodq8bB5HF".to_string(),
description: "Exodia the Forbidden One is a powerful, legendary creature composed of five parts: the Right Leg, Left Leg, Right Arm, Left Arm, and the Head. When all five parts are assembled, Exodia becomes an unstoppable force".to_string(),
attributes: vec![Attribute {
trait_type: "Type".to_string(),
value: Value::String("Legendary".to_string()),
}, Attribute {
trait_type: "Power".to_string(),
value: Value::String("Infinite".to_string()),
}, Attribute {
trait_type: "Element".to_string(),
value: Value::String("Dark".to_string()),
}, Attribute {
trait_type: "Rarity".to_string(),
value: Value::String("Mythical".to_string()),
},
],
image_url: Some("https://cdna.artstation.com/p/assets/images/images/052/118/830/large/julie-almoneda-03.jpg?1658992401".to_string()),
external_url: Some("https://www.yugioh-card.com/en/".to_string()),
seller_fee_basis_points: Some(6900),
delegate: None,
collection: None,
uri: None,
creators: None,
confirm_transaction: Some(true),
};
#[allow(deprecated)]
let response: Result<MintResponse> = helius.mint_compressed_nft(request).await;
println!("Assets: {:?}", response);
Ok(())
}