Skip to content

Commit e29196b

Browse files
committed
update backend-to-backend example to use treasure topaz
1 parent d2527db commit e29196b

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

examples/backend-to-backend/backend-wallet.ts

+8-11
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import {
22
TDKAPI,
33
createTreasureConnectClient,
44
generateBackendWalletSignature,
5-
getContractAddress,
5+
treasureTopaz,
66
} from "@treasure-dev/tdk-core";
77
import "dotenv/config";
88

99
const client = createTreasureConnectClient({
1010
clientId: process.env.TDK_CLIENT_ID ?? "",
1111
});
12-
const chainId = 421614;
12+
const chainId = treasureTopaz.id;
1313

1414
(async () => {
1515
const { backendWallet, signature, expirationTime } =
@@ -27,32 +27,29 @@ const chainId = 421614;
2727

2828
const transaction = await tdk.transaction.create(
2929
{
30-
address: getContractAddress(chainId, "MAGIC"),
30+
address: "0x99B9ED17bB37768bb1a3Cb6d91B15834EB7c2185",
3131
abi: [
3232
{
3333
inputs: [
3434
{
3535
internalType: "address",
36-
name: "_to",
36+
name: "to",
3737
type: "address",
3838
},
3939
{
4040
internalType: "uint256",
41-
name: "_amount",
41+
name: "amount",
4242
type: "uint256",
4343
},
4444
],
45-
name: "mint",
45+
name: "mintTo",
4646
outputs: [],
4747
stateMutability: "nonpayable",
4848
type: "function",
4949
},
5050
] 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],
5653
},
5754
{
5855
includeAbi: true,

0 commit comments

Comments
 (0)