Skip to content

Commit 8724f83

Browse files
connect, write tx
1 parent 58c3e34 commit 8724f83

File tree

7 files changed

+638
-37
lines changed

7 files changed

+638
-37
lines changed

Assets/Plugin/thirdweb.jslib

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ mergeInto(LibraryManager.library, {
1919
ThirdwebInitialize: function (chain) {
2020
window.bridge.initialize(UTF8ToString(chain));
2121
},
22+
ThirdwebConnect: function () {
23+
window.bridge.connect();
24+
},
2225
});

Assets/SDKTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ void Start()
1212
this.contract = sdk.GetContract("0x2e01763fA0e15e07294D74B63cE4b526B321E389");
1313
}
1414

15+
public void OnLoginCLick()
16+
{
17+
Debug.Log("Login clicked");
18+
sdk.Connect();
19+
}
20+
1521
public async void OnButtonClick()
1622
{
1723
Debug.Log("Button clicked");
@@ -20,4 +26,14 @@ public async void OnButtonClick()
2026
Debug.Log("name: " + result.metadata.name);
2127
Debug.Log("owner: " + result.owner);
2228
}
29+
30+
public async void OnWriteButtonClick()
31+
{
32+
Debug.Log("Claim button clicked");
33+
count++;
34+
//var result = await this.contract.ERC721.Transfer("0x2247d5d238d0f9d37184d8332aE0289d1aD9991b", count.ToString());
35+
var result = await this.contract.ERC721.Claim(1);
36+
Debug.Log("result id: " + result[0].id);
37+
Debug.Log("result receipt: " + result[0].receipt.transactionHash);
38+
}
2339
}

0 commit comments

Comments
 (0)