@liquidium/client 0.8.2 → 0.8.3
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/index.cjs +37 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1265,6 +1265,8 @@ var AccountsModule = class {
|
|
|
1265
1265
|
*
|
|
1266
1266
|
* @param options - `account` is the wallet address that will own the new profile.
|
|
1267
1267
|
* @returns A signable {@link CreateAccountAction} with `submit` wired to the canister.
|
|
1268
|
+
* @throws {@link LiquidiumError} If account validation or protocol
|
|
1269
|
+
* preparation fails.
|
|
1268
1270
|
*/
|
|
1269
1271
|
async prepareCreateProfile(options) {
|
|
1270
1272
|
return await this.buildCreateProfileAction(options.account);
|
|
@@ -1276,6 +1278,9 @@ var AccountsModule = class {
|
|
|
1276
1278
|
*
|
|
1277
1279
|
* @param params - Wallet `account`, signing `chain`, and `walletAdapter` with `signMessage`.
|
|
1278
1280
|
* @returns The new profile principal as text.
|
|
1281
|
+
* @throws {@link LiquidiumError} If SDK validation or protocol submission
|
|
1282
|
+
* fails.
|
|
1283
|
+
* @throws `Error` If the wallet adapter rejects message signing.
|
|
1279
1284
|
*/
|
|
1280
1285
|
async createProfile(params) {
|
|
1281
1286
|
const account = normalizeProfileAccount(params.account);
|
|
@@ -1560,6 +1565,7 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1560
1565
|
});
|
|
1561
1566
|
const SimpleLoansError = IDL.Variant({
|
|
1562
1567
|
BorrowAmountRequired: IDL.Null,
|
|
1568
|
+
AnonymousPrincipalNotAllowed: IDL.Null,
|
|
1563
1569
|
NoCollateralPosition: IDL.Record({ loan_id: IDL.Nat }),
|
|
1564
1570
|
LtvTimerOutOfRange: IDL.Record({ max: IDL.Nat64 }),
|
|
1565
1571
|
LtvMaxExceeded: IDL.Record({
|
|
@@ -1573,6 +1579,11 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1573
1579
|
CallRejected: IDL.Record({ method: IDL.Text, reason: IDL.Text }),
|
|
1574
1580
|
DecodeFailed: IDL.Record({ method: IDL.Text, reason: IDL.Text })
|
|
1575
1581
|
}),
|
|
1582
|
+
PoolNotFound: IDL.Record({ pool_id: IDL.Principal }),
|
|
1583
|
+
LendingCanisterImmutable: IDL.Record({
|
|
1584
|
+
requested: IDL.Principal,
|
|
1585
|
+
configured: IDL.Principal
|
|
1586
|
+
}),
|
|
1576
1587
|
LtvMaxOutOfRange: IDL.Record({ max: IDL.Nat64 }),
|
|
1577
1588
|
AccountRequired: IDL.Record({ label: IDL.Text }),
|
|
1578
1589
|
DepositTimerExceeded: IDL.Record({ loan_id: IDL.Nat }),
|
|
@@ -1585,8 +1596,14 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1585
1596
|
DepositAlreadyProcessed: IDL.Record({ loan_id: IDL.Nat }),
|
|
1586
1597
|
MissingPrice: IDL.Record({ symbol: IDL.Text }),
|
|
1587
1598
|
InvalidLtvTimerS: IDL.Null,
|
|
1599
|
+
PoolLendingDisabled: IDL.Record({ pool_id: IDL.Principal }),
|
|
1588
1600
|
DebtNotFullyRepaid: IDL.Record({ loan_id: IDL.Nat }),
|
|
1589
1601
|
EmptyCollateralPosition: IDL.Null,
|
|
1602
|
+
PoolAssetMismatch: IDL.Record({
|
|
1603
|
+
configured_asset: IDL.Unknown,
|
|
1604
|
+
requested_asset: IDL.Unknown,
|
|
1605
|
+
pool_id: IDL.Principal
|
|
1606
|
+
}),
|
|
1590
1607
|
SigningFailed: IDL.Record({ reason: IDL.Text })
|
|
1591
1608
|
});
|
|
1592
1609
|
const CreateLoanRequest = IDL.Record({
|
|
@@ -4793,6 +4810,8 @@ var LendingModule = class {
|
|
|
4793
4810
|
* Use this when you need explicit control over signing and submission.
|
|
4794
4811
|
* @param request - Profile, pool, amount (pool asset base units), outflow address, and signer wallet.
|
|
4795
4812
|
* @returns A signable {@link WithdrawAction} with `submit` wired to the canister.
|
|
4813
|
+
* @throws {@link LiquidiumError} If request validation, destination
|
|
4814
|
+
* validation, or protocol preparation fails.
|
|
4796
4815
|
*/
|
|
4797
4816
|
async prepareWithdraw(request) {
|
|
4798
4817
|
const destination = resolveOutflowDestinationInput({
|
|
@@ -4945,6 +4964,9 @@ var LendingModule = class {
|
|
|
4945
4964
|
*
|
|
4946
4965
|
* @param params - Withdraw request fields plus `signerChain` and `signerWalletAdapter`.
|
|
4947
4966
|
* @returns The canister {@link OutflowDetails} for the completed withdraw.
|
|
4967
|
+
* @throws {@link LiquidiumError} If SDK validation or protocol submission
|
|
4968
|
+
* fails.
|
|
4969
|
+
* @throws `Error` If the wallet adapter rejects message signing.
|
|
4948
4970
|
*/
|
|
4949
4971
|
async withdraw(params) {
|
|
4950
4972
|
const action = await this.prepareWithdraw(params);
|
|
@@ -4963,6 +4985,8 @@ var LendingModule = class {
|
|
|
4963
4985
|
*
|
|
4964
4986
|
* @param request - Profile, pool, amount (borrow asset base units), outflow address, and signer wallet.
|
|
4965
4987
|
* @returns A signable {@link BorrowAction} with `submit` wired to the canister.
|
|
4988
|
+
* @throws {@link LiquidiumError} If request validation, destination
|
|
4989
|
+
* validation, or protocol preparation fails.
|
|
4966
4990
|
*/
|
|
4967
4991
|
async prepareBorrow(request) {
|
|
4968
4992
|
const destination = resolveOutflowDestinationInput({
|
|
@@ -5116,6 +5140,9 @@ var LendingModule = class {
|
|
|
5116
5140
|
*
|
|
5117
5141
|
* @param params - Borrow request fields plus `signerChain` and `signerWalletAdapter`.
|
|
5118
5142
|
* @returns The lending canister receipt as {@link OutflowDetails}.
|
|
5143
|
+
* @throws {@link LiquidiumError} If SDK validation or protocol submission
|
|
5144
|
+
* fails.
|
|
5145
|
+
* @throws `Error` If the wallet adapter rejects message signing.
|
|
5119
5146
|
*
|
|
5120
5147
|
* @remarks
|
|
5121
5148
|
* `id` is always present. `txid` may be missing on the first response; the SDK does not
|
|
@@ -5141,6 +5168,10 @@ var LendingModule = class {
|
|
|
5141
5168
|
*
|
|
5142
5169
|
* @returns A {@link SupplyFlow} receipt with `type`, `target`, `submit`, and
|
|
5143
5170
|
* an optional `txid` present when the SDK broadcast for you.
|
|
5171
|
+
* @throws {@link LiquidiumError} If validation, transfer planning, or
|
|
5172
|
+
* protocol submission fails.
|
|
5173
|
+
* @throws `Error` If the wallet adapter rejects or fails to broadcast a
|
|
5174
|
+
* transaction.
|
|
5144
5175
|
*/
|
|
5145
5176
|
async supply(request) {
|
|
5146
5177
|
return await this.createSupplyFlowExecutor().create(request);
|
|
@@ -5265,6 +5296,8 @@ var LendingModule = class {
|
|
|
5265
5296
|
*
|
|
5266
5297
|
* @param request - Broadcast `txid` plus inflow `operation` and optional `chain`.
|
|
5267
5298
|
* @returns Acknowledgement including the submitted `txid`.
|
|
5299
|
+
* @throws {@link LiquidiumError} If the chain is unsupported or the API
|
|
5300
|
+
* request fails.
|
|
5268
5301
|
*/
|
|
5269
5302
|
async submitInflow(request) {
|
|
5270
5303
|
if (request.chain !== void 0 && request.chain !== Chain.BTC && request.chain !== Chain.ETH) {
|
|
@@ -6571,6 +6604,10 @@ var SimpleLoansModule = class {
|
|
|
6571
6604
|
*
|
|
6572
6605
|
* @param request - Collateral, borrow, refund, LTV limit, timeout, and inflow options.
|
|
6573
6606
|
* @returns Hydrated loan state plus generated initial-deposit and repayment quote targets.
|
|
6607
|
+
* @throws {@link LiquidiumError} If request validation, API transport, or
|
|
6608
|
+
* protocol validation fails before creation.
|
|
6609
|
+
* @throws {@link SimpleLoanCreatedError} If the remote loan is created but
|
|
6610
|
+
* the SDK cannot load its hydrated state.
|
|
6574
6611
|
*/
|
|
6575
6612
|
async create(request) {
|
|
6576
6613
|
validateCreateRequest(request);
|