Retrieve non-fungible tokens
How to retrieve non-fungible tokens for a wallet.
To fetch the non-fungible tokens for a certain wallet, you need to call the function getNonfungibles , to get all non-fungibles in all the wallets that a user has connected to your application use getAllNonfungibles.

By wallet ID

Function

1
venlyConnect.api.getNonfungibles(walletId: string);
Copied!

Example

1
const venlyConnect = new VenlyConnect('YOUR_CLIENT_ID');
2
venlyConnect.api.getNonfungibles("c8ec9954-fa1a-4682-9cf8-ef5c1015d1d1").then((items) => {
3
console.log("Your items: ", items);
4
})
Copied!

Returns

1
[
2
{
3
id: "2",
4
tokenId: "2",
5
description: "Spells of Genesis card",
6
imagePreviewUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
7
imageThumbnailUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
8
imageUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
9
name: "Reckless Footsoldier",
10
url: "https://www.spellsofgenesis.com/2",
11
animationUrl: null,
12
attributes: [
13
{
14
displayType: null,
15
maxValue: null,
16
traitCount: null,
17
traitType: "Name",
18
value: "Reckless Footsoldier"
19
},
20
{
21
displayType: null,
22
maxValue: null,
23
traitCount: null,
24
traitType: "Rarity",
25
value: "Not Assigned"
26
},
27
{
28
displayType: null,
29
maxValue: null,
30
traitCount: null,
31
traitType: "Attack",
32
value: "4"
33
},
34
{
35
displayType: null,
36
maxValue: null,
37
traitCount: null,
38
traitType: "Health",
39
value: "8"
40
},
41
{
42
displayType: null,
43
maxValue: null,
44
traitCount: null,
45
traitType: "Speed",
46
value: "3"
47
}
48
],
49
backgroundColor: null,
50
contract: {
51
address: "0x030bf504a4abeb05b91196536565c7acee9d9f02",
52
description: null,
53
imageUrl: null,
54
media: null,
55
name: "Spells of Genesis Askian Card",
56
symbol: "SOG",
57
type: "ERC_721",
58
url: null
59
}
60
}
61
]
Copied!

By wallet Address

Function

1
venlyConnect.api.getNonfungiblesByAddress(secretType: SecretType, walletAddress: string);
Copied!

Example

1
const venlyConnect = new VenlyConnect('YOUR_CLIENT_ID');
2
venlyConnect.api.getNonfungiblesByAddress("MATIC","0x10BCdb57aEbE5b195B750CCd4F506783aF0B52Cf").then((items) => {
3
console.log("Your items: ", items);
4
})
Copied!

All

Call that returns all non-fungibles for the user for all wallets that are connected to your application. Optional filter to filter based on secret type.

Function

1
venlyConnect.api.getAllNonfungibles(secretTypes?: SecretType[]);
Copied!

Example

1
const venlyConnect = new VenlyConnect('YOUR_CLIENT_ID');
2
venlyConnect.api.getAllNonfungibles().then((items) => {
3
console.log("Your items: ", items);
4
})
Copied!

Returns

1
[{
2
items: [{
3
animationUrl: null,
4
attributes: [{
5
displayType: null,
6
maxValue: null,
7
traitCount: null,
8
traitType: "Name",
9
value: "Reckless Footsoldier"
10
}, {
11
displayType: null,
12
maxValue: null,
13
traitCount: null,
14
traitType: "Rarity",
15
value: "Not Assigned"
16
}, {
17
displayType: null,
18
maxValue: null,
19
traitCount: null,
20
traitType: "Attack",
21
value: "4"
22
}, {
23
displayType: null,
24
maxValue: null,
25
traitCount: null,
26
traitType: "Health",
27
value: "8"
28
}, {
29
displayType: null,
30
maxValue: null,
31
traitCount: null,
32
traitType: "Speed",
33
value: "3"
34
}],
35
backgroundColor: null,
36
contract: {
37
address: "0x030bf504a4abeb05b91196536565c7acee9d9f02",
38
description: null,
39
imageUrl: null,
40
media: null,
41
name: "Spells of Genesis Askian Card",
42
symbol: "SOG",
43
type: "ERC_721",
44
url: null
45
},
46
description: "Spells of Genesis card",
47
id: "2",
48
imagePreviewUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
49
imageThumbnailUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
50
imageUrl: "http://metadata.spellsofgenesis.com/asset/image/320/FOOTSOLDIER.png",
51
name: "Reckless Footsoldier",
52
tokenId: "2",
53
url: "https://www.spellsofgenesis.com/2"
54
}, {
55
animationUrl: null,
56
attributes: [],
57
backgroundColor: null,
58
contract: {
59
address: "0x038d63df99a46b82796b2ea5d9cabc50340fd69f",
60
description: null,
61
imageUrl: null,
62
media: null,
63
name: "PUNK ARK GALLERY",
64
symbol: "PARKG",
65
type: "ERC_721",
66
url: null
67
},
68
description: "test",
69
id: "150865",
70
imagePreviewUrl: "http://cryptopunk-dev.ark.gallery:8080/ipfs/QmZfzbs97QVtiFmV77QsR3dE2JjGqsXK2DGvCdkSMNJ6fG",
71
imageThumbnailUrl: "http://cryptopunk-dev.ark.gallery:8080/ipfs/QmZfzbs97QVtiFmV77QsR3dE2JjGqsXK2DGvCdkSMNJ6fG",
72
imageUrl: "http://cryptopunk-dev.ark.gallery:8080/ipfs/QmZfzbs97QVtiFmV77QsR3dE2JjGqsXK2DGvCdkSMNJ6fG",
73
name: "test gif big file",
74
tokenId: "150865",
75
url: null
76
}],
77
secretType: "ETHEREUM",
78
walletAddress: "0x0288E3dDBe9e4f2B0536665f55464187601b41c4",
79
walletId: "eeb52670-4fb7-4e79-830d-4f5f613f315b",
80
walletType: "THREEWAY_SHARED"
81
}]
Copied!

Function Reference

The function reference describes the different functions that are available in the Widget. For each function, you can find the signature, it's parameters, and possible options documented.
​
Last modified 7d ago