@n1xyz/nord-ts 0.1.4 → 0.1.6
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/dist/gen/nord_pb.d.ts +516 -7
- package/dist/gen/nord_pb.js +133 -64
- package/dist/gen/openapi.d.ts +165 -1
- package/dist/nord/api/actions.d.ts +9 -0
- package/dist/nord/api/actions.js +16 -0
- package/dist/nord/client/Nord.d.ts +92 -2
- package/dist/nord/client/Nord.js +150 -2
- package/dist/nord/client/NordAdmin.d.ts +202 -13
- package/dist/nord/client/NordAdmin.js +273 -67
- package/dist/nord/client/NordClient.d.ts +0 -9
- package/dist/nord/client/NordClient.js +0 -48
- package/dist/nord/client/NordUser.js +6 -6
- package/dist/nord/index.d.ts +2 -2
- package/dist/nord/index.js +2 -1
- package/dist/types.d.ts +7 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +5 -0
- package/package.json +2 -2
- package/src/gen/nord_pb.ts +640 -63
- package/src/gen/openapi.ts +165 -1
- package/src/nord/api/actions.ts +26 -1
- package/src/nord/client/Nord.ts +185 -1
- package/src/nord/client/NordAdmin.ts +366 -84
- package/src/nord/client/NordClient.ts +0 -26
- package/src/nord/client/NordUser.ts +7 -6
- package/src/nord/index.ts +1 -2
- package/src/types.ts +9 -0
- package/src/utils.ts +5 -0
package/src/nord/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Export main client classes
|
|
2
2
|
export { Nord } from "./client/Nord";
|
|
3
3
|
export { NordUser } from "./client/NordUser";
|
|
4
|
-
export { NordAdmin } from "./client/NordAdmin";
|
|
4
|
+
export { NordAdmin, AclRole } from "./client/NordAdmin";
|
|
5
5
|
export { NordClient } from "./client/NordClient";
|
|
6
6
|
export type { NordClientParams } from "./client/NordClient";
|
|
7
7
|
export type {
|
|
@@ -11,7 +11,6 @@ export type {
|
|
|
11
11
|
PythSetSymbolFeedParams,
|
|
12
12
|
FreezeMarketParams,
|
|
13
13
|
UnfreezeMarketParams,
|
|
14
|
-
NordAdminParams,
|
|
15
14
|
} from "./client/NordAdmin";
|
|
16
15
|
|
|
17
16
|
// Export utility classes
|
package/src/types.ts
CHANGED
|
@@ -42,6 +42,9 @@ export interface NordConfig {
|
|
|
42
42
|
app: string;
|
|
43
43
|
/** Solana cluster URL */
|
|
44
44
|
solanaUrl: string;
|
|
45
|
+
/** Proton URL, defaults to webServerUrl */
|
|
46
|
+
// TODO: this is ass. move to NordUser.
|
|
47
|
+
protonUrl?: string;
|
|
45
48
|
/**
|
|
46
49
|
* Whether to initialize WebSockets on creation, defaults to true
|
|
47
50
|
* @deprecated this is a funky api we're gonna be removing it
|
|
@@ -96,6 +99,12 @@ export type AccountTriggerInfo = components["schemas"]["AccountTriggerInfo"];
|
|
|
96
99
|
export type TriggerHistoryPage =
|
|
97
100
|
components["schemas"]["PageResult_for_uint64_and_HistoryTriggerInfo"];
|
|
98
101
|
export type HistoryTriggerQuery = components["schemas"]["AccountTriggersQuery"];
|
|
102
|
+
export type FeeTierConfig = components["schemas"]["FeeTierConfig"];
|
|
103
|
+
export type FeeTierId = components["schemas"]["FeeTierId"];
|
|
104
|
+
export type TokenStats = components["schemas"]["TokenStats"];
|
|
105
|
+
export type AccountFeeTier = components["schemas"]["AccountFeeTier"];
|
|
106
|
+
export type AccountFeeTierPage =
|
|
107
|
+
components["schemas"]["PageResult_for_uint32_and_AccountFeeTier"];
|
|
99
108
|
|
|
100
109
|
/**
|
|
101
110
|
* Configuration options for the Nord client
|
package/src/utils.ts
CHANGED
|
@@ -233,6 +233,11 @@ export function checkPubKeyLength(keyType: KeyType, len: number): void {
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
export function decodeHex(value: string): Uint8Array {
|
|
237
|
+
const hex = value.startsWith("0x") ? value.slice(2) : value;
|
|
238
|
+
return Uint8Array.from(Buffer.from(hex, "hex"));
|
|
239
|
+
}
|
|
240
|
+
|
|
236
241
|
export function findMarket(markets: Market[], marketId: number): Market {
|
|
237
242
|
if (marketId < 0 || markets.length - 1 < marketId) {
|
|
238
243
|
throw new Error(`The market with marketId=${marketId} not found`);
|