@morpho-org/midnight-sdk 0.1.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/README.md +252 -0
- package/lib/cjs/abis.d.ts +3170 -0
- package/lib/cjs/abis.js +4073 -0
- package/lib/cjs/api/MidnightApi.d.ts +532 -0
- package/lib/cjs/api/MidnightApi.js +713 -0
- package/lib/cjs/api/helpers.d.ts +20 -0
- package/lib/cjs/api/helpers.js +189 -0
- package/lib/cjs/api/index.d.ts +2 -0
- package/lib/cjs/api/index.js +21 -0
- package/lib/cjs/api/types.d.ts +453 -0
- package/lib/cjs/api/types.js +2 -0
- package/lib/cjs/constants.d.ts +168 -0
- package/lib/cjs/constants.js +187 -0
- package/lib/cjs/errors.d.ts +253 -0
- package/lib/cjs/errors.js +309 -0
- package/lib/cjs/fetch/Market.d.ts +65 -0
- package/lib/cjs/fetch/Market.js +117 -0
- package/lib/cjs/fetch/Offer.d.ts +74 -0
- package/lib/cjs/fetch/Offer.js +119 -0
- package/lib/cjs/fetch/Position.d.ts +85 -0
- package/lib/cjs/fetch/Position.js +148 -0
- package/lib/cjs/fetch/Ratifier.d.ts +38 -0
- package/lib/cjs/fetch/Ratifier.js +57 -0
- package/lib/cjs/fetch/index.d.ts +5 -0
- package/lib/cjs/fetch/index.js +21 -0
- package/lib/cjs/fetch/types.d.ts +57 -0
- package/lib/cjs/fetch/types.js +2 -0
- package/lib/cjs/fetch/utils.d.ts +8 -0
- package/lib/cjs/fetch/utils.js +18 -0
- package/lib/cjs/index.d.ts +18 -0
- package/lib/cjs/index.js +57 -0
- package/lib/cjs/market/Market.d.ts +613 -0
- package/lib/cjs/market/Market.js +503 -0
- package/lib/cjs/market/MarketUtils.d.ts +189 -0
- package/lib/cjs/market/MarketUtils.js +303 -0
- package/lib/cjs/market/Position.d.ts +424 -0
- package/lib/cjs/market/Position.js +425 -0
- package/lib/cjs/market/PositionUtils.d.ts +115 -0
- package/lib/cjs/market/PositionUtils.js +194 -0
- package/lib/cjs/market/index.d.ts +4 -0
- package/lib/cjs/market/index.js +20 -0
- package/lib/cjs/math/ConsumableUnitsLib.d.ts +57 -0
- package/lib/cjs/math/ConsumableUnitsLib.js +77 -0
- package/lib/cjs/math/TakeAmountsLib.d.ts +175 -0
- package/lib/cjs/math/TakeAmountsLib.js +199 -0
- package/lib/cjs/math/TickLib.d.ts +200 -0
- package/lib/cjs/math/TickLib.js +272 -0
- package/lib/cjs/math/index.d.ts +3 -0
- package/lib/cjs/math/index.js +19 -0
- package/lib/cjs/offers/Offer.d.ts +534 -0
- package/lib/cjs/offers/Offer.js +343 -0
- package/lib/cjs/offers/OfferUtils.d.ts +565 -0
- package/lib/cjs/offers/OfferUtils.js +659 -0
- package/lib/cjs/offers/index.d.ts +2 -0
- package/lib/cjs/offers/index.js +18 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/queries/GetPosition.d.ts +55 -0
- package/lib/cjs/queries/GetPosition.js +74 -0
- package/lib/cjs/queries/index.d.ts +1 -0
- package/lib/cjs/queries/index.js +37 -0
- package/lib/cjs/signatures/EcrecoverRatifierUtils.d.ts +733 -0
- package/lib/cjs/signatures/EcrecoverRatifierUtils.js +618 -0
- package/lib/cjs/signatures/Group.d.ts +178 -0
- package/lib/cjs/signatures/Group.js +193 -0
- package/lib/cjs/signatures/GroupUtils.d.ts +191 -0
- package/lib/cjs/signatures/GroupUtils.js +127 -0
- package/lib/cjs/signatures/Payload.d.ts +283 -0
- package/lib/cjs/signatures/Payload.js +570 -0
- package/lib/cjs/signatures/RatifierUtils.d.ts +109 -0
- package/lib/cjs/signatures/RatifierUtils.js +76 -0
- package/lib/cjs/signatures/SetterRatifierUtils.d.ts +243 -0
- package/lib/cjs/signatures/SetterRatifierUtils.js +217 -0
- package/lib/cjs/signatures/Tree.d.ts +241 -0
- package/lib/cjs/signatures/Tree.js +263 -0
- package/lib/cjs/signatures/TreeUtils.d.ts +573 -0
- package/lib/cjs/signatures/TreeUtils.js +461 -0
- package/lib/cjs/signatures/index.d.ts +7 -0
- package/lib/cjs/signatures/index.js +23 -0
- package/lib/esm/abis.d.ts +3170 -0
- package/lib/esm/abis.js +4070 -0
- package/lib/esm/api/MidnightApi.d.ts +532 -0
- package/lib/esm/api/MidnightApi.js +709 -0
- package/lib/esm/api/helpers.d.ts +20 -0
- package/lib/esm/api/helpers.js +180 -0
- package/lib/esm/api/index.d.ts +2 -0
- package/lib/esm/api/index.js +2 -0
- package/lib/esm/api/types.d.ts +453 -0
- package/lib/esm/api/types.js +1 -0
- package/lib/esm/constants.d.ts +168 -0
- package/lib/esm/constants.js +184 -0
- package/lib/esm/errors.d.ts +253 -0
- package/lib/esm/errors.js +291 -0
- package/lib/esm/fetch/Market.d.ts +65 -0
- package/lib/esm/fetch/Market.js +113 -0
- package/lib/esm/fetch/Offer.d.ts +74 -0
- package/lib/esm/fetch/Offer.js +116 -0
- package/lib/esm/fetch/Position.d.ts +85 -0
- package/lib/esm/fetch/Position.js +144 -0
- package/lib/esm/fetch/Ratifier.d.ts +38 -0
- package/lib/esm/fetch/Ratifier.js +54 -0
- package/lib/esm/fetch/index.d.ts +5 -0
- package/lib/esm/fetch/index.js +5 -0
- package/lib/esm/fetch/types.d.ts +57 -0
- package/lib/esm/fetch/types.js +1 -0
- package/lib/esm/fetch/utils.d.ts +8 -0
- package/lib/esm/fetch/utils.js +12 -0
- package/lib/esm/index.d.ts +18 -0
- package/lib/esm/index.js +18 -0
- package/lib/esm/market/Market.d.ts +613 -0
- package/lib/esm/market/Market.js +498 -0
- package/lib/esm/market/MarketUtils.d.ts +189 -0
- package/lib/esm/market/MarketUtils.js +300 -0
- package/lib/esm/market/Position.d.ts +424 -0
- package/lib/esm/market/Position.js +420 -0
- package/lib/esm/market/PositionUtils.d.ts +115 -0
- package/lib/esm/market/PositionUtils.js +191 -0
- package/lib/esm/market/index.d.ts +4 -0
- package/lib/esm/market/index.js +4 -0
- package/lib/esm/math/ConsumableUnitsLib.d.ts +57 -0
- package/lib/esm/math/ConsumableUnitsLib.js +74 -0
- package/lib/esm/math/TakeAmountsLib.d.ts +175 -0
- package/lib/esm/math/TakeAmountsLib.js +196 -0
- package/lib/esm/math/TickLib.d.ts +200 -0
- package/lib/esm/math/TickLib.js +269 -0
- package/lib/esm/math/index.d.ts +3 -0
- package/lib/esm/math/index.js +3 -0
- package/lib/esm/offers/Offer.d.ts +534 -0
- package/lib/esm/offers/Offer.js +339 -0
- package/lib/esm/offers/OfferUtils.d.ts +565 -0
- package/lib/esm/offers/OfferUtils.js +656 -0
- package/lib/esm/offers/index.d.ts +2 -0
- package/lib/esm/offers/index.js +2 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/queries/GetPosition.d.ts +55 -0
- package/lib/esm/queries/GetPosition.js +71 -0
- package/lib/esm/queries/index.d.ts +1 -0
- package/lib/esm/queries/index.js +1 -0
- package/lib/esm/signatures/EcrecoverRatifierUtils.d.ts +733 -0
- package/lib/esm/signatures/EcrecoverRatifierUtils.js +615 -0
- package/lib/esm/signatures/Group.d.ts +178 -0
- package/lib/esm/signatures/Group.js +189 -0
- package/lib/esm/signatures/GroupUtils.d.ts +191 -0
- package/lib/esm/signatures/GroupUtils.js +124 -0
- package/lib/esm/signatures/Payload.d.ts +283 -0
- package/lib/esm/signatures/Payload.js +564 -0
- package/lib/esm/signatures/RatifierUtils.d.ts +109 -0
- package/lib/esm/signatures/RatifierUtils.js +73 -0
- package/lib/esm/signatures/SetterRatifierUtils.d.ts +243 -0
- package/lib/esm/signatures/SetterRatifierUtils.js +214 -0
- package/lib/esm/signatures/Tree.d.ts +241 -0
- package/lib/esm/signatures/Tree.js +259 -0
- package/lib/esm/signatures/TreeUtils.d.ts +573 -0
- package/lib/esm/signatures/TreeUtils.js +458 -0
- package/lib/esm/signatures/index.d.ts +7 -0
- package/lib/esm/signatures/index.js +7 -0
- package/package.json +69 -0
- package/src/index.ts +19 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** @internal Deployless `GetPosition` query ABI. */
|
|
2
|
+
export declare const abi: readonly [{
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly internalType: "contract IMidnight";
|
|
5
|
+
readonly name: "midnight";
|
|
6
|
+
readonly type: "address";
|
|
7
|
+
}, {
|
|
8
|
+
readonly internalType: "bytes32";
|
|
9
|
+
readonly name: "id";
|
|
10
|
+
readonly type: "bytes32";
|
|
11
|
+
}, {
|
|
12
|
+
readonly internalType: "address";
|
|
13
|
+
readonly name: "user";
|
|
14
|
+
readonly type: "address";
|
|
15
|
+
}];
|
|
16
|
+
readonly name: "query";
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly components: readonly [{
|
|
19
|
+
readonly internalType: "uint128";
|
|
20
|
+
readonly name: "credit";
|
|
21
|
+
readonly type: "uint128";
|
|
22
|
+
}, {
|
|
23
|
+
readonly internalType: "uint128";
|
|
24
|
+
readonly name: "pendingFee";
|
|
25
|
+
readonly type: "uint128";
|
|
26
|
+
}, {
|
|
27
|
+
readonly internalType: "uint128";
|
|
28
|
+
readonly name: "lastLossFactor";
|
|
29
|
+
readonly type: "uint128";
|
|
30
|
+
}, {
|
|
31
|
+
readonly internalType: "uint128";
|
|
32
|
+
readonly name: "lastAccrual";
|
|
33
|
+
readonly type: "uint128";
|
|
34
|
+
}, {
|
|
35
|
+
readonly internalType: "uint128";
|
|
36
|
+
readonly name: "debt";
|
|
37
|
+
readonly type: "uint128";
|
|
38
|
+
}, {
|
|
39
|
+
readonly internalType: "uint128";
|
|
40
|
+
readonly name: "collateralBitmap";
|
|
41
|
+
readonly type: "uint128";
|
|
42
|
+
}, {
|
|
43
|
+
readonly internalType: "uint128[128]";
|
|
44
|
+
readonly name: "collateral";
|
|
45
|
+
readonly type: "uint128[128]";
|
|
46
|
+
}];
|
|
47
|
+
readonly internalType: "struct PositionResponse";
|
|
48
|
+
readonly name: "res";
|
|
49
|
+
readonly type: "tuple";
|
|
50
|
+
}];
|
|
51
|
+
readonly stateMutability: "view";
|
|
52
|
+
readonly type: "function";
|
|
53
|
+
}];
|
|
54
|
+
/** @internal Deployless `GetPosition` query bytecode. */
|
|
55
|
+
export declare const code = "0x60808060405234601557610362908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c63d8f172c414610025575f80fd5b346101b85760603660031901126101b8576004356001600160a01b03811691908290036101b857602435906044356001600160a01b038116908190036101b85760e0820182811067ffffffffffffffff8211176102e2576040525f825260208201925f845260408301925f8452606081015f8152608082015f815260a08301915f835260c0840196611000604051906100be81836102f6565b36823788526040516349e2903160e11b8152600481018790526024810188905260c0816044818e5afa9081156101c4575f905f925f91885f925f925f91610243575b506001600160801b039081169091529081168852908116865290811684529182168b521685525f5b60808110156101cf5760405163ecdcc72d60e01b8152600481018890526024810189905260448101829052906020826064818f5afa80156101c4575f90610187575b600192506001600160801b038b519116908260051b015201610128565b506020823d82116101bc575b816101a0602093836102f6565b810103126101b8576101b3600192610318565b61016a565b5f80fd5b3d9150610193565b6040513d5f823e3d90fd5b506001600160801b039283899593818094818e816040519c51168c52511660208b0152511660408901525116606087015251166080850152511660a08301525160c082015f905b60808210610224576110c084f35b6020806001926001600160801b03865116815201930191019091610216565b965050505050505060c0813d60c0116102da575b8161026460c093836102f6565b810103126101b857806001600160801b0361027f8193610318565b918161028d60208301610318565b938161029b60408501610318565b93816102a960608301610318565b938d826102c460a06102bd60808801610318565b9601610318565b929a989694929550509497509450509396610100565b3d9150610257565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176102e257604052565b51906001600160801b03821682036101b85756fea264697066735822122047b31034ba6d0d5a88fb953996f2d97fa501664a716d124ff2e42e0782119d9164736f6c63430008230033";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** @internal Deployless `GetPosition` query ABI. */
|
|
2
|
+
export const abi = [
|
|
3
|
+
{
|
|
4
|
+
inputs: [
|
|
5
|
+
{
|
|
6
|
+
internalType: "contract IMidnight",
|
|
7
|
+
name: "midnight",
|
|
8
|
+
type: "address",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
internalType: "bytes32",
|
|
12
|
+
name: "id",
|
|
13
|
+
type: "bytes32",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
internalType: "address",
|
|
17
|
+
name: "user",
|
|
18
|
+
type: "address",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
name: "query",
|
|
22
|
+
outputs: [
|
|
23
|
+
{
|
|
24
|
+
components: [
|
|
25
|
+
{
|
|
26
|
+
internalType: "uint128",
|
|
27
|
+
name: "credit",
|
|
28
|
+
type: "uint128",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
internalType: "uint128",
|
|
32
|
+
name: "pendingFee",
|
|
33
|
+
type: "uint128",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
internalType: "uint128",
|
|
37
|
+
name: "lastLossFactor",
|
|
38
|
+
type: "uint128",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
internalType: "uint128",
|
|
42
|
+
name: "lastAccrual",
|
|
43
|
+
type: "uint128",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
internalType: "uint128",
|
|
47
|
+
name: "debt",
|
|
48
|
+
type: "uint128",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
internalType: "uint128",
|
|
52
|
+
name: "collateralBitmap",
|
|
53
|
+
type: "uint128",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
internalType: "uint128[128]",
|
|
57
|
+
name: "collateral",
|
|
58
|
+
type: "uint128[128]",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
internalType: "struct PositionResponse",
|
|
62
|
+
name: "res",
|
|
63
|
+
type: "tuple",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
stateMutability: "view",
|
|
67
|
+
type: "function",
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
/** @internal Deployless `GetPosition` query bytecode. */
|
|
71
|
+
export const code = "0x60808060405234601557610362908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c63d8f172c414610025575f80fd5b346101b85760603660031901126101b8576004356001600160a01b03811691908290036101b857602435906044356001600160a01b038116908190036101b85760e0820182811067ffffffffffffffff8211176102e2576040525f825260208201925f845260408301925f8452606081015f8152608082015f815260a08301915f835260c0840196611000604051906100be81836102f6565b36823788526040516349e2903160e11b8152600481018790526024810188905260c0816044818e5afa9081156101c4575f905f925f91885f925f925f91610243575b506001600160801b039081169091529081168852908116865290811684529182168b521685525f5b60808110156101cf5760405163ecdcc72d60e01b8152600481018890526024810189905260448101829052906020826064818f5afa80156101c4575f90610187575b600192506001600160801b038b519116908260051b015201610128565b506020823d82116101bc575b816101a0602093836102f6565b810103126101b8576101b3600192610318565b61016a565b5f80fd5b3d9150610193565b6040513d5f823e3d90fd5b506001600160801b039283899593818094818e816040519c51168c52511660208b0152511660408901525116606087015251166080850152511660a08301525160c082015f905b60808210610224576110c084f35b6020806001926001600160801b03865116815201930191019091610216565b965050505050505060c0813d60c0116102da575b8161026460c093836102f6565b810103126101b857806001600160801b0361027f8193610318565b918161028d60208301610318565b938161029b60408501610318565b93816102a960608301610318565b938d826102c460a06102bd60808801610318565b9601610318565b929a989694929550509497509450509396610100565b3d9150610257565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176102e257604052565b51906001600160801b03821682036101b85756fea264697066735822122047b31034ba6d0d5a88fb953996f2d97fa501664a716d124ff2e42e0782119d9164736f6c63430008230033";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as GetPosition from "./GetPosition.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as GetPosition from "./GetPosition.js";
|