@n1xyz/nord-ts 0.0.4 → 0.0.5
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/bridge/client.d.ts +4 -4
- package/dist/bridge/client.js +4 -4
- package/dist/bridge/const.d.ts +2 -2
- package/dist/bridge/const.js +22 -22
- package/dist/bridge/index.d.ts +4 -4
- package/dist/bridge/types.d.ts +3 -3
- package/dist/bridge/utils.d.ts +4 -4
- package/dist/bridge/utils.js +10 -10
- package/dist/const.d.ts +1 -1
- package/dist/const.js +17 -17
- package/dist/gen/nord.d.ts +1 -4
- package/dist/idl/bridge.d.ts +1 -1
- package/dist/idl/bridge.js +185 -185
- package/dist/index.d.ts +8 -8
- package/dist/nord/api/actions.d.ts +3 -3
- package/dist/nord/api/actions.js +21 -21
- package/dist/nord/api/core.d.ts +3 -3
- package/dist/nord/api/core.js +12 -12
- package/dist/nord/api/market.d.ts +1 -1
- package/dist/nord/api/market.js +12 -12
- package/dist/nord/api/metrics.d.ts +1 -1
- package/dist/nord/api/metrics.js +6 -6
- package/dist/nord/api/queries.d.ts +1 -1
- package/dist/nord/api/queries.js +9 -9
- package/dist/nord/client/Nord.d.ts +4 -4
- package/dist/nord/client/Nord.js +18 -18
- package/dist/nord/client/NordUser.d.ts +7 -7
- package/dist/nord/client/NordUser.js +45 -49
- package/dist/nord/index.d.ts +9 -9
- package/dist/nord/models/Subscriber.d.ts +6 -6
- package/dist/nord/models/Subscriber.js +1 -5
- package/dist/nord/utils/NordError.js +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.d.ts +6 -6
- package/dist/utils.js +8 -8
- package/dist/websocket/NordWebSocketClient.d.ts +2 -2
- package/dist/websocket/NordWebSocketClient.js +38 -38
- package/dist/websocket/events.d.ts +1 -1
- package/dist/websocket/index.d.ts +2 -2
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +16 -16
- package/docs/assets/icons.js +17 -14
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1423 -1227
- package/docs/classes/Nord.html +190 -31
- package/docs/classes/NordError.html +24 -0
- package/docs/classes/NordUser.html +120 -35
- package/docs/classes/NordWebSocketClient.html +335 -0
- package/docs/classes/SolanaBridgeClient.html +86 -0
- package/docs/classes/Subscriber.html +10 -0
- package/docs/enums/FillMode.html +5 -5
- package/docs/enums/KeyType.html +4 -4
- package/docs/enums/MetricPeriod.html +9 -0
- package/docs/enums/PdaSeedType.html +9 -0
- package/docs/enums/PeakTpsPeriodUnit.html +7 -7
- package/docs/enums/Side.html +3 -3
- package/docs/enums/WebSocketMessageType.html +7 -0
- package/docs/functions/actionQueryRollman.html +6 -0
- package/docs/functions/actionsQueryRollman.html +6 -0
- package/docs/functions/aggregateMetrics-1.html +7 -0
- package/docs/functions/assert.html +1 -1
- package/docs/functions/bigIntToProtoU128.html +3 -3
- package/docs/functions/blockQueryRollman.html +6 -0
- package/docs/functions/blockSummaryQueryRollman.html +6 -0
- package/docs/functions/bridgeToBN.html +5 -0
- package/docs/functions/bufferToHex.html +4 -0
- package/docs/functions/cancelOrder.html +1 -0
- package/docs/functions/checkPubKeyLength.html +1 -1
- package/docs/functions/checkedFetch.html +4 -4
- package/docs/functions/createSession.html +1 -0
- package/docs/functions/decodeLengthDelimited.html +7 -6
- package/docs/functions/encodeLengthDelimited.html +4 -4
- package/docs/functions/fillModeToProtoFillMode.html +4 -4
- package/docs/functions/findMarket.html +1 -1
- package/docs/functions/findPda.html +6 -0
- package/docs/functions/findToken.html +1 -1
- package/docs/functions/fromBN.html +5 -0
- package/docs/functions/getAccount.html +6 -0
- package/docs/functions/getActionNonce.html +5 -0
- package/docs/functions/getCurrentTps.html +6 -0
- package/docs/functions/getInfo.html +5 -0
- package/docs/functions/getMedianLatency.html +6 -0
- package/docs/functions/getOrderbook.html +6 -0
- package/docs/functions/getPeakTps.html +6 -0
- package/docs/functions/getTimestamp.html +5 -0
- package/docs/functions/getTotalTransactions.html +5 -0
- package/docs/functions/getTrades.html +6 -0
- package/docs/functions/getUserAccountIds.html +6 -0
- package/docs/functions/hexToBuffer.html +4 -0
- package/docs/functions/initWebSocketClient.html +12 -0
- package/docs/functions/keypairFromPrivateKey.html +4 -0
- package/docs/functions/makeSigningFunction.html +4 -0
- package/docs/functions/makeWalletSignFn.html +5 -5
- package/docs/functions/marketsStats.html +5 -0
- package/docs/functions/optExpect.html +4 -4
- package/docs/functions/optMap.html +5 -5
- package/docs/functions/optUnwrap.html +2 -2
- package/docs/functions/panic.html +1 -1
- package/docs/functions/placeOrder.html +1 -0
- package/docs/functions/queryAction.html +6 -0
- package/docs/functions/queryBlock.html +6 -0
- package/docs/functions/queryLastNBlocks.html +5 -0
- package/docs/functions/queryPrometheus.html +6 -0
- package/docs/functions/queryRecentActions.html +6 -0
- package/docs/functions/queryRecentBlocks.html +6 -0
- package/docs/functions/revokeSession.html +1 -0
- package/docs/functions/shortenPublicKey.html +5 -0
- package/docs/functions/signAction.html +2 -2
- package/docs/functions/toBN.html +5 -0
- package/docs/functions/toScaledU128.html +5 -5
- package/docs/functions/toScaledU64.html +5 -5
- package/docs/functions/transfer.html +1 -0
- package/docs/functions/withdraw.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +39 -20
- package/docs/interfaces/Account.html +8 -8
- package/docs/interfaces/ActionInfo.html +8 -8
- package/docs/interfaces/ActionNonceResponse.html +3 -0
- package/docs/interfaces/ActionQuery.html +4 -4
- package/docs/interfaces/ActionResponse.html +8 -8
- package/docs/interfaces/ActionsExtendedInfo.html +10 -10
- package/docs/interfaces/ActionsQuery.html +5 -5
- package/docs/interfaces/ActionsResponse.html +6 -6
- package/docs/interfaces/AggregateMetrics.html +12 -12
- package/docs/interfaces/BlockFacts.html +10 -0
- package/docs/interfaces/BlockQuery.html +6 -6
- package/docs/interfaces/BlockResponse.html +6 -6
- package/docs/interfaces/BlockSummary.html +8 -8
- package/docs/interfaces/BlockSummaryResponse.html +6 -6
- package/docs/interfaces/DeltaEvent.html +6 -6
- package/docs/interfaces/DepositSplParams.html +10 -0
- package/docs/interfaces/Info.html +3 -3
- package/docs/interfaces/Market.html +8 -6
- package/docs/interfaces/MarketStats.html +7 -7
- package/docs/interfaces/MarketsStatsResponse.html +2 -2
- package/docs/interfaces/NordConfig.html +14 -5
- package/docs/interfaces/NordWebSocketClientEvents.html +4 -0
- package/docs/interfaces/NordWebSocketEvents.html +8 -0
- package/docs/interfaces/Order.html +6 -6
- package/docs/interfaces/OrderInfo.html +6 -6
- package/docs/interfaces/OrderbookEntry.html +4 -0
- package/docs/interfaces/OrderbookQuery.html +6 -0
- package/docs/interfaces/OrderbookResponse.html +6 -0
- package/docs/interfaces/OrderbookSubscription.html +159 -0
- package/docs/interfaces/PerpMarketStats.html +5 -5
- package/docs/interfaces/RollmanActionExtendedInfo.html +4 -4
- package/docs/interfaces/RollmanActionInfo.html +4 -4
- package/docs/interfaces/RollmanActionResponse.html +4 -4
- package/docs/interfaces/RollmanActionsResponse.html +2 -2
- package/docs/interfaces/RollmanBlockResponse.html +3 -3
- package/docs/interfaces/SPLTokenInfo.html +10 -0
- package/docs/interfaces/SolanaBridgeConfig.html +10 -0
- package/docs/interfaces/StateFacts.html +10 -0
- package/docs/interfaces/SubscriberConfig.html +3 -3
- package/docs/interfaces/TimestampResponse.html +3 -0
- package/docs/interfaces/Token.html +5 -5
- package/docs/interfaces/TokenInfo.html +5 -0
- package/docs/interfaces/Trade.html +5 -5
- package/docs/interfaces/TradeSubscription.html +159 -0
- package/docs/interfaces/Trades.html +5 -5
- package/docs/interfaces/TradesQuery.html +6 -0
- package/docs/interfaces/TradesResponse.html +7 -0
- package/docs/interfaces/TransferParams.html +8 -0
- package/docs/interfaces/UserAccountIdsQuery.html +3 -0
- package/docs/interfaces/UserAccountIdsResponse.html +3 -0
- package/docs/interfaces/WebSocketDeltaUpdate.html +9 -0
- package/docs/interfaces/WebSocketSubscription.html +4 -0
- package/docs/interfaces/WebSocketTradeUpdate.html +6 -0
- package/docs/interfaces/WebSocketUserUpdate.html +6 -0
- package/docs/interfaces/WithdrawalClaim.html +14 -0
- package/docs/interfaces/WithdrawalParams.html +8 -0
- package/docs/modules.html +1 -70
- package/docs/types/BigIntValue.html +2 -2
- package/docs/types/WebSocketMessage.html +1 -0
- package/docs/variables/DEBUG_KEYS.html +1 -1
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -1
- package/docs/variables/DEV_TOKEN_INFOS.html +1 -1
- package/docs/variables/DEV_URL.html +1 -1
- package/docs/variables/MAX_BUFFER_LEN.html +1 -1
- package/docs/variables/SESSION_TTL.html +1 -1
- package/docs/variables/WEBSERVER_DEV_URL.html +1 -1
- package/docs/variables/ZERO_DECIMAL.html +1 -1
- package/docs/variables/_private.html +2 -0
- package/eslint.config.mjs +66 -0
- package/package.json +12 -13
- package/src/bridge/client.ts +10 -10
- package/src/bridge/const.ts +24 -24
- package/src/bridge/index.ts +4 -4
- package/src/bridge/types.ts +10 -10
- package/src/bridge/utils.ts +14 -14
- package/src/const.ts +18 -18
- package/src/gen/nord.ts +1 -4
- package/src/idl/bridge.ts +186 -186
- package/src/index.ts +8 -8
- package/src/nord/api/actions.ts +25 -25
- package/src/nord/api/core.ts +16 -16
- package/src/nord/api/market.ts +15 -15
- package/src/nord/api/metrics.ts +16 -16
- package/src/nord/api/queries.ts +12 -12
- package/src/nord/client/Nord.ts +27 -27
- package/src/nord/client/NordUser.ts +59 -63
- package/src/nord/index.ts +9 -9
- package/src/nord/models/Subscriber.ts +11 -12
- package/src/nord/utils/NordError.ts +2 -2
- package/src/types.ts +12 -12
- package/src/utils.ts +20 -20
- package/src/websocket/NordWebSocketClient.ts +42 -42
- package/src/websocket/events.ts +1 -1
- package/src/websocket/index.ts +2 -2
- package/tests/utils.spec.ts +24 -24
- package/tsconfig.eslint.json +12 -0
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -31
- package/dist/abis/ERC20_ABI.d.ts +0 -39
- package/dist/abis/ERC20_ABI.js +0 -313
- package/dist/abis/NORD_GETTERS_FACET_ABI.d.ts +0 -34
- package/dist/abis/NORD_GETTERS_FACET_ABI.js +0 -195
- package/dist/abis/NORD_RAMP_FACET_ABI.d.ts +0 -35
- package/dist/abis/NORD_RAMP_FACET_ABI.js +0 -144
- package/dist/abis/index.d.ts +0 -3
- package/dist/abis/index.js +0 -9
- package/dist/bridge/NordUser.d.ts +0 -78
- package/dist/bridge/NordUser.js +0 -196
- package/dist/client.d.ts +0 -70
- package/dist/client.js +0 -129
- package/dist/constants/endpoints.d.ts +0 -65
- package/dist/constants/endpoints.js +0 -68
- package/dist/models/account.d.ts +0 -58
- package/dist/models/account.js +0 -6
- package/dist/models/index.d.ts +0 -8
- package/dist/models/index.js +0 -28
- package/dist/models/market.d.ts +0 -137
- package/dist/models/market.js +0 -6
- package/dist/models/order.d.ts +0 -211
- package/dist/models/order.js +0 -6
- package/dist/models/token.d.ts +0 -50
- package/dist/models/token.js +0 -6
- package/dist/nord/Nord.d.ts +0 -249
- package/dist/nord/Nord.js +0 -388
- package/dist/nord/NordError.d.ts +0 -23
- package/dist/nord/NordError.js +0 -48
- package/dist/nord/NordImpl.d.ts +0 -11
- package/dist/nord/NordImpl.js +0 -26
- package/dist/nord/NordUser.d.ts +0 -243
- package/dist/nord/NordUser.js +0 -481
- package/dist/nord/Subscriber.d.ts +0 -37
- package/dist/nord/Subscriber.js +0 -29
- package/dist/nord/actions.d.ts +0 -101
- package/dist/nord/actions.js +0 -254
- package/dist/nord/api/index.d.ts +0 -1
- package/dist/nord/api/index.js +0 -17
- package/dist/nord/api/orderFunctions.d.ts +0 -168
- package/dist/nord/api/orderFunctions.js +0 -133
- package/dist/nord/core.d.ts +0 -48
- package/dist/nord/core.js +0 -97
- package/dist/nord/market.d.ts +0 -36
- package/dist/nord/market.js +0 -90
- package/dist/nord/metrics.d.ts +0 -67
- package/dist/nord/metrics.js +0 -124
- package/dist/nord/queries.d.ts +0 -81
- package/dist/nord/queries.js +0 -181
- package/dist/nord/types.d.ts +0 -88
- package/dist/nord/types.js +0 -2
- package/dist/nord/websocket.d.ts +0 -49
- package/dist/nord/websocket.js +0 -107
- package/dist/operations/account.d.ts +0 -58
- package/dist/operations/account.js +0 -112
- package/dist/operations/market.d.ts +0 -65
- package/dist/operations/market.js +0 -131
- package/dist/operations/orders.d.ts +0 -57
- package/dist/operations/orders.js +0 -129
- package/dist/solana/NordUser.d.ts +0 -78
- package/dist/solana/NordUser.js +0 -196
- package/dist/solana/client.d.ts +0 -139
- package/dist/solana/client.js +0 -360
- package/dist/solana/const.d.ts +0 -23
- package/dist/solana/const.js +0 -47
- package/dist/solana/index.d.ts +0 -5
- package/dist/solana/index.js +0 -23
- package/dist/solana/types.d.ts +0 -118
- package/dist/solana/types.js +0 -16
- package/dist/solana/utils.d.ts +0 -64
- package/dist/solana/utils.js +0 -131
- package/dist/types/api.d.ts +0 -152
- package/dist/types/api.js +0 -6
- package/dist/types/config.d.ts +0 -34
- package/dist/types/config.js +0 -6
- package/dist/utils/errors.d.ts +0 -96
- package/dist/utils/errors.js +0 -132
- package/dist/utils/http.d.ts +0 -35
- package/dist/utils/http.js +0 -105
- package/dist/websocket/client.d.ts +0 -93
- package/dist/websocket/client.js +0 -222
- package/dist/websocket.d.ts +0 -55
- package/dist/websocket.js +0 -211
- package/docs/interfaces/ERC20TokenInfo.html +0 -5
- package/docs/variables/DEV_CONTRACT_ADDRESS.html +0 -1
- package/docs/variables/ERC20_ABI.html +0 -1
- package/docs/variables/EVM_DEV_URL.html +0 -1
- package/docs/variables/FAUCET_PRIVATE_ADDRESS.html +0 -1
- package/docs/variables/NORD_GETTERS_FACET_ABI.html +0 -1
- package/docs/variables/NORD_RAMP_FACET_ABI.html +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WebSocket client for real-time data
|
|
3
|
-
* @module websocket/client
|
|
4
|
-
*/
|
|
5
|
-
import { OrderbookData, Trade } from '../models';
|
|
6
|
-
/**
|
|
7
|
-
* WebSocket client for real-time data
|
|
8
|
-
*/
|
|
9
|
-
export declare class WebSocketClient {
|
|
10
|
-
/**
|
|
11
|
-
* WebSocket connection
|
|
12
|
-
*/
|
|
13
|
-
private ws;
|
|
14
|
-
/**
|
|
15
|
-
* Base URL for the WebSocket server
|
|
16
|
-
*/
|
|
17
|
-
private readonly baseUrl;
|
|
18
|
-
/**
|
|
19
|
-
* Map of subscription IDs to callbacks
|
|
20
|
-
*/
|
|
21
|
-
private subscriptions;
|
|
22
|
-
/**
|
|
23
|
-
* Whether the WebSocket is connected
|
|
24
|
-
*/
|
|
25
|
-
private connected;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the WebSocket is connecting
|
|
28
|
-
*/
|
|
29
|
-
private connecting;
|
|
30
|
-
/**
|
|
31
|
-
* Queue of messages to send when connected
|
|
32
|
-
*/
|
|
33
|
-
private messageQueue;
|
|
34
|
-
/**
|
|
35
|
-
* Create a new WebSocket client
|
|
36
|
-
*
|
|
37
|
-
* @param baseUrl - Base URL for the WebSocket server
|
|
38
|
-
*/
|
|
39
|
-
constructor(baseUrl: string);
|
|
40
|
-
/**
|
|
41
|
-
* Connect to the WebSocket server
|
|
42
|
-
*
|
|
43
|
-
* @returns Promise that resolves when connected
|
|
44
|
-
*/
|
|
45
|
-
connect(): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Disconnect from the WebSocket server
|
|
48
|
-
*/
|
|
49
|
-
disconnect(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Send a message to the WebSocket server
|
|
52
|
-
*
|
|
53
|
-
* @param message - Message to send
|
|
54
|
-
*/
|
|
55
|
-
private sendMessage;
|
|
56
|
-
/**
|
|
57
|
-
* Generate a unique subscription ID
|
|
58
|
-
*
|
|
59
|
-
* @returns Unique subscription ID
|
|
60
|
-
*/
|
|
61
|
-
private generateSubscriptionId;
|
|
62
|
-
/**
|
|
63
|
-
* Subscribe to orderbook updates for a specific market
|
|
64
|
-
*
|
|
65
|
-
* @param market - Market symbol (e.g., "BTCUSDC")
|
|
66
|
-
* @param callback - Callback function to handle updates
|
|
67
|
-
* @returns Subscription ID
|
|
68
|
-
*/
|
|
69
|
-
subscribeToOrderbook(market: string, callback: (data: OrderbookData) => void): string;
|
|
70
|
-
/**
|
|
71
|
-
* Subscribe to trade updates for a specific market
|
|
72
|
-
*
|
|
73
|
-
* @param market - Market symbol (e.g., "BTCUSDC")
|
|
74
|
-
* @param callback - Callback function to handle updates
|
|
75
|
-
* @returns Subscription ID
|
|
76
|
-
*/
|
|
77
|
-
subscribeToTrades(market: string, callback: (data: Trade[]) => void): string;
|
|
78
|
-
/**
|
|
79
|
-
* Subscribe to user updates for a specific account
|
|
80
|
-
*
|
|
81
|
-
* @param accountId - Account ID
|
|
82
|
-
* @param callback - Callback function to handle updates
|
|
83
|
-
* @returns Subscription ID
|
|
84
|
-
*/
|
|
85
|
-
subscribeToUserUpdates(accountId: number, callback: (data: any) => void): string;
|
|
86
|
-
/**
|
|
87
|
-
* Unsubscribe from a subscription
|
|
88
|
-
*
|
|
89
|
-
* @param subscriptionId - Subscription ID to unsubscribe from
|
|
90
|
-
* @returns Whether the unsubscription was successful
|
|
91
|
-
*/
|
|
92
|
-
unsubscribe(subscriptionId: string): boolean;
|
|
93
|
-
}
|
package/dist/websocket/client.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* WebSocket client for real-time data
|
|
4
|
-
* @module websocket/client
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.WebSocketClient = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* WebSocket client for real-time data
|
|
10
|
-
*/
|
|
11
|
-
class WebSocketClient {
|
|
12
|
-
/**
|
|
13
|
-
* Create a new WebSocket client
|
|
14
|
-
*
|
|
15
|
-
* @param baseUrl - Base URL for the WebSocket server
|
|
16
|
-
*/
|
|
17
|
-
constructor(baseUrl) {
|
|
18
|
-
/**
|
|
19
|
-
* WebSocket connection
|
|
20
|
-
*/
|
|
21
|
-
this.ws = null;
|
|
22
|
-
/**
|
|
23
|
-
* Map of subscription IDs to callbacks
|
|
24
|
-
*/
|
|
25
|
-
this.subscriptions = new Map();
|
|
26
|
-
/**
|
|
27
|
-
* Whether the WebSocket is connected
|
|
28
|
-
*/
|
|
29
|
-
this.connected = false;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the WebSocket is connecting
|
|
32
|
-
*/
|
|
33
|
-
this.connecting = false;
|
|
34
|
-
/**
|
|
35
|
-
* Queue of messages to send when connected
|
|
36
|
-
*/
|
|
37
|
-
this.messageQueue = [];
|
|
38
|
-
// Convert HTTP/HTTPS to WS/WSS
|
|
39
|
-
this.baseUrl = baseUrl.replace(/^http/, 'ws') + '/ws';
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Connect to the WebSocket server
|
|
43
|
-
*
|
|
44
|
-
* @returns Promise that resolves when connected
|
|
45
|
-
*/
|
|
46
|
-
connect() {
|
|
47
|
-
if (this.connected) {
|
|
48
|
-
return Promise.resolve();
|
|
49
|
-
}
|
|
50
|
-
if (this.connecting) {
|
|
51
|
-
return new Promise((resolve) => {
|
|
52
|
-
// Check connection status every 100ms
|
|
53
|
-
const interval = setInterval(() => {
|
|
54
|
-
if (this.connected) {
|
|
55
|
-
clearInterval(interval);
|
|
56
|
-
resolve();
|
|
57
|
-
}
|
|
58
|
-
}, 100);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
this.connecting = true;
|
|
62
|
-
return new Promise((resolve, reject) => {
|
|
63
|
-
try {
|
|
64
|
-
this.ws = new WebSocket(this.baseUrl);
|
|
65
|
-
this.ws.onopen = () => {
|
|
66
|
-
this.connected = true;
|
|
67
|
-
this.connecting = false;
|
|
68
|
-
// Send queued messages
|
|
69
|
-
while (this.messageQueue.length > 0) {
|
|
70
|
-
const message = this.messageQueue.shift();
|
|
71
|
-
if (message && this.ws) {
|
|
72
|
-
this.ws.send(message);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
resolve();
|
|
76
|
-
};
|
|
77
|
-
this.ws.onclose = () => {
|
|
78
|
-
this.connected = false;
|
|
79
|
-
this.ws = null;
|
|
80
|
-
// Attempt to reconnect after 5 seconds
|
|
81
|
-
setTimeout(() => {
|
|
82
|
-
if (!this.connected && !this.connecting) {
|
|
83
|
-
this.connect();
|
|
84
|
-
}
|
|
85
|
-
}, 5000);
|
|
86
|
-
};
|
|
87
|
-
this.ws.onerror = (error) => {
|
|
88
|
-
if (!this.connected) {
|
|
89
|
-
this.connecting = false;
|
|
90
|
-
reject(error);
|
|
91
|
-
}
|
|
92
|
-
console.error('WebSocket error:', error);
|
|
93
|
-
};
|
|
94
|
-
this.ws.onmessage = (event) => {
|
|
95
|
-
try {
|
|
96
|
-
const data = JSON.parse(event.data);
|
|
97
|
-
// Handle subscription updates
|
|
98
|
-
if (data.type === 'update' && data.subscriptionId && this.subscriptions.has(data.subscriptionId)) {
|
|
99
|
-
const callback = this.subscriptions.get(data.subscriptionId);
|
|
100
|
-
if (callback) {
|
|
101
|
-
callback(data.data);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
console.error('Error processing WebSocket message:', error);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
this.connecting = false;
|
|
112
|
-
reject(error);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Disconnect from the WebSocket server
|
|
118
|
-
*/
|
|
119
|
-
disconnect() {
|
|
120
|
-
if (this.ws) {
|
|
121
|
-
this.ws.close();
|
|
122
|
-
this.ws = null;
|
|
123
|
-
this.connected = false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Send a message to the WebSocket server
|
|
128
|
-
*
|
|
129
|
-
* @param message - Message to send
|
|
130
|
-
*/
|
|
131
|
-
sendMessage(message) {
|
|
132
|
-
const messageStr = JSON.stringify(message);
|
|
133
|
-
if (this.connected && this.ws) {
|
|
134
|
-
this.ws.send(messageStr);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
// Queue message to send when connected
|
|
138
|
-
this.messageQueue.push(messageStr);
|
|
139
|
-
this.connect();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Generate a unique subscription ID
|
|
144
|
-
*
|
|
145
|
-
* @returns Unique subscription ID
|
|
146
|
-
*/
|
|
147
|
-
generateSubscriptionId() {
|
|
148
|
-
return Math.random().toString(36).substring(2, 15);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Subscribe to orderbook updates for a specific market
|
|
152
|
-
*
|
|
153
|
-
* @param market - Market symbol (e.g., "BTCUSDC")
|
|
154
|
-
* @param callback - Callback function to handle updates
|
|
155
|
-
* @returns Subscription ID
|
|
156
|
-
*/
|
|
157
|
-
subscribeToOrderbook(market, callback) {
|
|
158
|
-
const subscriptionId = this.generateSubscriptionId();
|
|
159
|
-
this.subscriptions.set(subscriptionId, callback);
|
|
160
|
-
this.sendMessage({
|
|
161
|
-
type: 'subscribe',
|
|
162
|
-
channel: 'orderbook',
|
|
163
|
-
market,
|
|
164
|
-
subscriptionId
|
|
165
|
-
});
|
|
166
|
-
return subscriptionId;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Subscribe to trade updates for a specific market
|
|
170
|
-
*
|
|
171
|
-
* @param market - Market symbol (e.g., "BTCUSDC")
|
|
172
|
-
* @param callback - Callback function to handle updates
|
|
173
|
-
* @returns Subscription ID
|
|
174
|
-
*/
|
|
175
|
-
subscribeToTrades(market, callback) {
|
|
176
|
-
const subscriptionId = this.generateSubscriptionId();
|
|
177
|
-
this.subscriptions.set(subscriptionId, callback);
|
|
178
|
-
this.sendMessage({
|
|
179
|
-
type: 'subscribe',
|
|
180
|
-
channel: 'trades',
|
|
181
|
-
market,
|
|
182
|
-
subscriptionId
|
|
183
|
-
});
|
|
184
|
-
return subscriptionId;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Subscribe to user updates for a specific account
|
|
188
|
-
*
|
|
189
|
-
* @param accountId - Account ID
|
|
190
|
-
* @param callback - Callback function to handle updates
|
|
191
|
-
* @returns Subscription ID
|
|
192
|
-
*/
|
|
193
|
-
subscribeToUserUpdates(accountId, callback) {
|
|
194
|
-
const subscriptionId = this.generateSubscriptionId();
|
|
195
|
-
this.subscriptions.set(subscriptionId, callback);
|
|
196
|
-
this.sendMessage({
|
|
197
|
-
type: 'subscribe',
|
|
198
|
-
channel: 'user',
|
|
199
|
-
accountId,
|
|
200
|
-
subscriptionId
|
|
201
|
-
});
|
|
202
|
-
return subscriptionId;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Unsubscribe from a subscription
|
|
206
|
-
*
|
|
207
|
-
* @param subscriptionId - Subscription ID to unsubscribe from
|
|
208
|
-
* @returns Whether the unsubscription was successful
|
|
209
|
-
*/
|
|
210
|
-
unsubscribe(subscriptionId) {
|
|
211
|
-
if (!this.subscriptions.has(subscriptionId)) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
this.subscriptions.delete(subscriptionId);
|
|
215
|
-
this.sendMessage({
|
|
216
|
-
type: 'unsubscribe',
|
|
217
|
-
subscriptionId
|
|
218
|
-
});
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
exports.WebSocketClient = WebSocketClient;
|
package/dist/websocket.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "events";
|
|
2
|
-
import { WebSocketTradeUpdate, WebSocketDeltaUpdate, WebSocketUserUpdate } from "./types";
|
|
3
|
-
export declare class NordWebSocketClient extends EventEmitter {
|
|
4
|
-
private ws;
|
|
5
|
-
private url;
|
|
6
|
-
private subscriptions;
|
|
7
|
-
private reconnectAttempts;
|
|
8
|
-
private maxReconnectAttempts;
|
|
9
|
-
private reconnectDelay;
|
|
10
|
-
private pingInterval;
|
|
11
|
-
private pingTimeout;
|
|
12
|
-
constructor(url: string);
|
|
13
|
-
/**
|
|
14
|
-
* Validate stream format
|
|
15
|
-
* @param stream Stream identifier to validate
|
|
16
|
-
* @throws Error if stream format is invalid
|
|
17
|
-
*/
|
|
18
|
-
private validateStream;
|
|
19
|
-
/**
|
|
20
|
-
* Setup WebSocket ping/pong heartbeat
|
|
21
|
-
*/
|
|
22
|
-
private setupHeartbeat;
|
|
23
|
-
/**
|
|
24
|
-
* Connect to the Nord WebSocket server
|
|
25
|
-
*/
|
|
26
|
-
connect(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Subscribe to one or more streams
|
|
29
|
-
* @param streams Array of streams to subscribe to (e.g. ["trades@BTCUSDC", "deltas@BTCUSDC"])
|
|
30
|
-
*/
|
|
31
|
-
subscribe(streams: string[]): void;
|
|
32
|
-
/**
|
|
33
|
-
* Unsubscribe from one or more streams
|
|
34
|
-
* @param streams Array of streams to unsubscribe from
|
|
35
|
-
*/
|
|
36
|
-
unsubscribe(streams: string[]): void;
|
|
37
|
-
/**
|
|
38
|
-
* Close the WebSocket connection
|
|
39
|
-
*/
|
|
40
|
-
close(): void;
|
|
41
|
-
private handleMessage;
|
|
42
|
-
private reconnect;
|
|
43
|
-
}
|
|
44
|
-
export interface NordWebSocketEvents {
|
|
45
|
-
connected: () => void;
|
|
46
|
-
disconnected: () => void;
|
|
47
|
-
error: (error: Error) => void;
|
|
48
|
-
trade: (update: WebSocketTradeUpdate) => void;
|
|
49
|
-
delta: (update: WebSocketDeltaUpdate) => void;
|
|
50
|
-
user: (update: WebSocketUserUpdate) => void;
|
|
51
|
-
}
|
|
52
|
-
export declare interface NordWebSocketClient {
|
|
53
|
-
on<E extends keyof NordWebSocketEvents>(event: E, listener: NordWebSocketEvents[E]): this;
|
|
54
|
-
emit<E extends keyof NordWebSocketEvents>(event: E, ...args: Parameters<NordWebSocketEvents[E]>): boolean;
|
|
55
|
-
}
|
package/dist/websocket.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NordWebSocketClient = void 0;
|
|
7
|
-
const ws_1 = __importDefault(require("ws"));
|
|
8
|
-
const events_1 = require("events");
|
|
9
|
-
const types_1 = require("./types");
|
|
10
|
-
const VALID_STREAM_TYPES = ["trades", "deltas", "user"];
|
|
11
|
-
class NordWebSocketClient extends events_1.EventEmitter {
|
|
12
|
-
constructor(url) {
|
|
13
|
-
super();
|
|
14
|
-
this.ws = null;
|
|
15
|
-
this.subscriptions = new Set();
|
|
16
|
-
this.reconnectAttempts = 0;
|
|
17
|
-
this.maxReconnectAttempts = 5;
|
|
18
|
-
this.reconnectDelay = 1000;
|
|
19
|
-
this.pingInterval = null;
|
|
20
|
-
this.pingTimeout = null;
|
|
21
|
-
this.url = url;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Validate stream format
|
|
25
|
-
* @param stream Stream identifier to validate
|
|
26
|
-
* @throws Error if stream format is invalid
|
|
27
|
-
*/
|
|
28
|
-
validateStream(stream) {
|
|
29
|
-
const [type, params] = stream.split("@");
|
|
30
|
-
if (!type || !params) {
|
|
31
|
-
throw new Error(`Invalid stream format: ${stream}. Expected format: <type>@<params>`);
|
|
32
|
-
}
|
|
33
|
-
if (!VALID_STREAM_TYPES.includes(type)) {
|
|
34
|
-
throw new Error(`Invalid stream type: ${type}. Valid types are: ${VALID_STREAM_TYPES.join(", ")}`);
|
|
35
|
-
}
|
|
36
|
-
if (type === "user" && !/^\d+$/.test(params)) {
|
|
37
|
-
throw new Error(`Invalid user ID in stream: ${params}. Expected numeric ID`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Setup WebSocket ping/pong heartbeat
|
|
42
|
-
*/
|
|
43
|
-
setupHeartbeat() {
|
|
44
|
-
if (this.pingInterval) {
|
|
45
|
-
clearInterval(this.pingInterval);
|
|
46
|
-
}
|
|
47
|
-
if (this.pingTimeout) {
|
|
48
|
-
clearTimeout(this.pingTimeout);
|
|
49
|
-
}
|
|
50
|
-
this.pingInterval = setInterval(() => {
|
|
51
|
-
if (this.ws?.readyState === ws_1.default.OPEN) {
|
|
52
|
-
this.ws.ping();
|
|
53
|
-
// Set timeout for pong response
|
|
54
|
-
this.pingTimeout = setTimeout(() => {
|
|
55
|
-
this.emit("error", new Error("WebSocket ping timeout"));
|
|
56
|
-
this.close();
|
|
57
|
-
this.reconnect();
|
|
58
|
-
}, 5000); // 5 second timeout
|
|
59
|
-
}
|
|
60
|
-
}, 30000); // Send ping every 30 seconds
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Connect to the Nord WebSocket server
|
|
64
|
-
*/
|
|
65
|
-
connect() {
|
|
66
|
-
if (this.ws) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.ws = new ws_1.default(this.url);
|
|
70
|
-
this.ws.on("open", () => {
|
|
71
|
-
this.emit("connected");
|
|
72
|
-
this.reconnectAttempts = 0;
|
|
73
|
-
this.reconnectDelay = 1000;
|
|
74
|
-
this.setupHeartbeat();
|
|
75
|
-
// Resubscribe to previous subscriptions
|
|
76
|
-
if (this.subscriptions.size > 0) {
|
|
77
|
-
this.subscribe([...this.subscriptions]);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
this.ws.on("message", (data) => {
|
|
81
|
-
try {
|
|
82
|
-
const message = JSON.parse(data.toString());
|
|
83
|
-
this.handleMessage(message);
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
this.emit("error", new Error(`Failed to parse message: ${error}`));
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
this.ws.on("close", () => {
|
|
90
|
-
this.emit("disconnected");
|
|
91
|
-
if (this.pingInterval) {
|
|
92
|
-
clearInterval(this.pingInterval);
|
|
93
|
-
}
|
|
94
|
-
if (this.pingTimeout) {
|
|
95
|
-
clearTimeout(this.pingTimeout);
|
|
96
|
-
}
|
|
97
|
-
this.reconnect();
|
|
98
|
-
});
|
|
99
|
-
this.ws.on("error", (error) => {
|
|
100
|
-
this.emit("error", error);
|
|
101
|
-
});
|
|
102
|
-
this.ws.on("pong", () => {
|
|
103
|
-
if (this.pingTimeout) {
|
|
104
|
-
clearTimeout(this.pingTimeout);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Subscribe to one or more streams
|
|
110
|
-
* @param streams Array of streams to subscribe to (e.g. ["trades@BTCUSDC", "deltas@BTCUSDC"])
|
|
111
|
-
*/
|
|
112
|
-
subscribe(streams) {
|
|
113
|
-
// Validate all streams first
|
|
114
|
-
try {
|
|
115
|
-
streams.forEach(stream => this.validateStream(stream));
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
this.emit("error", error instanceof Error ? error : new Error(String(error)));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (!this.ws || this.ws.readyState !== ws_1.default.OPEN) {
|
|
122
|
-
streams.forEach(stream => this.subscriptions.add(stream));
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const message = {
|
|
126
|
-
type: types_1.WebSocketMessageType.Subscribe,
|
|
127
|
-
streams,
|
|
128
|
-
};
|
|
129
|
-
try {
|
|
130
|
-
this.ws.send(JSON.stringify(message));
|
|
131
|
-
streams.forEach(stream => this.subscriptions.add(stream));
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
this.emit("error", error instanceof Error ? error : new Error(String(error)));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Unsubscribe from one or more streams
|
|
139
|
-
* @param streams Array of streams to unsubscribe from
|
|
140
|
-
*/
|
|
141
|
-
unsubscribe(streams) {
|
|
142
|
-
// Validate all streams first
|
|
143
|
-
try {
|
|
144
|
-
streams.forEach(stream => this.validateStream(stream));
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
this.emit("error", error instanceof Error ? error : new Error(String(error)));
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (!this.ws || this.ws.readyState !== ws_1.default.OPEN) {
|
|
151
|
-
streams.forEach(stream => this.subscriptions.delete(stream));
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const message = {
|
|
155
|
-
type: types_1.WebSocketMessageType.Unsubscribe,
|
|
156
|
-
streams,
|
|
157
|
-
};
|
|
158
|
-
try {
|
|
159
|
-
this.ws.send(JSON.stringify(message));
|
|
160
|
-
streams.forEach(stream => this.subscriptions.delete(stream));
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
this.emit("error", error instanceof Error ? error : new Error(String(error)));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Close the WebSocket connection
|
|
168
|
-
*/
|
|
169
|
-
close() {
|
|
170
|
-
if (this.ws) {
|
|
171
|
-
this.ws.close();
|
|
172
|
-
this.ws = null;
|
|
173
|
-
}
|
|
174
|
-
if (this.pingInterval) {
|
|
175
|
-
clearInterval(this.pingInterval);
|
|
176
|
-
this.pingInterval = null;
|
|
177
|
-
}
|
|
178
|
-
if (this.pingTimeout) {
|
|
179
|
-
clearTimeout(this.pingTimeout);
|
|
180
|
-
this.pingTimeout = null;
|
|
181
|
-
}
|
|
182
|
-
this.subscriptions.clear();
|
|
183
|
-
}
|
|
184
|
-
handleMessage(message) {
|
|
185
|
-
switch (message.type) {
|
|
186
|
-
case types_1.WebSocketMessageType.TradeUpdate:
|
|
187
|
-
this.emit("trade", message);
|
|
188
|
-
break;
|
|
189
|
-
case types_1.WebSocketMessageType.DeltaUpdate:
|
|
190
|
-
this.emit("delta", message);
|
|
191
|
-
break;
|
|
192
|
-
case types_1.WebSocketMessageType.UserUpdate:
|
|
193
|
-
this.emit("user", message);
|
|
194
|
-
break;
|
|
195
|
-
default:
|
|
196
|
-
this.emit("error", new Error(`Unknown message type: ${message.type}`));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
reconnect() {
|
|
200
|
-
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
201
|
-
this.emit("error", new Error("Max reconnection attempts reached"));
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
setTimeout(() => {
|
|
205
|
-
this.reconnectAttempts++;
|
|
206
|
-
this.reconnectDelay *= 2; // Exponential backoff
|
|
207
|
-
this.connect();
|
|
208
|
-
}, this.reconnectDelay);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
exports.NordWebSocketClient = NordWebSocketClient;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ERC20TokenInfo | @layer-n/nord-ts</title><meta name="description" content="Documentation for @layer-n/nord-ts"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@layer-n/nord-ts</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@layer-n/nord-ts</a></li><li><a href="ERC20TokenInfo.html">ERC20TokenInfo</a></li></ul><h1>Interface ERC20TokenInfo</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">ERC20TokenInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="ERC20TokenInfo.html#address">address</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="ERC20TokenInfo.html#name">name</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="ERC20TokenInfo.html#precision">precision</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="ERC20TokenInfo.html#tokenId">tokenId</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/types.ts#L27">types.ts:27</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="ERC20TokenInfo.html#address" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>address</span></a>
|
|
2
|
-
<a href="ERC20TokenInfo.html#name" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a>
|
|
3
|
-
<a href="ERC20TokenInfo.html#precision" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>precision</span></a>
|
|
4
|
-
<a href="ERC20TokenInfo.html#tokenId" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>token<wbr/>Id</span></a>
|
|
5
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member"><a id="address" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>address</span><a href="#address" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">address</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/types.ts#L28">types.ts:28</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="name" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/types.ts#L31">types.ts:31</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="precision" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>precision</span><a href="#precision" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">precision</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/types.ts#L29">types.ts:29</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="tokenId" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>token<wbr/>Id</span><a href="#tokenId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">token<wbr/>Id</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/types.ts#L30">types.ts:30</a></li></ul></aside></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#address" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>address</span></a><a href="#name" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a><a href="#precision" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>precision</span></a><a href="#tokenId" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>token<wbr/>Id</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@layer-n/nord-ts</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DEV_CONTRACT_ADDRESS | @layer-n/nord-ts</title><meta name="description" content="Documentation for @layer-n/nord-ts"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@layer-n/nord-ts</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@layer-n/nord-ts</a></li><li><a href="DEV_CONTRACT_ADDRESS.html">DEV_CONTRACT_ADDRESS</a></li></ul><h1>Variable DEV_CONTRACT_ADDRESS<code class="tsd-tag ts-flagConst">Const</code> </h1></div><div class="tsd-signature"><span class="tsd-kind-variable">DEV_<wbr/>CONTRACT_<wbr/>ADDRESS</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"0x8a791620dd6260079bf849dc5567adc3f2fdc318"</span><span class="tsd-signature-symbol"> = "0x8a791620dd6260079bf849dc5567adc3f2fdc318"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/c4f7fa8a/ts/src/const.ts#L23">const.ts:23</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@layer-n/nord-ts</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div></body></html>
|