@n1xyz/nord-ts 0.0.16 → 0.0.18-8121ed05.0
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.js +45 -6
- package/dist/gen/nord.d.ts +48 -4
- package/dist/gen/nord.js +634 -34
- package/dist/idl/bridge.d.ts +569 -0
- package/dist/idl/bridge.js +8 -0
- package/dist/idl/bridge.json +75 -62
- package/dist/idl/index.d.ts +71 -49
- package/dist/index.d.ts +1 -3
- package/dist/index.js +6 -13
- package/dist/nord/api/actions.d.ts +7 -2
- package/dist/nord/api/actions.js +7 -1
- package/dist/nord/api/core.d.ts +1 -1
- package/dist/nord/api/core.js +3 -3
- package/dist/nord/api/market.js +1 -3
- package/dist/nord/api/queries.js +2 -2
- package/dist/nord/client/Nord.d.ts +9 -14
- package/dist/nord/client/Nord.js +27 -38
- package/dist/nord/client/NordUser.d.ts +7 -23
- package/dist/nord/client/NordUser.js +67 -143
- package/dist/nord/utils/NordError.js +5 -2
- package/dist/types.d.ts +34 -50
- package/dist/utils.d.ts +2 -9
- package/dist/utils.js +13 -18
- package/package.json +17 -18
- package/protoc-generate.sh +0 -0
- package/src/idl/bridge.json +75 -62
- package/src/index.ts +9 -12
- package/src/nord/api/actions.ts +14 -3
- package/src/nord/api/core.ts +4 -2
- package/src/nord/api/market.ts +1 -4
- package/src/nord/api/queries.ts +2 -2
- package/src/nord/client/Nord.ts +45 -50
- package/src/nord/client/NordUser.ts +90 -171
- package/src/nord/utils/NordError.ts +6 -2
- package/src/types.ts +34 -49
- package/src/utils.ts +16 -19
- package/codebase.md +0 -18886
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -92
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1611
- package/docs/classes/Nord.html +0 -189
- package/docs/classes/NordError.html +0 -24
- package/docs/classes/NordUser.html +0 -115
- package/docs/classes/NordWebSocketClient.html +0 -330
- package/docs/classes/SolanaBridgeClient.html +0 -91
- package/docs/classes/Subscriber.html +0 -10
- package/docs/enums/FillMode.html +0 -5
- package/docs/enums/KeyType.html +0 -4
- package/docs/enums/MetricPeriod.html +0 -9
- package/docs/enums/PdaSeedType.html +0 -11
- package/docs/enums/PeakTpsPeriodUnit.html +0 -15
- package/docs/enums/Side.html +0 -3
- package/docs/enums/WebSocketMessageType.html +0 -7
- package/docs/functions/actionQueryRollman.html +0 -6
- package/docs/functions/actionsQueryRollman.html +0 -6
- package/docs/functions/aggregateMetrics-1.html +0 -7
- package/docs/functions/assert.html +0 -1
- package/docs/functions/bigIntToProtoU128.html +0 -4
- package/docs/functions/bridgeToBN.html +0 -5
- package/docs/functions/bufferToHex.html +0 -4
- package/docs/functions/cancelOrder.html +0 -1
- package/docs/functions/checkPubKeyLength.html +0 -1
- package/docs/functions/checkedFetch.html +0 -6
- package/docs/functions/createSession.html +0 -1
- package/docs/functions/decodeLengthDelimited.html +0 -11
- package/docs/functions/encodeLengthDelimited.html +0 -6
- package/docs/functions/fillModeToProtoFillMode.html +0 -5
- package/docs/functions/findMarket.html +0 -1
- package/docs/functions/findPda.html +0 -6
- package/docs/functions/findToken.html +0 -1
- package/docs/functions/fromBN.html +0 -5
- package/docs/functions/getAccount.html +0 -6
- package/docs/functions/getActionNonce.html +0 -5
- package/docs/functions/getCurrentTps.html +0 -6
- package/docs/functions/getInfo.html +0 -5
- package/docs/functions/getLastActionId.html +0 -5
- package/docs/functions/getMedianLatency.html +0 -6
- package/docs/functions/getOrderbook.html +0 -6
- package/docs/functions/getPeakTps.html +0 -6
- package/docs/functions/getTimestamp.html +0 -5
- package/docs/functions/getTotalTransactions.html +0 -5
- package/docs/functions/getTrades.html +0 -6
- package/docs/functions/getUserAccountIds.html +0 -6
- package/docs/functions/hexToBuffer.html +0 -4
- package/docs/functions/initWebSocketClient.html +0 -12
- package/docs/functions/keypairFromPrivateKey.html +0 -4
- package/docs/functions/makeSigningFunction.html +0 -4
- package/docs/functions/makeWalletSignFn.html +0 -6
- package/docs/functions/marketsStats.html +0 -5
- package/docs/functions/optExpect.html +0 -5
- package/docs/functions/optMap.html +0 -5
- package/docs/functions/optUnwrap.html +0 -2
- package/docs/functions/panic.html +0 -1
- package/docs/functions/placeOrder.html +0 -1
- package/docs/functions/queryAction.html +0 -6
- package/docs/functions/queryPrometheus.html +0 -6
- package/docs/functions/queryRecentActions.html +0 -7
- package/docs/functions/revokeSession.html +0 -1
- package/docs/functions/shortenPublicKey.html +0 -5
- package/docs/functions/signAction.html +0 -6
- package/docs/functions/toBN.html +0 -5
- package/docs/functions/toScaledU128.html +0 -8
- package/docs/functions/toScaledU64.html +0 -8
- package/docs/functions/transfer.html +0 -1
- package/docs/functions/withdraw.html +0 -1
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -40
- package/docs/interfaces/Account.html +0 -8
- package/docs/interfaces/ActionInfo.html +0 -8
- package/docs/interfaces/ActionNonceResponse.html +0 -3
- package/docs/interfaces/ActionQuery.html +0 -4
- package/docs/interfaces/ActionResponse.html +0 -8
- package/docs/interfaces/ActionsExtendedInfo.html +0 -10
- package/docs/interfaces/ActionsQuery.html +0 -5
- package/docs/interfaces/ActionsResponse.html +0 -6
- package/docs/interfaces/AggregateMetrics.html +0 -12
- package/docs/interfaces/BlockFacts.html +0 -10
- package/docs/interfaces/BlockQuery.html +0 -6
- package/docs/interfaces/BlockResponse.html +0 -6
- package/docs/interfaces/BlockSummary.html +0 -8
- package/docs/interfaces/BlockSummaryResponse.html +0 -6
- package/docs/interfaces/DeltaEvent.html +0 -6
- package/docs/interfaces/DepositSplParams.html +0 -8
- package/docs/interfaces/Info.html +0 -3
- package/docs/interfaces/Market.html +0 -8
- package/docs/interfaces/MarketStats.html +0 -7
- package/docs/interfaces/MarketsStatsResponse.html +0 -2
- package/docs/interfaces/NordConfig.html +0 -24
- package/docs/interfaces/NordWebSocketClientEvents.html +0 -4
- package/docs/interfaces/NordWebSocketEvents.html +0 -8
- package/docs/interfaces/Order.html +0 -6
- package/docs/interfaces/OrderInfo.html +0 -6
- package/docs/interfaces/OrderbookEntry.html +0 -4
- package/docs/interfaces/OrderbookQuery.html +0 -6
- package/docs/interfaces/OrderbookResponse.html +0 -6
- package/docs/interfaces/OrderbookSubscription.html +0 -159
- package/docs/interfaces/PerpMarketStats.html +0 -5
- package/docs/interfaces/RollmanActionExtendedInfo.html +0 -4
- package/docs/interfaces/RollmanActionInfo.html +0 -4
- package/docs/interfaces/RollmanActionResponse.html +0 -4
- package/docs/interfaces/RollmanActionsResponse.html +0 -2
- package/docs/interfaces/RollmanBlockResponse.html +0 -3
- package/docs/interfaces/SPLTokenInfo.html +0 -10
- package/docs/interfaces/SolanaBridgeConfig.html +0 -12
- package/docs/interfaces/StateFacts.html +0 -10
- package/docs/interfaces/SubscriberConfig.html +0 -3
- package/docs/interfaces/TimestampResponse.html +0 -3
- package/docs/interfaces/Token.html +0 -5
- package/docs/interfaces/TokenInfo.html +0 -6
- package/docs/interfaces/Trade.html +0 -5
- package/docs/interfaces/TradeSubscription.html +0 -159
- package/docs/interfaces/Trades.html +0 -5
- package/docs/interfaces/TradesQuery.html +0 -6
- package/docs/interfaces/TradesResponse.html +0 -7
- package/docs/interfaces/TransferParams.html +0 -8
- package/docs/interfaces/UserAccountIdsQuery.html +0 -3
- package/docs/interfaces/UserAccountIdsResponse.html +0 -3
- package/docs/interfaces/WebSocketAccountUpdate.html +0 -6
- package/docs/interfaces/WebSocketDeltaUpdate.html +0 -9
- package/docs/interfaces/WebSocketSubscription.html +0 -4
- package/docs/interfaces/WebSocketTradeUpdate.html +0 -6
- package/docs/interfaces/WithdrawalClaim.html +0 -14
- package/docs/interfaces/WithdrawalParams.html +0 -8
- package/docs/modules.html +0 -1
- package/docs/types/BigIntValue.html +0 -2
- package/docs/types/SubscriptionPattern.html +0 -4
- package/docs/types/SubscriptionType.html +0 -2
- package/docs/types/WebSocketMessage.html +0 -1
- package/docs/variables/DEBUG_KEYS.html +0 -1
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +0 -1
- package/docs/variables/DEV_TOKEN_INFOS.html +0 -1
- package/docs/variables/DEV_URL.html +0 -1
- package/docs/variables/MAX_BUFFER_LEN.html +0 -1
- package/docs/variables/SESSION_TTL.html +0 -1
- package/docs/variables/WEBSERVER_DEV_URL.html +0 -1
- package/docs/variables/ZERO_DECIMAL.html +0 -1
- package/docs/variables/_private.html +0 -2
- package/idl-generate.sh +0 -4
- package/src/bridge/client.ts +0 -498
- package/src/bridge/const.ts +0 -53
- package/src/bridge/index.ts +0 -6
- package/src/bridge/types.ts +0 -129
- package/src/bridge/utils.ts +0 -140
- package/src/gen/common.ts +0 -297
- package/src/gen/nord.ts +0 -6716
- package/src/idl/index.ts +0 -2
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>queryPrometheus | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="queryPrometheus.html">queryPrometheus</a></li></ul><h1>Function queryPrometheus</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="queryprometheus" class="tsd-anchor"></a><span class="tsd-kind-call-signature">queryPrometheus</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">webServerUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#queryprometheus" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Query Prometheus metrics</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">webServerUrl</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base URL for the Nord web server</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">params</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Prometheus query parameters</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>Query result as a number</p>
|
|
5
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the request fails</p>
|
|
6
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/nord/api/metrics.ts#L238">src/nord/api/metrics.ts:238</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>queryRecentActions | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="queryRecentActions.html">queryRecentActions</a></li></ul><h1>Function queryRecentActions</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="queryrecentactions" class="tsd-anchor"></a><span class="tsd-kind-call-signature">queryRecentActions</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">webServerUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">from</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">to</span><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><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/ActionsResponse.html" class="tsd-signature-type tsd-kind-interface">ActionsResponse</a><span class="tsd-signature-symbol">></span><a href="#queryrecentactions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Query recent actions</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">webServerUrl</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>Base URL for the Nord web server</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">from</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Starting action index</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">to</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Ending action index</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/ActionsResponse.html" class="tsd-signature-type tsd-kind-interface">ActionsResponse</a><span class="tsd-signature-symbol">></span></h4><p>Actions response</p>
|
|
6
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link"><a id="throws" class="tsd-anchor"></a>Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the request fails</p>
|
|
7
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/nord/api/queries.ts#L47">src/nord/api/queries.ts:47</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>revokeSession | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="revokeSession.html">revokeSession</a></li></ul><h1>Function revokeSession</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="revokesession" class="tsd-anchor"></a><span class="tsd-kind-call-signature">revokeSession</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">serverUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">walletSignFn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">currentTimestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">bigint</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">nonce</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#revokesession" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">serverUrl</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">walletSignFn</span>: <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span></li><li><span><span class="tsd-kind-parameter">currentTimestamp</span>: <span class="tsd-signature-type">bigint</span></span></li><li><span><span class="tsd-kind-parameter">nonce</span>: <span class="tsd-signature-type">number</span></span></li><li><span><span class="tsd-kind-parameter">params</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a> <span class="tsd-signature-symbol">}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/nord/api/actions.ts#L172">src/nord/api/actions.ts:172</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>shortenPublicKey | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="shortenPublicKey.html">shortenPublicKey</a></li></ul><h1>Function shortenPublicKey</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="shortenpublickey" class="tsd-anchor"></a><span class="tsd-kind-call-signature">shortenPublicKey</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">publicKey</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">PublicKey</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">chars</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#shortenpublickey" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Shorten a public key for display</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">publicKey</span>: <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">PublicKey</span></span><div class="tsd-comment tsd-typography"><p>Public key to shorten</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">chars</span>: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 4</span></span><div class="tsd-comment tsd-typography"><p>Number of characters to show at the beginning and end</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>Shortened public key</p>
|
|
5
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/bridge/utils.ts#L134">src/bridge/utils.ts:134</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>signAction | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="signAction.html">signAction</a></li></ul><h1>Function signAction</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="signaction" class="tsd-anchor"></a><span class="tsd-kind-call-signature">signAction</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">action</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">sk</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">keyType</span><span class="tsd-signature-symbol">:</span> <a href="../enums/KeyType.html" class="tsd-signature-type tsd-kind-enum">KeyType</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><a href="#signaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Signs an action using the specified secret key and key type.</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">action</span>: <span class="tsd-signature-type">Uint8Array</span></span><div class="tsd-comment tsd-typography"><p>The action data to be signed.</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">sk</span>: <span class="tsd-signature-type">Uint8Array</span></span><div class="tsd-comment tsd-typography"><p>Secret key used for signing the action.</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">keyType</span>: <a href="../enums/KeyType.html" class="tsd-signature-type tsd-kind-enum">KeyType</a></span><div class="tsd-comment tsd-typography"><p>Type of the key used for signing.</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Uint8Array</span></h4><p>A new Uint8Array containing the action followed by its signature.</p>
|
|
6
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/utils.ts#L83">src/utils.ts:83</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/functions/toBN.html
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>toBN | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="toBN.html">toBN</a></li></ul><h1>Function toBN</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="tobn" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toBN</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">amount</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">decimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">BN</span><a href="#tobn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Convert a number to a BN with the specified number of decimals</p>
|
|
2
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">amount</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Amount as a number</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">decimals</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Number of decimal places</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">BN</span></h4><p>Amount as a BN</p>
|
|
5
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/utils.ts#L310">src/utils.ts:310</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>toScaledU128 | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="toScaledU128.html">toScaledU128</a></li></ul><h1>Function toScaledU128</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Converts decimal value into rescaled 128-bit unsigned integer
|
|
2
|
-
by scaling it up by specified number of decimal digits.</p>
|
|
3
|
-
<p>Ensures that number won't accidentally become zero
|
|
4
|
-
or exceed U128's value range</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="toscaledu128" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toScaledU128</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">x</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Value</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">decimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">bigint</span><a href="#toscaledu128" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">Value</span></span><div class="tsd-comment tsd-typography"><p>Decimal value to rescale</p>
|
|
6
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">decimals</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Number of decimal digits</p>
|
|
7
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">bigint</span></h4><p>Rescaled unsigned integer</p>
|
|
8
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/utils.ts#L186">src/utils.ts:186</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>toScaledU64 | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="toScaledU64.html">toScaledU64</a></li></ul><h1>Function toScaledU64</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Converts decimal value into rescaled 64-bit unsigned integer
|
|
2
|
-
by scaling it up by specified number of decimal digits.</p>
|
|
3
|
-
<p>Ensures that number won't accidentally become zero
|
|
4
|
-
or exceed U64's value range</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="toscaledu64" class="tsd-anchor"></a><span class="tsd-kind-call-signature">toScaledU64</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">x</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Value</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">decimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">bigint</span><a href="#toscaledu64" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">x</span>: <span class="tsd-signature-type">Value</span></span><div class="tsd-comment tsd-typography"><p>Decimal value to rescale</p>
|
|
6
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">decimals</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Number of decimal digits</p>
|
|
7
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">bigint</span></h4><p>Rescaled unsigned integer</p>
|
|
8
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/utils.ts#L170">src/utils.ts:170</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>transfer | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="transfer.html">transfer</a></li></ul><h1>Function transfer</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="transfer" class="tsd-anchor"></a><span class="tsd-kind-call-signature">transfer</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">serverUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">signFn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">currentTimestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">bigint</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">nonce</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">amount</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Value</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">fromAccountId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">toAccountId</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenDecimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenId</span><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><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#transfer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">serverUrl</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">signFn</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span></li><li><span><span class="tsd-kind-parameter">currentTimestamp</span>: <span class="tsd-signature-type">bigint</span></span></li><li><span><span class="tsd-kind-parameter">nonce</span>: <span class="tsd-signature-type">number</span></span></li><li><span><span class="tsd-kind-parameter">params</span>: <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">amount</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Value</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">fromAccountId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">toAccountId</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenDecimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenId</span><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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/nord/api/actions.ts#L448">src/nord/api/actions.ts:448</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>withdraw | @n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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">@n1xyz/nord-ts</a></li><li><a href="withdraw.html">withdraw</a></li></ul><h1>Function withdraw</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link"><a id="withdraw" class="tsd-anchor"></a><span class="tsd-kind-call-signature">withdraw</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">serverUrl</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">signFn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">currentTimestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">bigint</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">nonce</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">amount</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sizeDecimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenId</span><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><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#withdraw" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">serverUrl</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">signFn</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ArrayBufferLike</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span></li><li><span><span class="tsd-kind-parameter">currentTimestamp</span>: <span class="tsd-signature-type">bigint</span></span></li><li><span><span class="tsd-kind-parameter">nonce</span>: <span class="tsd-signature-type">number</span></span></li><li><span><span class="tsd-kind-parameter">params</span>: <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">amount</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sessionId</span><span class="tsd-signature-symbol">:</span> <a href="../types/BigIntValue.html" class="tsd-signature-type tsd-kind-type-alias">BigIntValue</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">sizeDecimals</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">tokenId</span><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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/n1xyz/nord/blob/639f599c4c36f1fcc745c0f0e92362164cc8f0a6/ts/src/nord/api/actions.ts#L224">src/nord/api/actions.ts:224</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/hierarchy.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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"><h1>@n1xyz/nord-ts</h1></div><h2>Hierarchy Summary</h2><ul class="tsd-full-hierarchy"><li data-refl="1293"><a id="NordWebSocketClientEvents" class="tsd-anchor"></a><a href="interfaces/NordWebSocketClientEvents.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Interface"><use href="assets/icons.svg#icon-256"></use></svg>NordWebSocketClientEvents</a><ul><li data-refl="1101"><a id="NordWebSocketClient" class="tsd-anchor"></a><a href="classes/NordWebSocketClient.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="assets/icons.svg#icon-128"></use></svg>NordWebSocketClient</a></li></ul></li></ul></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/docs/index.html
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@n1xyz/nord-ts</title><meta name="description" content="Documentation for @n1xyz/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><script async src="assets/hierarchy.js" id="tsd-hierarchy-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"><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" aria-hidden="true"><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">@n1xyz/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" aria-hidden="true"><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"><h1>@n1xyz/nord-ts</h1></div><div class="tsd-panel tsd-typography"><a id="nord-ts" class="tsd-anchor"></a><h1 class="tsd-anchor-link">nord-ts<a href="#nord-ts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>This package provides an interface to interact with the Nord exchange. The core components are <code>Nord</code> and <code>NordUser</code> classes which enable market data access, trading operations, and account management.</p>
|
|
2
|
-
<a id="installation" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Installation<a href="#installation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="bash"><span class="hl-0"># npm</span><br/><span class="hl-1">npm</span><span class="hl-2"> </span><span class="hl-3">install</span><span class="hl-2"> </span><span class="hl-3">nord-ts</span><br/><br/><span class="hl-0"># yarn</span><br/><span class="hl-1">yarn</span><span class="hl-2"> </span><span class="hl-3">add</span><span class="hl-2"> </span><span class="hl-3">nord-ts</span>
|
|
3
|
-
</code><button type="button">Copy</button></pre>
|
|
4
|
-
|
|
5
|
-
<a id="key-components" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Key Components<a href="#key-components" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="nord-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Nord<a href="#nord-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>Nord</code> class is the main entry point for interacting with the Nord exchange:</p>
|
|
6
|
-
<ul>
|
|
7
|
-
<li>Provides market data access (orderbooks, trades, etc.)</li>
|
|
8
|
-
<li>Manages WebSocket connections for real-time updates</li>
|
|
9
|
-
<li>Offers utility methods for timestamp and nonce generation</li>
|
|
10
|
-
</ul>
|
|
11
|
-
<a id="norduser-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link">NordUser<a href="#norduser-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>NordUser</code> class represents a user account on the Nord exchange:</p>
|
|
12
|
-
<ul>
|
|
13
|
-
<li>Handles authentication and session management</li>
|
|
14
|
-
<li>Provides trading functionality (place/cancel orders)</li>
|
|
15
|
-
<li>Manages deposits and withdrawals</li>
|
|
16
|
-
<li>Tracks user balances, positions, and orders</li>
|
|
17
|
-
</ul>
|
|
18
|
-
<a id="usage-examples" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Usage Examples<a href="#usage-examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="initializing-nord" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Initializing Nord<a href="#initializing-nord" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Create a Nord instance</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">nord</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">Nord</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-5">webServerUrl:</span><span class="hl-2"> </span><span class="hl-3">'https://api.nord.exchange'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">bridgeVk:</span><span class="hl-2"> </span><span class="hl-3">'your_bridge_vk'</span><span class="hl-2">, </span><span class="hl-0">// Provide the bridge verification key</span><br/><span class="hl-2"> </span><span class="hl-5">solanaUrl:</span><span class="hl-2"> </span><span class="hl-3">'https://api.mainnet-beta.solana.com'</span><span class="hl-2">,</span><br/><span class="hl-2">});</span><br/><br/><span class="hl-0">// Initialize and fetch market data</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">Nord</span><span class="hl-2">.</span><span class="hl-1">initNord</span><span class="hl-2">(</span><span class="hl-5">nord</span><span class="hl-2">); </span><span class="hl-0">// Initialize client (derives program ID, fetches info)</span>
|
|
19
|
-
</code><button type="button">Copy</button></pre>
|
|
20
|
-
|
|
21
|
-
<a id="creating-a-user-from-private-key" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Creating a User from Private Key<a href="#creating-a-user-from-private-key" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2">, </span><span class="hl-5">NordUser</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Connection</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@solana/web3.js"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Define Nord configuration</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">nordConfig</span><span class="hl-2"> = {</span><br/><span class="hl-2"> </span><span class="hl-5">webServerUrl:</span><span class="hl-2"> </span><span class="hl-3">'https://api.nord.exchange'</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">bridgeVk:</span><span class="hl-2"> </span><span class="hl-3">'your_bridge_vk'</span><span class="hl-2">, </span><span class="hl-0">// Provide the bridge verification key</span><br/><span class="hl-2"> </span><span class="hl-5">solanaUrl:</span><span class="hl-2"> </span><span class="hl-3">'https://api.mainnet-beta.solana.com'</span><span class="hl-2">,</span><br/><span class="hl-2">};</span><br/><br/><span class="hl-0">// Initialize Nord client asynchronously</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">nord</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">Nord</span><span class="hl-2">.</span><span class="hl-1">initNord</span><span class="hl-2">(</span><span class="hl-5">nordConfig</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Optional Solana connection</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">connection</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">Connection</span><span class="hl-2">(</span><span class="hl-3">'https://api.mainnet-beta.solana.com'</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Create user from private key</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">user</span><span class="hl-2"> = </span><span class="hl-5">NordUser</span><span class="hl-2">.</span><span class="hl-1">fromPrivateKey</span><span class="hl-2">(</span><br/><span class="hl-2"> </span><span class="hl-5">nord</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-3">'your_private_key'</span><span class="hl-2">, </span><span class="hl-0">// Can be string or Uint8Array</span><br/><span class="hl-2"> </span><span class="hl-5">connection</span><span class="hl-2"> </span><span class="hl-0">// Optional</span><br/><span class="hl-2">);</span><br/><br/><span class="hl-0">// Fetch user account information</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">updateAccountId</span><span class="hl-2">();</span><br/><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">fetchInfo</span><span class="hl-2">();</span>
|
|
22
|
-
</code><button type="button">Copy</button></pre>
|
|
23
|
-
|
|
24
|
-
<a id="trading-operations" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Trading Operations<a href="#trading-operations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2">, </span><span class="hl-5">NordUser</span><span class="hl-2">, </span><span class="hl-5">Side</span><span class="hl-2">, </span><span class="hl-5">FillMode</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Assuming nord and user are already initialized</span><br/><br/><span class="hl-0">// Place a limit order</span><br/><span class="hl-4">try</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">orderId</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">placeOrder</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-5">marketId:</span><span class="hl-2"> </span><span class="hl-8">0</span><span class="hl-2">, </span><span class="hl-0">// BTC/USDC market</span><br/><span class="hl-2"> </span><span class="hl-5">side:</span><span class="hl-2"> </span><span class="hl-5">Side</span><span class="hl-2">.</span><span class="hl-5">Bid</span><span class="hl-2">, </span><span class="hl-0">// Buy</span><br/><span class="hl-2"> </span><span class="hl-5">fillMode:</span><span class="hl-2"> </span><span class="hl-5">FillMode</span><span class="hl-2">.</span><span class="hl-5">Limit</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">isReduceOnly:</span><span class="hl-2"> </span><span class="hl-6">false</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-5">size:</span><span class="hl-2"> </span><span class="hl-8">0.1</span><span class="hl-2">, </span><span class="hl-0">// 0.1 BTC</span><br/><span class="hl-2"> </span><span class="hl-5">price:</span><span class="hl-2"> </span><span class="hl-8">50000</span><span class="hl-2">, </span><span class="hl-0">// $50,000 per BTC</span><br/><span class="hl-2"> });</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">`Order placed with ID: </span><span class="hl-6">${</span><span class="hl-5">orderId</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-0">// Cancel the order</span><br/><span class="hl-2"> </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">cancelOrder</span><span class="hl-2">(</span><span class="hl-5">orderId</span><span class="hl-2">);</span><br/><span class="hl-2">} </span><span class="hl-4">catch</span><span class="hl-2"> (</span><span class="hl-5">error</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">error</span><span class="hl-2">(</span><span class="hl-3">`Trading error: </span><span class="hl-6">${</span><span class="hl-5">error</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2">}</span>
|
|
25
|
-
</code><button type="button">Copy</button></pre>
|
|
26
|
-
|
|
27
|
-
<a id="deposits-and-withdrawals" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Deposits and Withdrawals<a href="#deposits-and-withdrawals" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2">, </span><span class="hl-5">NordUser</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Assuming nord and user are already initialized</span><br/><br/><span class="hl-0">// Withdraw tokens</span><br/><span class="hl-4">try</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">tokenId</span><span class="hl-2"> = </span><span class="hl-8">0</span><span class="hl-2">; </span><span class="hl-0">// USDC</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">amount</span><span class="hl-2"> = </span><span class="hl-8">100</span><span class="hl-2">; </span><span class="hl-0">// 100 USDC</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">withdraw</span><span class="hl-2">(</span><span class="hl-5">tokenId</span><span class="hl-2">, </span><span class="hl-5">amount</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">`Successfully withdrew </span><span class="hl-6">${</span><span class="hl-5">amount</span><span class="hl-6">}</span><span class="hl-3"> of token ID </span><span class="hl-6">${</span><span class="hl-5">tokenId</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2">} </span><span class="hl-4">catch</span><span class="hl-2"> (</span><span class="hl-5">error</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">error</span><span class="hl-2">(</span><span class="hl-3">`Withdrawal error: </span><span class="hl-6">${</span><span class="hl-5">error</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2">}</span><br/><br/><span class="hl-0">// For Solana SPL tokens</span><br/><span class="hl-4">try</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">tokenId</span><span class="hl-2"> = </span><span class="hl-8">1</span><span class="hl-2">; </span><span class="hl-0">// SOL</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">amount</span><span class="hl-2"> = </span><span class="hl-8">1</span><span class="hl-2">; </span><span class="hl-0">// 1 SOL</span><br/><span class="hl-2"> </span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">txId</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">depositSpl</span><span class="hl-2">(</span><span class="hl-5">amount</span><span class="hl-2">, </span><span class="hl-5">tokenId</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">`Deposit transaction ID: </span><span class="hl-6">${</span><span class="hl-5">txId</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2">} </span><span class="hl-4">catch</span><span class="hl-2"> (</span><span class="hl-5">error</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">error</span><span class="hl-2">(</span><span class="hl-3">`Deposit error: </span><span class="hl-6">${</span><span class="hl-5">error</span><span class="hl-6">}</span><span class="hl-3">`</span><span class="hl-2">);</span><br/><span class="hl-2">}</span>
|
|
28
|
-
</code><button type="button">Copy</button></pre>
|
|
29
|
-
|
|
30
|
-
<a id="market-data" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Market Data<a href="#market-data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Assuming nord is already initialized</span><br/><br/><span class="hl-0">// Get orderbook for a market</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">orderbook</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">nord</span><span class="hl-2">.</span><span class="hl-1">getOrderbook</span><span class="hl-2">({ </span><span class="hl-5">marketId:</span><span class="hl-2"> </span><span class="hl-8">0</span><span class="hl-2"> });</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Bids:'</span><span class="hl-2">, </span><span class="hl-5">orderbook</span><span class="hl-2">.</span><span class="hl-5">bids</span><span class="hl-2">);</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Asks:'</span><span class="hl-2">, </span><span class="hl-5">orderbook</span><span class="hl-2">.</span><span class="hl-5">asks</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Get recent trades</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">trades</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">nord</span><span class="hl-2">.</span><span class="hl-1">getTrades</span><span class="hl-2">({ </span><span class="hl-5">marketId:</span><span class="hl-2"> </span><span class="hl-8">0</span><span class="hl-2">, </span><span class="hl-5">limit:</span><span class="hl-2"> </span><span class="hl-8">10</span><span class="hl-2"> });</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Recent trades:'</span><span class="hl-2">, </span><span class="hl-5">trades</span><span class="hl-2">.</span><span class="hl-5">trades</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Subscribe to real-time orderbook updates</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">orderbookSub</span><span class="hl-2"> = </span><span class="hl-5">nord</span><span class="hl-2">.</span><span class="hl-1">subscribeOrderbook</span><span class="hl-2">(</span><span class="hl-3">'BTC/USDC'</span><span class="hl-2">);</span><br/><span class="hl-5">orderbookSub</span><span class="hl-2">.</span><span class="hl-1">on</span><span class="hl-2">(</span><span class="hl-3">'update'</span><span class="hl-2">, (</span><span class="hl-5">data</span><span class="hl-2">) </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Orderbook update:'</span><span class="hl-2">, </span><span class="hl-5">data</span><span class="hl-2">);</span><br/><span class="hl-2">});</span>
|
|
31
|
-
</code><button type="button">Copy</button></pre>
|
|
32
|
-
|
|
33
|
-
<a id="account-information" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Account Information<a href="#account-information" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Nord</span><span class="hl-2">, </span><span class="hl-5">NordUser</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"nord-ts"</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// Assuming nord and user are already initialized</span><br/><br/><span class="hl-0">// Get account information</span><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-7">accountInfo</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-1">fetchInfo</span><span class="hl-2">();</span><br/><br/><span class="hl-0">// Access user balances</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Balances:'</span><span class="hl-2">, </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-5">balances</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Access user positions</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Positions:'</span><span class="hl-2">, </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-5">positions</span><span class="hl-2">);</span><br/><br/><span class="hl-0">// Access user orders</span><br/><span class="hl-5">console</span><span class="hl-2">.</span><span class="hl-1">log</span><span class="hl-2">(</span><span class="hl-3">'Orders:'</span><span class="hl-2">, </span><span class="hl-5">user</span><span class="hl-2">.</span><span class="hl-5">orders</span><span class="hl-2">);</span>
|
|
34
|
-
</code><button type="button">Copy</button></pre>
|
|
35
|
-
|
|
36
|
-
<a id="development" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Development<a href="#development" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="bash"><span class="hl-0"># Install dependencies</span><br/><span class="hl-1">yarn</span><br/><br/><span class="hl-0"># Build the package</span><br/><span class="hl-1">yarn</span><span class="hl-2"> </span><span class="hl-3">build</span>
|
|
37
|
-
</code><button type="button">Copy</button></pre>
|
|
38
|
-
|
|
39
|
-
<a id="documentation" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Documentation<a href="#documentation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>For more detailed documentation, please refer to the source code and inline comments in the <code>Nord</code> and <code>NordUser</code> classes.</p>
|
|
40
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><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-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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#nord-ts"><span>nord-<wbr/>ts</span></a><ul><li><a href="#installation"><span>Installation</span></a></li><li><a href="#key-components"><span>Key <wbr/>Components</span></a></li><li><ul><li><a href="#nord-1"><span>Nord</span></a></li><li><a href="#norduser-1"><span>Nord<wbr/>User</span></a></li></ul></li><li><a href="#usage-examples"><span>Usage <wbr/>Examples</span></a></li><li><ul><li><a href="#initializing-nord"><span>Initializing <wbr/>Nord</span></a></li><li><a href="#creating-a-user-from-private-key"><span>Creating a <wbr/>User from <wbr/>Private <wbr/>Key</span></a></li><li><a href="#trading-operations"><span>Trading <wbr/>Operations</span></a></li><li><a href="#deposits-and-withdrawals"><span>Deposits and <wbr/>Withdrawals</span></a></li><li><a href="#market-data"><span>Market <wbr/>Data</span></a></li><li><a href="#account-information"><span>Account <wbr/>Information</span></a></li></ul></li><li><a href="#development"><span>Development</span></a></li><li><a href="#documentation"><span>Documentation</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">@n1xyz/nord-ts</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|