Skip to content

Commit 5ee9d3a

Browse files
authored
Merge pull request #2 from phantasma-io/dev
Update to the API Calls added missing.
2 parents 2d82d5f + aabf9e4 commit 5ee9d3a

File tree

6 files changed

+573
-284
lines changed

6 files changed

+573
-284
lines changed

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
[V.1.0.7]
2+
3+
- Added missing API Calls.
4+
- Added missing Types.
5+
16
[V.1.0.6]
2-
* Name changings to match the new package name.
7+
8+
- Name changings to match the new package name.
39

410
[V.1.0.5]
5-
* Added Wallet interactions to show how to implement the PhantasmaLinkClient.
11+
12+
- Added Wallet interactions to show how to implement the PhantasmaLinkClient.
613

714
[V.1.0.2]
8-
* Added Login script for easier implementation.
15+
16+
- Added Login script for easier implementation.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using LunarLabs.Parser;
2+
3+
namespace Phantasma.SDK
4+
{
5+
public struct Governance
6+
{
7+
public string name;
8+
public string value;
9+
10+
public static Governance FromNode(DataNode node)
11+
{
12+
Governance result;
13+
14+
result.name = node.GetString("name");
15+
result.value = node.GetString("value");
16+
17+
return result;
18+
}
19+
}
20+
}

Runtime/Phantasma/Scripts/Models/Governance.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
using LunarLabs.Parser;
2+
using Phantasma.Business.Blockchain.Contracts.Native;
3+
4+
namespace Phantasma.SDK
5+
{
6+
public struct Nexus
7+
{
8+
public string name; //
9+
public uint protocol; //
10+
public Platform[] platforms; //
11+
public Token[] tokens;
12+
public Chain[] chains; //
13+
public Governance[] governance; //
14+
public string[] organizations; //
15+
16+
public static Nexus FromNode(DataNode node)
17+
{
18+
Nexus result;
19+
20+
result.name = node.GetString("name");
21+
result.protocol = node.GetUInt32("protocol");
22+
23+
var platforms_array = node.GetNode("platforms");
24+
if (platforms_array != null)
25+
{
26+
result.platforms = new Platform[platforms_array.ChildCount];
27+
for (int i = 0; i < platforms_array.ChildCount; i++)
28+
{
29+
30+
result.platforms[i] = Platform.FromNode(platforms_array.GetNodeByIndex(i));
31+
}
32+
}
33+
else
34+
{
35+
result.platforms = new Platform[0];
36+
}
37+
38+
var tokens_array = node.GetNode("tokens");
39+
if (tokens_array != null)
40+
{
41+
result.tokens = new Token[tokens_array.ChildCount];
42+
for (int i = 0; i < tokens_array.ChildCount; i++)
43+
{
44+
45+
result.tokens[i] = Token.FromNode(tokens_array.GetNodeByIndex(i));
46+
}
47+
}
48+
else
49+
{
50+
result.tokens = new Token[0];
51+
}
52+
53+
var chains_array = node.GetNode("chains");
54+
if (chains_array != null)
55+
{
56+
result.chains = new Chain[chains_array.ChildCount];
57+
for (int i = 0; i < chains_array.ChildCount; i++)
58+
{
59+
60+
result.chains[i] = Chain.FromNode(chains_array.GetNodeByIndex(i));
61+
}
62+
}
63+
else
64+
{
65+
result.chains = new Chain[0];
66+
}
67+
68+
var governance_array = node.GetNode("governance");
69+
if (governance_array != null)
70+
{
71+
result.governance = new Governance[governance_array.ChildCount];
72+
for (int i = 0; i < governance_array.ChildCount; i++)
73+
{
74+
75+
result.governance[i] = Governance.FromNode(governance_array.GetNodeByIndex(i));
76+
}
77+
}
78+
else
79+
{
80+
result.governance = new Governance[0];
81+
}
82+
83+
var organizations_array = node.GetNode("organizations");
84+
if (organizations_array != null)
85+
{
86+
result.organizations = new string[organizations_array.ChildCount];
87+
for (int i = 0; i < organizations_array.ChildCount; i++)
88+
{
89+
90+
result.organizations[i] = organizations_array.GetNodeByIndex(i).AsString();
91+
}
92+
}
93+
else
94+
{
95+
result.organizations = new string[0];
96+
}
97+
return result;
98+
}
99+
}
100+
}

Runtime/Phantasma/Scripts/Models/Nexus.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)