This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
/
mintNftKMSCelo.php
94 lines (71 loc) · 3.19 KB
/
mintNftKMSCelo.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* Copyright (c) 2022-2023 tatum.io
*
* @link https://tatumio.github.io/tatum-php/Api/NFTERC721OrCompatibleApi/#mintnftkmscelo
* @license MIT
* @author Mark Jivko
*
* SECURITY WARNING
* Execute this file in CLI mode only!
*/
"cli" !== php_sapi_name() && exit();
// Use any PSR-4 autoloader
require_once dirname(__DIR__, 3) . "/autoload.php";
// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();
// 🐛 Enable debugging on the MainNet
$sdk->mainnet()->config()->setDebug(true);
$arg_mint_nft_kms_celo = (new \Tatum\Model\MintNftKMSCelo())
// The blockchain to work with
->setChain('CELO')
// The blockchain address to send the NFT to
->setTo('0x687422eEA2cB73B5d3e242bA5456b782919AFc85')
// The blockchain address of the smart contract to build the NFT on
->setContractAddress('0x687422eEA2cB73B5d3e242bA5456b782919AFc85')
// The ID of the NFT
->setTokenId('123')
// The URL pointing to the NFT metadata; for more information, see <a href="https://eips.ethereum.or...
->setUrl('https://my_token_data.com')
// The currency in which the transaction fee will be paid
->setFeeCurrency('null')
// The KMS identifier of the private key of the blockchain address that will pay the fee for the tra...
->setSignatureId('26d3883e-4e17-48b3-a0ee-09a3e484ac83')
// (optional) (Only if the signature ID is mnemonic-based) The index of the address to pay the transaction fee ...
->setIndex(null)
// (optional) The blockchain address of the custom fungible token
->setErc20('0x687422eEA2cB73B5d3e242bA5456b782919AFc85')
// (optional) Set to "true" if the NFT smart contract is of the provenance type; otherwise, set to "false".
->setProvenance(true)
// (optional) The blockchain addresses where the royalties will be sent every time the minted NFT is transferre...
->setAuthorAddresses(null)
// (optional) The amounts of the royalties that will be paid to the authors of the minted NFT every time the NF...
->setCashbackValues(null)
// (optional) The fixed amounts of the native blockchain currency to which the cashback royalty amounts will be...
->setFixedValues(null)
// (optional) The nonce to be set to the transaction; if not present, the last known nonce will be used
->setNonce(null);
// Type of Ethereum testnet. Defaults to Sepolia. Valid only for ETH invocations for testnet API Key. For mainnet API Key, this value is ignored.
$arg_x_testnet_type = 'ethereum-sepolia';
try {
/**
* POST /v3/nft/mint
*
* @var \Tatum\Model\MintNftExpress200Response $response
*/
$response = $sdk->mainnet()
->api()
->nFTERC721OrCompatible()
->mintNftKMSCelo($arg_mint_nft_kms_celo, $arg_x_testnet_type);
var_dump($response);
} catch (\Tatum\Sdk\ApiException $apiExc) {
echo sprintf(
"API Exception when calling api()->nFTERC721OrCompatible()->mintNftKMSCelo(): %s\n",
var_export($apiExc->getResponseObject(), true)
);
} catch (\Exception $exc) {
echo sprintf(
"Exception when calling api()->nFTERC721OrCompatible()->mintNftKMSCelo(): %s\n",
$exc->getMessage()
);
}