@liquidium/client 0.8.0 → 0.8.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/index.cjs +51 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +51 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -352,7 +352,14 @@ var idlFactory = ({ IDL }) => {
|
|
|
352
352
|
"chain": Chains,
|
|
353
353
|
"account": IDL.Text
|
|
354
354
|
});
|
|
355
|
-
const
|
|
355
|
+
const IcpCallerAuth = IDL.Record({
|
|
356
|
+
"principal": IDL.Principal,
|
|
357
|
+
"subaccount": IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
358
|
+
});
|
|
359
|
+
const SignatureScheme = IDL.Variant({
|
|
360
|
+
"Wallet": SignatureInfo,
|
|
361
|
+
"IcpCaller": IcpCallerAuth
|
|
362
|
+
});
|
|
356
363
|
const AddAccountRequest = IDL.Record({
|
|
357
364
|
"target_principal": IDL.Principal,
|
|
358
365
|
"chain": WalletType,
|
|
@@ -365,12 +372,15 @@ var idlFactory = ({ IDL }) => {
|
|
|
365
372
|
});
|
|
366
373
|
const SignatureVerificationError = IDL.Variant({
|
|
367
374
|
"InvalidEthSignature": IDL.Null,
|
|
375
|
+
"IcpCallerMismatch": IDL.Null,
|
|
368
376
|
"UnsupportedChain": IDL.Null,
|
|
369
377
|
"InvalidSolSignature": IDL.Null,
|
|
370
378
|
"InvalidEthAddress": IDL.Null,
|
|
371
379
|
"CouldNotDecode": IDL.Text,
|
|
372
380
|
"ProfileNotFound": IDL.Null,
|
|
373
|
-
"InvalidBtcSignature": IDL.Null
|
|
381
|
+
"InvalidBtcSignature": IDL.Null,
|
|
382
|
+
"AnonymousIcpCaller": IDL.Null,
|
|
383
|
+
"InvalidIcpSubaccount": IDL.Null
|
|
374
384
|
});
|
|
375
385
|
const ProtocolError = IDL.Variant({
|
|
376
386
|
"PositionNotFound": IDL.Null,
|
|
@@ -938,6 +948,18 @@ var LENDING_CANISTER_SIGNATURE_VERIFICATION_ERROR_MAP = {
|
|
|
938
948
|
InvalidBtcSignature: { code: LiquidiumErrorCode.INVALID_BTC_SIGNATURE },
|
|
939
949
|
InvalidEthAddress: { code: LiquidiumErrorCode.INVALID_ETH_ADDRESS },
|
|
940
950
|
UnsupportedChain: { code: LiquidiumErrorCode.UNSUPPORTED_CHAIN },
|
|
951
|
+
AnonymousIcpCaller: {
|
|
952
|
+
code: LiquidiumErrorCode.SIGNATURE_ERROR,
|
|
953
|
+
fallbackMessage: "Anonymous ICP caller"
|
|
954
|
+
},
|
|
955
|
+
InvalidIcpSubaccount: {
|
|
956
|
+
code: LiquidiumErrorCode.SIGNATURE_ERROR,
|
|
957
|
+
fallbackMessage: "Invalid ICP subaccount"
|
|
958
|
+
},
|
|
959
|
+
IcpCallerMismatch: {
|
|
960
|
+
code: LiquidiumErrorCode.SIGNATURE_ERROR,
|
|
961
|
+
fallbackMessage: "ICP caller mismatch"
|
|
962
|
+
},
|
|
941
963
|
ProfileNotFound: { code: LiquidiumErrorCode.PROFILE_NOT_FOUND },
|
|
942
964
|
CouldNotDecode: {
|
|
943
965
|
code: LiquidiumErrorCode.SIGNATURE_ERROR,
|
|
@@ -1503,7 +1525,10 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1503
1525
|
InvalidEthAddress: IDL.Null,
|
|
1504
1526
|
CouldNotDecode: IDL.Text,
|
|
1505
1527
|
ProfileNotFound: IDL.Null,
|
|
1506
|
-
InvalidBtcSignature: IDL.Null
|
|
1528
|
+
InvalidBtcSignature: IDL.Null,
|
|
1529
|
+
AnonymousIcpCaller: IDL.Null,
|
|
1530
|
+
InvalidIcpSubaccount: IDL.Null,
|
|
1531
|
+
IcpCallerMismatch: IDL.Null
|
|
1507
1532
|
});
|
|
1508
1533
|
const ProtocolError = IDL.Variant({
|
|
1509
1534
|
PositionNotFound: IDL.Null,
|
|
@@ -1623,6 +1648,11 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1623
1648
|
eth_address: IDL.Text,
|
|
1624
1649
|
lending_profile: IDL.Principal
|
|
1625
1650
|
}),
|
|
1651
|
+
IcpProfileWarmed: IDL.Record({
|
|
1652
|
+
subaccount: IDL.Vec(IDL.Nat8),
|
|
1653
|
+
warmed_profile_id: IDL.Nat,
|
|
1654
|
+
lending_profile: IDL.Principal
|
|
1655
|
+
}),
|
|
1626
1656
|
RepayComplete: CreateLoanResponse,
|
|
1627
1657
|
DepositTimerStarted: IDL.Record({
|
|
1628
1658
|
loan_id: IDL.Nat,
|
|
@@ -1640,6 +1670,9 @@ var flexibleSimpleLoansIdlFactory = ({ IDL }) => {
|
|
|
1640
1670
|
derivation_index: IDL.Vec(IDL.Nat8),
|
|
1641
1671
|
pubkey: IDL.Vec(IDL.Nat8),
|
|
1642
1672
|
address: IDL.Text
|
|
1673
|
+
}),
|
|
1674
|
+
IcpCaller: IDL.Record({
|
|
1675
|
+
subaccount: IDL.Vec(IDL.Nat8)
|
|
1643
1676
|
})
|
|
1644
1677
|
});
|
|
1645
1678
|
const Loan = IDL.Record({
|
|
@@ -7513,6 +7546,15 @@ function mapSimpleLoanEventType(eventType) {
|
|
|
7513
7546
|
profileId: event.lending_profile.toText()
|
|
7514
7547
|
};
|
|
7515
7548
|
}
|
|
7549
|
+
if ("IcpProfileWarmed" in eventType) {
|
|
7550
|
+
const event = eventType.IcpProfileWarmed;
|
|
7551
|
+
return {
|
|
7552
|
+
type: "IcpProfileWarmed",
|
|
7553
|
+
subaccount: event.subaccount,
|
|
7554
|
+
warmedProfileId: event.warmed_profile_id,
|
|
7555
|
+
profileId: event.lending_profile.toText()
|
|
7556
|
+
};
|
|
7557
|
+
}
|
|
7516
7558
|
if ("RepayComplete" in eventType) {
|
|
7517
7559
|
return {
|
|
7518
7560
|
type: "RepayComplete",
|
|
@@ -7535,6 +7577,12 @@ function mapWarmedProfile(profile) {
|
|
|
7535
7577
|
};
|
|
7536
7578
|
}
|
|
7537
7579
|
function authorizationFromCanister(authorization) {
|
|
7580
|
+
if ("IcpCaller" in authorization) {
|
|
7581
|
+
return {
|
|
7582
|
+
type: "IcpCaller",
|
|
7583
|
+
subaccount: authorization.IcpCaller.subaccount
|
|
7584
|
+
};
|
|
7585
|
+
}
|
|
7538
7586
|
return {
|
|
7539
7587
|
type: "EthSignature",
|
|
7540
7588
|
derivationIndex: authorization.EthSignature.derivation_index,
|