@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/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`);