File tree 1 file changed +8
-11
lines changed
examples/backend-to-backend
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import {
2
2
TDKAPI ,
3
3
createTreasureConnectClient ,
4
4
generateBackendWalletSignature ,
5
- getContractAddress ,
5
+ treasureTopaz ,
6
6
} from "@treasure-dev/tdk-core" ;
7
7
import "dotenv/config" ;
8
8
9
9
const client = createTreasureConnectClient ( {
10
10
clientId : process . env . TDK_CLIENT_ID ?? "" ,
11
11
} ) ;
12
- const chainId = 421614 ;
12
+ const chainId = treasureTopaz . id ;
13
13
14
14
( async ( ) => {
15
15
const { backendWallet, signature, expirationTime } =
@@ -27,32 +27,29 @@ const chainId = 421614;
27
27
28
28
const transaction = await tdk . transaction . create (
29
29
{
30
- address : getContractAddress ( chainId , "MAGIC" ) ,
30
+ address : "0x99B9ED17bB37768bb1a3Cb6d91B15834EB7c2185" ,
31
31
abi : [
32
32
{
33
33
inputs : [
34
34
{
35
35
internalType : "address" ,
36
- name : "_to " ,
36
+ name : "to " ,
37
37
type : "address" ,
38
38
} ,
39
39
{
40
40
internalType : "uint256" ,
41
- name : "_amount " ,
41
+ name : "amount " ,
42
42
type : "uint256" ,
43
43
} ,
44
44
] ,
45
- name : "mint " ,
45
+ name : "mintTo " ,
46
46
outputs : [ ] ,
47
47
stateMutability : "nonpayable" ,
48
48
type : "function" ,
49
49
} ,
50
50
] as const ,
51
- functionName : "mint" ,
52
- args : [
53
- backendWallet as `0x${string } `,
54
- 1000000000000000000000n , // 1,000
55
- ] ,
51
+ functionName : "mintTo" ,
52
+ args : [ backendWallet as `0x${string } `, 1000000000000000000n ] ,
56
53
} ,
57
54
{
58
55
includeAbi : true ,
You can’t perform that action at this time.
0 commit comments