@injectivelabs/sdk-ts 0.0.11 → 0.0.16
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.
- package/README.md +10 -0
- package/dist/local/Network.d.ts +0 -34
- package/dist/local/Network.d.ts.map +1 -1
- package/dist/local/Network.js +137 -67
- package/dist/local/Network.js.map +1 -1
- package/dist/local/index.d.ts +0 -1
- package/dist/local/index.d.ts.map +1 -1
- package/dist/local/index.js +1 -1
- package/dist/local/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -190,6 +190,16 @@ console.log(
|
|
|
190
190
|
|
|
191
191
|
## 🖱️ Examples
|
|
192
192
|
|
|
193
|
+
To run an example, `cd` into the `examples` folder and execute the desired example by running:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
yarn ts-node pathToExample
|
|
197
|
+
|
|
198
|
+
## Example: yarn ts-node ./core/MsgBid.ts
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Don't forget to do `yarn` and install dependencies before executing any example.
|
|
202
|
+
|
|
193
203
|
---
|
|
194
204
|
|
|
195
205
|
## ⛑ Support
|
package/dist/local/Network.d.ts
CHANGED
|
@@ -1,35 +1 @@
|
|
|
1
|
-
export declare enum TestnetNodes {
|
|
2
|
-
sentry0 = "sentry-0",
|
|
3
|
-
sentry1 = "sentry-1",
|
|
4
|
-
k8s = "k8s"
|
|
5
|
-
}
|
|
6
|
-
export declare enum MainnetNodes {
|
|
7
|
-
sentry0 = "sentry-0",
|
|
8
|
-
sentry1 = "sentry-1",
|
|
9
|
-
sentry2 = "sentry-2",
|
|
10
|
-
sentry3 = "sentry-3",
|
|
11
|
-
sentryCd = "sentry.cd",
|
|
12
|
-
k8s = "k8s",
|
|
13
|
-
lb = "lb"
|
|
14
|
-
}
|
|
15
|
-
export declare class Network {
|
|
16
|
-
sentryHttpApi: string;
|
|
17
|
-
sentryGrpcApi: string;
|
|
18
|
-
exchangeApi: string;
|
|
19
|
-
feeDenom: string;
|
|
20
|
-
chainId: string;
|
|
21
|
-
env: string;
|
|
22
|
-
constructor({ sentryHttpApi, sentryGrpcApi, exchangeApi, feeDenom, chainId, env, }: {
|
|
23
|
-
sentryHttpApi: string;
|
|
24
|
-
sentryGrpcApi: string;
|
|
25
|
-
exchangeApi: string;
|
|
26
|
-
feeDenom: string;
|
|
27
|
-
chainId: string;
|
|
28
|
-
env: string;
|
|
29
|
-
});
|
|
30
|
-
static devnet(): Network;
|
|
31
|
-
static local(): Network;
|
|
32
|
-
static testnet(node?: TestnetNodes): Network;
|
|
33
|
-
static mainnet(node?: MainnetNodes): Network;
|
|
34
|
-
}
|
|
35
1
|
//# sourceMappingURL=Network.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Network.d.ts","sourceRoot":"","sources":["../../src/local/Network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Network.d.ts","sourceRoot":"","sources":["../../src/local/Network.ts"],"names":[],"mappings":""}
|
package/dist/local/Network.js
CHANGED
|
@@ -1,75 +1,145 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
/*
|
|
3
|
+
|
|
4
|
+
Note: use Network from @injectivelabs/utils for now
|
|
5
|
+
|
|
6
|
+
export enum TestnetNodes {
|
|
7
|
+
sentry0 = 'sentry-0',
|
|
8
|
+
sentry1 = 'sentry-1',
|
|
9
|
+
k8s = 'k8s',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum MainnetNodes {
|
|
13
|
+
sentry0 = 'sentry-0',
|
|
14
|
+
sentry1 = 'sentry-1',
|
|
15
|
+
sentry2 = 'sentry-2',
|
|
16
|
+
sentry3 = 'sentry-3',
|
|
17
|
+
sentryCd = 'sentry.cd',
|
|
18
|
+
k8s = 'k8s',
|
|
19
|
+
lb = 'lb',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class Network {
|
|
23
|
+
public sentryHttpApi
|
|
24
|
+
|
|
25
|
+
public sentryGrpcApi
|
|
26
|
+
|
|
27
|
+
public exchangeApi
|
|
28
|
+
|
|
29
|
+
public feeDenom
|
|
30
|
+
|
|
31
|
+
public chainId
|
|
32
|
+
|
|
33
|
+
public env
|
|
34
|
+
|
|
35
|
+
constructor({
|
|
36
|
+
sentryHttpApi,
|
|
37
|
+
sentryGrpcApi,
|
|
38
|
+
exchangeApi,
|
|
39
|
+
feeDenom,
|
|
40
|
+
chainId,
|
|
41
|
+
env,
|
|
42
|
+
}: {
|
|
43
|
+
sentryHttpApi: string
|
|
44
|
+
sentryGrpcApi: string
|
|
45
|
+
exchangeApi: string
|
|
46
|
+
feeDenom: string
|
|
47
|
+
chainId: string
|
|
48
|
+
env: string
|
|
49
|
+
}) {
|
|
50
|
+
this.sentryHttpApi = sentryHttpApi
|
|
51
|
+
this.sentryGrpcApi = sentryGrpcApi
|
|
52
|
+
this.exchangeApi = exchangeApi
|
|
53
|
+
this.feeDenom = feeDenom
|
|
54
|
+
this.chainId = chainId
|
|
55
|
+
this.env = env
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static devnet(): Network {
|
|
59
|
+
const params = {
|
|
60
|
+
feeDenom: 'inj',
|
|
61
|
+
chainId: 'injective-777',
|
|
62
|
+
env: 'devnet',
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return new Network({
|
|
66
|
+
...params,
|
|
67
|
+
sentryHttpApi: 'https://devnet.lcd.injective.dev',
|
|
68
|
+
sentryGrpcApi: 'https://devnet.injective.dev:9900',
|
|
69
|
+
exchangeApi: 'https://devnet.injective.dev:9910',
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static local(): Network {
|
|
74
|
+
const params = {
|
|
75
|
+
feeDenom: 'inj',
|
|
76
|
+
chainId: 'injective-1',
|
|
77
|
+
env: 'local',
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return new Network({
|
|
81
|
+
...params,
|
|
82
|
+
sentryHttpApi: 'http://localhost:10337',
|
|
83
|
+
sentryGrpcApi: 'http://localhost:9900',
|
|
84
|
+
exchangeApi: 'http://localhost:9910',
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
static testnet(node: TestnetNodes = TestnetNodes.k8s): Network {
|
|
89
|
+
if (!Object.values(TestnetNodes).includes(node)) {
|
|
90
|
+
throw new Error('Invalid testnet node')
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const params = {
|
|
94
|
+
feeDenom: 'inj',
|
|
95
|
+
chainId: 'injective-888',
|
|
96
|
+
env: 'testnet',
|
|
28
97
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
98
|
+
|
|
99
|
+
if (node === TestnetNodes.k8s) {
|
|
100
|
+
return new Network({
|
|
101
|
+
...params,
|
|
102
|
+
sentryHttpApi: `https://${node}.testnet.lcd.injective.network`,
|
|
103
|
+
sentryGrpcApi: `https://${node}.testnet.chain.grpc-web.injective.network`,
|
|
104
|
+
exchangeApi: `https://${node}.testnet.exchange.grpc-web.injective.network`,
|
|
105
|
+
})
|
|
36
106
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
107
|
+
|
|
108
|
+
return new Network({
|
|
109
|
+
...params,
|
|
110
|
+
sentryHttpApi: 'https://testnet.lcd.injective.dev',
|
|
111
|
+
sentryGrpcApi: `https://${node}.injective.dev:9900`,
|
|
112
|
+
exchangeApi: `https://${node}.injective.dev:9910`,
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static mainnet(node: MainnetNodes = MainnetNodes.k8s): Network {
|
|
117
|
+
if (!Object.values(MainnetNodes).includes(node)) {
|
|
118
|
+
throw new Error('Invalid testnet node')
|
|
44
119
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
feeDenom: 'inj',
|
|
51
|
-
chainId: 'injective-888',
|
|
52
|
-
env: 'testnet',
|
|
53
|
-
};
|
|
54
|
-
if (node === TestnetNodes.k8s) {
|
|
55
|
-
return new Network(Object.assign(Object.assign({}, params), { sentryHttpApi: `https://${node}.testnet.lcd.injective.network`, sentryGrpcApi: `https://${node}.testnet.chain.grpc-web.injective.network`, exchangeApi: `https://${node}.testnet.exchange.grpc-web.injective.network` }));
|
|
56
|
-
}
|
|
57
|
-
return new Network(Object.assign(Object.assign({}, params), { sentryHttpApi: 'https://testnet.lcd.injective.dev', sentryGrpcApi: `https://${node}.injective.dev:9900`, exchangeApi: `https://${node}.injective.dev:9910` }));
|
|
120
|
+
|
|
121
|
+
const params = {
|
|
122
|
+
feeDenom: 'inj',
|
|
123
|
+
chainId: 'injective-1',
|
|
124
|
+
env: 'mainnet',
|
|
58
125
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
if (node === MainnetNodes.k8s || node === MainnetNodes.lb) {
|
|
69
|
-
return new Network(Object.assign(Object.assign({}, params), { sentryHttpApi: 'https://k8s.testnet.lcd.injective.network', sentryGrpcApi: 'https://k8s.testnet.chain.grpc.injective.network:443', exchangeApi: 'https://k8s.testnet.exchange.grpc.injective.network:443' }));
|
|
70
|
-
}
|
|
71
|
-
return new Network(Object.assign(Object.assign({}, params), { sentryHttpApi: 'https://lcd.injective.network', sentryGrpcApi: `https://${node}.injective.network:9900`, exchangeApi: `https://${node}.injective.network:9910` }));
|
|
126
|
+
|
|
127
|
+
if (node === MainnetNodes.k8s || node === MainnetNodes.lb) {
|
|
128
|
+
return new Network({
|
|
129
|
+
...params,
|
|
130
|
+
sentryHttpApi: 'https://k8s.testnet.lcd.injective.network',
|
|
131
|
+
sentryGrpcApi: 'https://k8s.testnet.chain.grpc.injective.network:443',
|
|
132
|
+
exchangeApi: 'https://k8s.testnet.exchange.grpc.injective.network:443',
|
|
133
|
+
})
|
|
72
134
|
}
|
|
135
|
+
|
|
136
|
+
return new Network({
|
|
137
|
+
...params,
|
|
138
|
+
sentryHttpApi: 'https://lcd.injective.network',
|
|
139
|
+
sentryGrpcApi: `https://${node}.injective.network:9900`,
|
|
140
|
+
exchangeApi: `https://${node}.injective.network:9910`,
|
|
141
|
+
})
|
|
142
|
+
}
|
|
73
143
|
}
|
|
74
|
-
|
|
144
|
+
*/
|
|
75
145
|
//# sourceMappingURL=Network.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Network.js","sourceRoot":"","sources":["../../src/local/Network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Network.js","sourceRoot":"","sources":["../../src/local/Network.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IE"}
|
package/dist/local/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/local/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
|
package/dist/local/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
13
|
+
// export * from './Network'
|
|
14
14
|
__exportStar(require("./TxInjective"), exports);
|
|
15
15
|
__exportStar(require("./TxService"), exports);
|
|
16
16
|
__exportStar(require("./PrivateKey"), exports);
|
package/dist/local/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/local/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/local/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA4B;AAC5B,gDAA6B;AAC7B,8CAA2B;AAC3B,+CAA4B;AAC5B,8CAA2B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/sdk-ts",
|
|
3
3
|
"description": "SDK in TypeScript for building Injective applications in a Node environment.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bojan Angjelkoski",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@injectivelabs/chain-api": "^1.7.1",
|
|
37
37
|
"@injectivelabs/exceptions": "^0.5.1",
|
|
38
38
|
"@injectivelabs/exchange-api": "^2.2.59",
|
|
39
|
-
"@injectivelabs/networks": "^0.5.
|
|
39
|
+
"@injectivelabs/networks": "^0.5.3",
|
|
40
40
|
"@injectivelabs/ts-types": "^0.5.1",
|
|
41
41
|
"@injectivelabs/utils": "^0.5.1",
|
|
42
42
|
"@types/google-protobuf": "^3.15.5",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"snakecase-keys": "^5.4.1",
|
|
55
55
|
"tiny-secp256k1": "^2.2.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "301db22f30cc88ffaf3f32731774386f172f6ee4"
|
|
58
58
|
}
|