@silvana-one/api 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,184 @@
1
+ export {
2
+ CanonicalBlockchain,
3
+ MinaNetwork,
4
+ networks,
5
+ Mainnet,
6
+ Devnet,
7
+ Zeko,
8
+ ZekoAlphaNet,
9
+ Lightnet,
10
+ Local,
11
+ };
12
+
13
+ type CanonicalBlockchain =
14
+ | "mina:local"
15
+ | "mina:lightnet"
16
+ | "mina:devnet"
17
+ | "mina:mainnet"
18
+ | "zeko:testnet"
19
+ | "zeko:alphanet";
20
+
21
+ /**
22
+ * blockchain is the type for the chain ID - deprecated.
23
+ */
24
+ // type blockchain =
25
+ // | CanonicalBlockchain
26
+ // | "local"
27
+ // | "devnet"
28
+ // | "lightnet"
29
+ // | "mainnet"
30
+ // | "zeko";
31
+
32
+ // function getCanonicalBlockchain(chain: blockchain): CanonicalBlockchain {
33
+ // switch (chain) {
34
+ // case "local":
35
+ // return "mina:local";
36
+ // case "devnet":
37
+ // return "mina:devnet";
38
+ // case "lightnet":
39
+ // return "mina:lightnet";
40
+ // case "mainnet":
41
+ // return "mina:mainnet";
42
+ // case "zeko":
43
+ // return "zeko:testnet";
44
+ // default:
45
+ // return chain;
46
+ // }
47
+ // }
48
+
49
+ /**
50
+ * MinaNetwork is the data structure for a Mina network, keeping track of the Mina and archive endpoints, chain ID, name, account manager, explorer account URL, explorer transaction URL, and faucet.
51
+ */
52
+ interface MinaNetwork {
53
+ /** The Mina endpoints */
54
+ mina: string[];
55
+
56
+ /** The archive endpoints */
57
+ archive: string[];
58
+
59
+ /** The chain ID */
60
+ chainId: CanonicalBlockchain;
61
+
62
+ /** The name of the network (optional) */
63
+ name?: string;
64
+
65
+ /** The account manager for Lightnet (optional) */
66
+ accountManager?: string;
67
+
68
+ /** The explorer account URL (optional) */
69
+ explorerAccountUrl?: string;
70
+
71
+ /** The explorer transaction URL (optional) */
72
+ explorerTransactionUrl?: string;
73
+
74
+ /** The explorer token URL (optional) */
75
+ explorerTokenUrl?: string;
76
+
77
+ /** The launchpad URL (optional) */
78
+ launchpadUrl?: string;
79
+
80
+ /** The faucet URL (optional) */
81
+ faucet?: string;
82
+ }
83
+
84
+ const Mainnet: MinaNetwork = {
85
+ mina: [
86
+ //"https://proxy.devnet.minaexplorer.com/graphql",
87
+ "https://api.minascan.io/node/mainnet/v1/graphql",
88
+ ],
89
+ archive: [
90
+ "https://api.minascan.io/archive/mainnet/v1/graphql",
91
+ //"https://archive.devnet.minaexplorer.com",
92
+ ],
93
+ explorerAccountUrl: "https://minascan.io/mainnet/account/",
94
+ explorerTransactionUrl: "https://minascan.io/mainnet/tx/",
95
+ explorerTokenUrl: "https://minascan.io/mainnet/token/",
96
+ launchpadUrl: "https://minatokens.com",
97
+ chainId: "mina:mainnet",
98
+ name: "Mainnet",
99
+ };
100
+
101
+ const Local: MinaNetwork = {
102
+ mina: [],
103
+ archive: [],
104
+ chainId: "mina:local",
105
+ };
106
+
107
+ const Devnet: MinaNetwork = {
108
+ mina: [
109
+ "https://api.minascan.io/node/devnet/v1/graphql",
110
+ //"https://proxy.devnet.minaexplorer.com/graphql",
111
+ ],
112
+ archive: [
113
+ "https://api.minascan.io/archive/devnet/v1/graphql",
114
+ //"https://archive.devnet.minaexplorer.com",
115
+ ],
116
+ explorerAccountUrl: "https://minascan.io/devnet/account/",
117
+ explorerTransactionUrl: "https://minascan.io/devnet/tx/",
118
+ explorerTokenUrl: "https://minascan.io/devnet/token/",
119
+ launchpadUrl: "https://minatokens.com",
120
+ chainId: "mina:devnet",
121
+ name: "Devnet",
122
+ faucet: "https://faucet.minaprotocol.com",
123
+ };
124
+
125
+ const Zeko: MinaNetwork = {
126
+ mina: ["https://devnet.zeko.io/graphql"],
127
+ archive: ["https://devnet.zeko.io/graphql"],
128
+ explorerAccountUrl: "https://zekoscan.io/testnet/account/",
129
+ explorerTransactionUrl: "https://zekoscan.io/testnet/tx/",
130
+ explorerTokenUrl: "https://zekoscan.io/testnet/token/",
131
+ launchpadUrl: "https://zekotokens.com",
132
+ chainId: "zeko:testnet",
133
+ name: "Zeko",
134
+ faucet: "https://zeko.io/faucet",
135
+ };
136
+
137
+ const ZekoAlphaNet: MinaNetwork = {
138
+ mina: ["http://m1.zeko.io/graphql"],
139
+ archive: ["http://m1.zeko.io/graphql"],
140
+ explorerAccountUrl: "",
141
+ explorerTransactionUrl: "",
142
+ chainId: "zeko:alphanet",
143
+ name: "Zeko AlphaNet",
144
+ faucet: "",
145
+ };
146
+
147
+ const Lightnet: MinaNetwork = {
148
+ mina: ["http://localhost:8080/graphql"],
149
+ archive: ["http://localhost:8282"],
150
+ accountManager: "http://localhost:8181",
151
+ chainId: "mina:lightnet",
152
+ name: "Lightnet",
153
+ };
154
+
155
+ const networks: MinaNetwork[] = [Mainnet, Local, Devnet, Zeko, Lightnet];
156
+
157
+ /*
158
+ // not supported by o1js v1
159
+
160
+ const Berkeley: MinaNetwork = {
161
+ mina: [
162
+ "https://api.minascan.io/node/berkeley/v1/graphql",
163
+ "https://proxy.berkeley.minaexplorer.com/graphql",
164
+ ],
165
+ archive: [
166
+ "https://api.minascan.io/archive/berkeley/v1/graphql",
167
+ "https://archive.berkeley.minaexplorer.com",
168
+ ],
169
+ explorerAccountUrl: "https://minascan.io/berkeley/account/",
170
+ explorerTransactionUrl: "https://minascan.io/berkeley/tx/",
171
+ chainId: "berkeley",
172
+ name: "Berkeley",
173
+ };
174
+
175
+ const TestWorld2: MinaNetwork = {
176
+ mina: ["https://api.minascan.io/node/testworld/v1/graphql"],
177
+ archive: ["https://archive.testworld.minaexplorer.com"],
178
+ explorerAccountUrl: "https://minascan.io/testworld/account/",
179
+ explorerTransactionUrl: "https://minascan.io/testworld/tx/",
180
+ chainId: "testworld2",
181
+ name: "TestWorld2",
182
+ };
183
+
184
+ */
package/src/zeko.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function getCurrentZekoSlot(
2
- chain: "zeko" | "zeko:alphanet" = "zeko"
2
+ chain: "zeko:testnet" | "zeko:alphanet" = "zeko:testnet"
3
3
  ): Promise<number | undefined> {
4
4
  try {
5
5
  const response = await fetch(