UNPKG

@morpho-org/midnight-sdk

Version:

Viem-based package for Morpho Midnight that exports protocol utilities, fetch helpers, and Midnight API utilities under a dedicated API subpath.

72 lines (71 loc) • 3.97 kB
/** @internal Deployless `GetPosition` query ABI. */ export const abi = [ { inputs: [ { internalType: "contract IMidnight", name: "midnight", type: "address", }, { internalType: "bytes32", name: "id", type: "bytes32", }, { internalType: "address", name: "user", type: "address", }, ], name: "query", outputs: [ { components: [ { internalType: "uint128", name: "credit", type: "uint128", }, { internalType: "uint128", name: "pendingFee", type: "uint128", }, { internalType: "uint128", name: "lastLossFactor", type: "uint128", }, { internalType: "uint128", name: "lastAccrual", type: "uint128", }, { internalType: "uint128", name: "debt", type: "uint128", }, { internalType: "uint128", name: "collateralBitmap", type: "uint128", }, { internalType: "uint128[128]", name: "collateral", type: "uint128[128]", }, ], internalType: "struct PositionResponse", name: "res", type: "tuple", }, ], stateMutability: "view", type: "function", }, ]; /** @internal Deployless `GetPosition` query bytecode. */ export const code = "0x60808060405234601557610362908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c63d8f172c414610025575f80fd5b346101b85760603660031901126101b8576004356001600160a01b03811691908290036101b857602435906044356001600160a01b038116908190036101b85760e0820182811067ffffffffffffffff8211176102e2576040525f825260208201925f845260408301925f8452606081015f8152608082015f815260a08301915f835260c0840196611000604051906100be81836102f6565b36823788526040516349e2903160e11b8152600481018790526024810188905260c0816044818e5afa9081156101c4575f905f925f91885f925f925f91610243575b506001600160801b039081169091529081168852908116865290811684529182168b521685525f5b60808110156101cf5760405163ecdcc72d60e01b8152600481018890526024810189905260448101829052906020826064818f5afa80156101c4575f90610187575b600192506001600160801b038b519116908260051b015201610128565b506020823d82116101bc575b816101a0602093836102f6565b810103126101b8576101b3600192610318565b61016a565b5f80fd5b3d9150610193565b6040513d5f823e3d90fd5b506001600160801b039283899593818094818e816040519c51168c52511660208b0152511660408901525116606087015251166080850152511660a08301525160c082015f905b60808210610224576110c084f35b6020806001926001600160801b03865116815201930191019091610216565b965050505050505060c0813d60c0116102da575b8161026460c093836102f6565b810103126101b857806001600160801b0361027f8193610318565b918161028d60208301610318565b938161029b60408501610318565b93816102a960608301610318565b938d826102c460a06102bd60808801610318565b9601610318565b929a989694929550509497509450509396610100565b3d9150610257565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176102e257604052565b51906001600160801b03821682036101b85756fea26469706673582212200eb5ee2c25180818e6f54eaf74e6f626bff5ff8c68ec38bf86f24bc97a4fe77264736f6c63430008240033";