@nadohq/client 0.1.0-alpha.1 → 0.1.0-alpha.2
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/apis/spot/SpotExecuteAPI.cjs +4 -4
- package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotExecuteAPI.d.cts +3 -3
- package/dist/apis/spot/SpotExecuteAPI.d.ts +3 -3
- package/dist/apis/spot/SpotExecuteAPI.js +4 -4
- package/dist/apis/spot/SpotExecuteAPI.js.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.cjs +3 -3
- package/dist/apis/spot/SpotQueryAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.d.cts +3 -3
- package/dist/apis/spot/SpotQueryAPI.d.ts +3 -3
- package/dist/apis/spot/SpotQueryAPI.js +3 -3
- package/dist/apis/spot/SpotQueryAPI.js.map +1 -1
- package/dist/apis/spot/index.d.cts +1 -1
- package/dist/apis/spot/index.d.ts +1 -1
- package/dist/apis/spot/types.cjs.map +1 -1
- package/dist/apis/spot/types.d.cts +4 -4
- package/dist/apis/spot/types.d.ts +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/apis/spot/SpotExecuteAPI.ts +6 -6
- package/src/apis/spot/SpotQueryAPI.ts +4 -4
- package/src/apis/spot/types.ts +6 -6
|
@@ -70,16 +70,16 @@ var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
|
|
|
70
70
|
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
async
|
|
74
|
-
return this.context.engineClient.
|
|
73
|
+
async mintNlp(params) {
|
|
74
|
+
return this.context.engineClient.mintNlp({
|
|
75
75
|
...params,
|
|
76
76
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
77
77
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
78
78
|
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
async
|
|
82
|
-
return this.context.engineClient.
|
|
81
|
+
async burnNlp(params) {
|
|
82
|
+
return this.context.engineClient.burnNlp({
|
|
83
83
|
...params,
|
|
84
84
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
85
85
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAOO;AACP,mBAAiD;AACjD,yBAA4B;AASrB,IAAM,iBAAN,cAA6B,+BAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,eAAO,oCAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,KAAC,sCAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,eAAO,0CAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,oCAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,OAAG,uBAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nadohq_engine_client from '@nadohq/engine-client';
|
|
2
2
|
import { DepositCollateralParams, MintMockERC20Params } from '@nadohq/contracts';
|
|
3
3
|
import { BaseSpotAPI } from './BaseSpotAPI.cjs';
|
|
4
|
-
import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams,
|
|
4
|
+
import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams } from './types.cjs';
|
|
5
5
|
import '../base.cjs';
|
|
6
6
|
import '../../context.cjs';
|
|
7
7
|
import '@nadohq/indexer-client';
|
|
@@ -20,8 +20,8 @@ declare class SpotExecuteAPI extends BaseSpotAPI {
|
|
|
20
20
|
* @param params
|
|
21
21
|
*/
|
|
22
22
|
transferQuote(params: TransferQuoteParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"transfer_quote">>;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
mintNlp(params: MintNlpParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"mint_nlp">>;
|
|
24
|
+
burnNlp(params: BurnNlpParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"burn_nlp">>;
|
|
25
25
|
_mintMockERC20(params: MintMockERC20Params): Promise<`0x${string}`>;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _nadohq_engine_client from '@nadohq/engine-client';
|
|
2
2
|
import { DepositCollateralParams, MintMockERC20Params } from '@nadohq/contracts';
|
|
3
3
|
import { BaseSpotAPI } from './BaseSpotAPI.js';
|
|
4
|
-
import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams,
|
|
4
|
+
import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams } from './types.js';
|
|
5
5
|
import '../base.js';
|
|
6
6
|
import '../../context.js';
|
|
7
7
|
import '@nadohq/indexer-client';
|
|
@@ -20,8 +20,8 @@ declare class SpotExecuteAPI extends BaseSpotAPI {
|
|
|
20
20
|
* @param params
|
|
21
21
|
*/
|
|
22
22
|
transferQuote(params: TransferQuoteParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"transfer_quote">>;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
mintNlp(params: MintNlpParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"mint_nlp">>;
|
|
24
|
+
burnNlp(params: BurnNlpParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"burn_nlp">>;
|
|
25
25
|
_mintMockERC20(params: MintMockERC20Params): Promise<`0x${string}`>;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -51,16 +51,16 @@ var SpotExecuteAPI = class extends BaseSpotAPI {
|
|
|
51
51
|
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
async
|
|
55
|
-
return this.context.engineClient.
|
|
54
|
+
async mintNlp(params) {
|
|
55
|
+
return this.context.engineClient.mintNlp({
|
|
56
56
|
...params,
|
|
57
57
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
58
58
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
59
59
|
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
async
|
|
63
|
-
return this.context.engineClient.
|
|
62
|
+
async burnNlp(params) {
|
|
63
|
+
return this.context.engineClient.burnNlp({
|
|
64
64
|
...params,
|
|
65
65
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
66
66
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,UAAU,8BAA8B;AACjD,SAAS,mBAAmB;AASrB,IAAM,iBAAN,cAA6B,YAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,WAAO,kBAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,CAAC,oBAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,wBAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,uBAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,GAAG,SAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -34,12 +34,12 @@ var SpotQueryAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
|
|
|
34
34
|
return this.context.engineClient.getMaxWithdrawable(params);
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Queries engine to determine maximum quote amount for minting
|
|
37
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
38
38
|
*
|
|
39
39
|
* @param params
|
|
40
40
|
*/
|
|
41
|
-
async
|
|
42
|
-
return this.context.engineClient.
|
|
41
|
+
async getMaxMintNlpAmount(params) {
|
|
42
|
+
return this.context.engineClient.getMaxMintNlpAmount(params);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAA8D;AAC9D,yBAA4B;AAGrB,IAAM,eAAN,cAA2B,+BAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,KAAC,kCAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,eAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,YACzB,kCAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetEngineMaxWithdrawableParams,
|
|
1
|
+
import { GetEngineMaxWithdrawableParams, GetEngineMaxMintNlpAmountParams } from '@nadohq/engine-client';
|
|
2
2
|
import { BigDecimal } from '@nadohq/utils';
|
|
3
3
|
import { BaseSpotAPI } from './BaseSpotAPI.cjs';
|
|
4
4
|
import { GetTokenWalletBalanceParams, GetTokenAllowanceParams } from './types.cjs';
|
|
@@ -17,11 +17,11 @@ declare class SpotQueryAPI extends BaseSpotAPI {
|
|
|
17
17
|
*/
|
|
18
18
|
getMaxWithdrawable(params: GetEngineMaxWithdrawableParams): Promise<BigDecimal>;
|
|
19
19
|
/**
|
|
20
|
-
* Queries engine to determine maximum quote amount for minting
|
|
20
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
21
21
|
*
|
|
22
22
|
* @param params
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams): Promise<BigDecimal>;
|
|
25
25
|
/**
|
|
26
26
|
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
27
27
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetEngineMaxWithdrawableParams,
|
|
1
|
+
import { GetEngineMaxWithdrawableParams, GetEngineMaxMintNlpAmountParams } from '@nadohq/engine-client';
|
|
2
2
|
import { BigDecimal } from '@nadohq/utils';
|
|
3
3
|
import { BaseSpotAPI } from './BaseSpotAPI.js';
|
|
4
4
|
import { GetTokenWalletBalanceParams, GetTokenAllowanceParams } from './types.js';
|
|
@@ -17,11 +17,11 @@ declare class SpotQueryAPI extends BaseSpotAPI {
|
|
|
17
17
|
*/
|
|
18
18
|
getMaxWithdrawable(params: GetEngineMaxWithdrawableParams): Promise<BigDecimal>;
|
|
19
19
|
/**
|
|
20
|
-
* Queries engine to determine maximum quote amount for minting
|
|
20
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
21
21
|
*
|
|
22
22
|
* @param params
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams): Promise<BigDecimal>;
|
|
25
25
|
/**
|
|
26
26
|
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
27
27
|
*/
|
|
@@ -10,12 +10,12 @@ var SpotQueryAPI = class extends BaseSpotAPI {
|
|
|
10
10
|
return this.context.engineClient.getMaxWithdrawable(params);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Queries engine to determine maximum quote amount for minting
|
|
13
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
14
14
|
*
|
|
15
15
|
* @param params
|
|
16
16
|
*/
|
|
17
|
-
async
|
|
18
|
-
return this.context.engineClient.
|
|
17
|
+
async getMaxMintNlpAmount(params) {
|
|
18
|
+
return this.context.engineClient.getMaxMintNlpAmount(params);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";AAIA,SAAqB,qBAAqB,oBAAoB;AAC9D,SAAS,mBAAmB;AAGrB,IAAM,eAAN,cAA2B,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,CAAC,oBAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,QACzB,oBAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
|
|
2
2
|
import { SpotExecuteAPI } from './SpotExecuteAPI.cjs';
|
|
3
3
|
import { SpotQueryAPI } from './SpotQueryAPI.cjs';
|
|
4
|
-
export { ApproveAllowanceParams,
|
|
4
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.cjs';
|
|
5
5
|
import '@nadohq/engine-client';
|
|
6
6
|
import '@nadohq/contracts';
|
|
7
7
|
import './BaseSpotAPI.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
|
|
2
2
|
import { SpotExecuteAPI } from './SpotExecuteAPI.js';
|
|
3
3
|
import { SpotQueryAPI } from './SpotQueryAPI.js';
|
|
4
|
-
export { ApproveAllowanceParams,
|
|
4
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.js';
|
|
5
5
|
import '@nadohq/engine-client';
|
|
6
6
|
import '@nadohq/contracts';
|
|
7
7
|
import './BaseSpotAPI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/types.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/types.ts"],"sourcesContent":["import {\n EngineBurnNlpParams,\n EngineMintNlpParams,\n EngineTransferQuoteParams,\n EngineWithdrawCollateralParams,\n} from '@nadohq/engine-client';\nimport { BigDecimalish } from '@nadohq/utils';\nimport { OptionalSignatureParams, OptionalSubaccountOwner } from '../types';\n\nexport type ProductIdOrTokenAddress =\n | {\n productId: number;\n }\n | {\n tokenAddress: string;\n };\n\ntype TokenQueryParams = {\n address: string;\n} & ProductIdOrTokenAddress;\n\nexport type ApproveAllowanceParams = ProductIdOrTokenAddress & {\n amount: BigDecimalish;\n};\n\nexport type GetTokenWalletBalanceParams = TokenQueryParams;\n\nexport type GetTokenAllowanceParams = TokenQueryParams;\n\nexport type WithdrawCollateralParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineWithdrawCollateralParams>\n>;\n\nexport type TransferQuoteParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineTransferQuoteParams>\n>;\n\nexport type MintNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineMintNlpParams>\n>;\n\nexport type BurnNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineBurnNlpParams>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EngineWithdrawCollateralParams, EngineTransferQuoteParams,
|
|
1
|
+
import { EngineWithdrawCollateralParams, EngineTransferQuoteParams, EngineMintNlpParams, EngineBurnNlpParams } from '@nadohq/engine-client';
|
|
2
2
|
import { BigDecimalish } from '@nadohq/utils';
|
|
3
3
|
import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.cjs';
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ type GetTokenWalletBalanceParams = TokenQueryParams;
|
|
|
17
17
|
type GetTokenAllowanceParams = TokenQueryParams;
|
|
18
18
|
type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
|
|
19
19
|
type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
|
|
20
|
-
type
|
|
21
|
-
type
|
|
20
|
+
type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
|
|
21
|
+
type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
|
|
22
22
|
|
|
23
|
-
export type { ApproveAllowanceParams,
|
|
23
|
+
export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EngineWithdrawCollateralParams, EngineTransferQuoteParams,
|
|
1
|
+
import { EngineWithdrawCollateralParams, EngineTransferQuoteParams, EngineMintNlpParams, EngineBurnNlpParams } from '@nadohq/engine-client';
|
|
2
2
|
import { BigDecimalish } from '@nadohq/utils';
|
|
3
3
|
import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.js';
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ type GetTokenWalletBalanceParams = TokenQueryParams;
|
|
|
17
17
|
type GetTokenAllowanceParams = TokenQueryParams;
|
|
18
18
|
type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
|
|
19
19
|
type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
|
|
20
|
-
type
|
|
21
|
-
type
|
|
20
|
+
type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
|
|
21
|
+
type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
|
|
22
22
|
|
|
23
|
-
export type { ApproveAllowanceParams,
|
|
23
|
+
export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
package/dist/index.d.cts
CHANGED
|
@@ -11,7 +11,7 @@ export * from '@nadohq/engine-client';
|
|
|
11
11
|
export * from '@nadohq/indexer-client';
|
|
12
12
|
export * from '@nadohq/trigger-client';
|
|
13
13
|
export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams } from './apis/market/types.cjs';
|
|
14
|
-
export { ApproveAllowanceParams,
|
|
14
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './apis/spot/types.cjs';
|
|
15
15
|
export { CreateStandardLinkedSignerResult, LinkSignerParams, LiquidateSubaccountParams } from './apis/subaccount/types.cjs';
|
|
16
16
|
import './apis/ws/index.cjs';
|
|
17
17
|
import './apis/base.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export * from '@nadohq/engine-client';
|
|
|
11
11
|
export * from '@nadohq/indexer-client';
|
|
12
12
|
export * from '@nadohq/trigger-client';
|
|
13
13
|
export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams } from './apis/market/types.js';
|
|
14
|
-
export { ApproveAllowanceParams,
|
|
14
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './apis/spot/types.js';
|
|
15
15
|
export { CreateStandardLinkedSignerResult, LinkSignerParams, LiquidateSubaccountParams } from './apis/subaccount/types.js';
|
|
16
16
|
import './apis/ws/index.js';
|
|
17
17
|
import './apis/base.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "> TODO: description",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nadohq/contracts": "^0.1.0-alpha.
|
|
41
|
-
"@nadohq/engine-client": "^0.1.0-alpha.
|
|
42
|
-
"@nadohq/indexer-client": "^0.1.0-alpha.
|
|
43
|
-
"@nadohq/trigger-client": "^0.1.0-alpha.
|
|
44
|
-
"@nadohq/utils": "^0.1.0-alpha.
|
|
40
|
+
"@nadohq/contracts": "^0.1.0-alpha.2",
|
|
41
|
+
"@nadohq/engine-client": "^0.1.0-alpha.2",
|
|
42
|
+
"@nadohq/indexer-client": "^0.1.0-alpha.2",
|
|
43
|
+
"@nadohq/trigger-client": "^0.1.0-alpha.2",
|
|
44
|
+
"@nadohq/utils": "^0.1.0-alpha.2",
|
|
45
45
|
"ts-mixer": "*"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"viem": "*"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "7ec8ff9383dc6734bb64511b87b0687438d01618"
|
|
54
54
|
}
|
|
@@ -10,8 +10,8 @@ import { toBigInt, WalletNotProvidedError } from '@nadohq/utils';
|
|
|
10
10
|
import { BaseSpotAPI } from './BaseSpotAPI';
|
|
11
11
|
import {
|
|
12
12
|
ApproveAllowanceParams,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
BurnNlpParams,
|
|
14
|
+
MintNlpParams,
|
|
15
15
|
TransferQuoteParams,
|
|
16
16
|
WithdrawCollateralParams,
|
|
17
17
|
} from './types';
|
|
@@ -65,8 +65,8 @@ export class SpotExecuteAPI extends BaseSpotAPI {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async
|
|
69
|
-
return this.context.engineClient.
|
|
68
|
+
async mintNlp(params: MintNlpParams) {
|
|
69
|
+
return this.context.engineClient.mintNlp({
|
|
70
70
|
...params,
|
|
71
71
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
72
72
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
@@ -74,8 +74,8 @@ export class SpotExecuteAPI extends BaseSpotAPI {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
async
|
|
78
|
-
return this.context.engineClient.
|
|
77
|
+
async burnNlp(params: BurnNlpParams) {
|
|
78
|
+
return this.context.engineClient.burnNlp({
|
|
79
79
|
...params,
|
|
80
80
|
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
81
81
|
chainId: this.getWalletClientChainIdIfNeeded(params),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
GetEngineMaxMintNlpAmountParams,
|
|
3
3
|
GetEngineMaxWithdrawableParams,
|
|
4
4
|
} from '@nadohq/engine-client';
|
|
5
5
|
import { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/utils';
|
|
@@ -16,12 +16,12 @@ export class SpotQueryAPI extends BaseSpotAPI {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Queries engine to determine maximum quote amount for minting
|
|
19
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
20
20
|
*
|
|
21
21
|
* @param params
|
|
22
22
|
*/
|
|
23
|
-
async
|
|
24
|
-
return this.context.engineClient.
|
|
23
|
+
async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {
|
|
24
|
+
return this.context.engineClient.getMaxMintNlpAmount(params);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
package/src/apis/spot/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
EngineBurnNlpParams,
|
|
3
|
+
EngineMintNlpParams,
|
|
4
4
|
EngineTransferQuoteParams,
|
|
5
5
|
EngineWithdrawCollateralParams,
|
|
6
6
|
} from '@nadohq/engine-client';
|
|
@@ -35,10 +35,10 @@ export type TransferQuoteParams = OptionalSignatureParams<
|
|
|
35
35
|
OptionalSubaccountOwner<EngineTransferQuoteParams>
|
|
36
36
|
>;
|
|
37
37
|
|
|
38
|
-
export type
|
|
39
|
-
OptionalSubaccountOwner<
|
|
38
|
+
export type MintNlpParams = OptionalSignatureParams<
|
|
39
|
+
OptionalSubaccountOwner<EngineMintNlpParams>
|
|
40
40
|
>;
|
|
41
41
|
|
|
42
|
-
export type
|
|
43
|
-
OptionalSubaccountOwner<
|
|
42
|
+
export type BurnNlpParams = OptionalSignatureParams<
|
|
43
|
+
OptionalSubaccountOwner<EngineBurnNlpParams>
|
|
44
44
|
>;
|