# Loan

## Get available loan offers

> \- Get all available loan offers, filter by loan tokens, collateral tokens, loan maturity and pagination with page/pageSize

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-available-loan-offers":{"post":{"tags":["Loan"],"summary":"Get available loan offers","description":"- Get all available loan offers, filter by loan tokens, collateral tokens, loan maturity and pagination with page/pageSize","operationId":"getAvailableLoanOffers","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"loanTokens":{"type":"array","description":"Filter by list loan tokens","items":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of Loan Token","nullable":false}},"collateralTokens":{"type":"array","minItems":1,"maxItems":50,"description":"List of Collateral Tokens, in format \"{policyId}.{assetName}\", for filtering Pools","items":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of Collateral Token","nullable":false}},"loanMaturity":{"type":"integer","format":"int64","description":"- Loan Maturity in milliseconds, for filtering Pools with maturity greater than this value.\n- If Null return Loan offer with float rate\n","nullable":true}}},{"type":"object","properties":{"page":{"type":"integer","default":1,"description":"Current page, for high performance try to use pagination.offset instead!"},"pageSize":{"type":"integer","nullable":false,"description":"Page size"}}}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["pagination"],"properties":{"loans":{"type":"array","minItems":0,"maxItems":50,"description":"List Available Loans","items":{"type":"object","required":["loanToken"],"properties":{"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Token"},"loanOffers":{"type":"array","description":"List loan offers","items":{"type":"object","description":"Loan offer","required":["poolId","borrowRate","minBorrowAmount","availableLiquidity"],"properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Pool NFT"},"borrowRate":{"type":"integer","description":"Borrow Rate in basis point","nullable":false},"loanDuration":{"type":"integer","description":"Loan duration in days, for loan offer with fixed rate","nullable":true},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"},"availableLiquidity":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token available in liquidity of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token and its liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}}}}}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","format":"int32","description":"Current page, start from 1","nullable":false},"pageSize":{"type":"integer","format":"int32","description":"Page size","nullable":false},"total":{"type":"integer","format":"int32","description":"Total items","nullable":false}},"required":["page","pageSize","total"]}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Fixed Rate Loan transaction

> \- Get parameters for Create Fixed Rate Loan Transaction\
> \- Documentation: <https://docs.danogo.io/developers/integration/how-to-build-transaction-to-create-a-fixed-rate-loan>

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-fixed-loan-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Fixed Rate Loan transaction","description":"- Get parameters for Create Fixed Rate Loan Transaction\n- Documentation: https://docs.danogo.io/developers/integration/how-to-build-transaction-to-create-a-fixed-rate-loan","operationId":"getCreateFixedLoanParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["poolId","borrowAmount","loanDuration","collateralTokens"],"properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Pool NFT from which the Loan will borrow"},"borrowAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token to borrow, in base unit"},"loanDuration":{"type":"integer","nullable":false,"description":"Loan duration in days"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals","items":{"type":"object","required":["collateralToken","collateralAmount"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawals","mint","referenceInputs"],"properties":{"inputs":{"type":"object","description":"Inputs info for building transaction, required either liqwidInUtxo or floatPoolInUtxo","required":["poolInUtxo","floatPoolInUtxo"],"properties":{"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Fixed Pool, used for input\n- Spending redeemer struct:\n  - Redeemer Indexer: Index for Create loan\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Loan Out Index: Int - Index of Loan UTxO in outputs\n  - Pool In Index: Int - Index of Pool UTxO in inputs\n  - Loan In Index: Int - Index of Loan UTxO in inputs (Null when Create new loan)\n  - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)"}]},"floatPoolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Float Pool, used for input\n- Spending redeemer struct:\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n    - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs"}]},"stakingContractInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Staking Contract Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs"}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanOutUtxo"],"properties":{"poolOutUtxo":{"description":"UTxO of Fixed Pool","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["supplyToken","supplyYieldToken","circulatingPTSupply","circulatingYTSupply","supplyMaturity","collaterals","baseInterestRate","gradient","maxLoanDuration","activeLoanCount","feeCollected","minBorrowAmount"],"properties":{"supplyToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of supply token of Pool"},"supplyYieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":true,"description":"Token id of substitute token of supply token"},"circulatingPTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool PT in circulating"},"circulatingYTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool YT in circulating"},"supplyMaturity":{"type":"integer","nullable":false,"description":"Maturity timestamp of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token with its price and liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"baseInterestRate":{"type":"integer","nullable":false,"description":"Base Interest Rate in basis points"},"gradient":{"type":"integer","nullable":false,"description":"Gradient in basis points"},"maxLoanDuration":{"type":"integer","nullable":false,"description":"Max loan duration in milliseconds"},"activeLoanCount":{"type":"integer","nullable":false,"description":"Number of Active Loan borrowed from Pool"},"feeCollected":{"type":"boolean","nullable":false,"description":"True if the fee has been collected from the pool, false otherwise"},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"}}}}}]},"loanOutUtxo":{"description":"UTxO of Fixed Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount","loanOwnerNftName"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":true,"description":"Loan profit fee in datum of Loan UTxO, set when building the Tx"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in Loan UTxO"},"loanMaturity":{"type":"number","format":"int64","nullable":true,"description":"Maturity timestamp of Loan in milliseconds, set to loan maturity when building the Tx"},"loanOwnerNftName":{"type":"string","format":"{assetName}","nullable":false,"description":"Token id asset name of Loan Owner NFT"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"floatPoolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]},"withdrawalFeeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}},"withdrawals":{"type":"array","minItems":1,"maxItems":2,"description":"Withdrawals info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","items":{"type":"object","required":["rewardAddressScriptHash","coin"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}}}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan, include:\n    - Loan Owner NFT: Owner NFT token send to borrower\n    - Loan Validity Token: Token used for loan validity, include in Loan UTxO\n    - Liqwid qToken: The qToken is burned when withdrawing from the Liqwid Pool UTxO\n  - Minting redeemer struct (Fixed):\n    - Reddemer Indexer: Index for Create loan\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Loan Out Index: Int - Index of Loan UTxO in outputs\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - Loan In Index: Int - Index of Loan UTxO in inputs (Null when Create new loan)\n    - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)\n  - Minting redeemer struct (Float):\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n      - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Minting redeemer struct (Staking Contract):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets","redeemerType"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}},"redeemerType":{"type":"string","enum":["FIXED","FLOAT","FLOAT","STAKING"],"description":"Redeemer type, used when building the transaction; each type requires a different redeemer structure"}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","LOAN_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_SCRIPT","PROTOCOL_CONFIG","LIQWID_MARKET_STATE","LIQWID_MARKET_PARAM","ORCFAX_FSP","ORCFAX_FS","LIQWID_ORACLE","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP","STAKING_CONTRACT_SCRIPT","FLOAT_PROTOCOL_CONFIG","FLOAT_POOL_SCRIPT","FLOAT_POOL_CONFIG","FLOAT_LOAN_SCRIPT"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}},"auxiliaryData":{"description":"Auxiliary data associated with the loan, follows CIP-25","type":"object","properties":{"loanOwnerNftMetadata":{"allOf":[{"type":"object","description":"Metadata associated with the loan owner's NFT, follows CIP-25"},{"title":"tokenMetadata","type":"object","description":"CIP-25 token metadata","required":["name","image"],"properties":{"name":{"type":"string","description":"Display name of token","nullable":false},"image":{"type":"string","description":"Image URL of token on ipfs","nullable":false},"description":{"type":"string","description":"Description of token","nullable":true}}}]}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Float Rate Loan transaction

> Get parameters for Create Float Rate Loan Transaction

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-float-loan-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Float Rate Loan transaction","description":"Get parameters for Create Float Rate Loan Transaction","operationId":"getCreateFloatLoanParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["borrowToken","borrowAmount","collateralTokens"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id, concat of asset policyId with asset name (Case ADA, id = \"\")"},"borrowAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of token to borrow, in base unit"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"description":"List of collaterals","items":{"type":"object","required":["collateralToken","collateralAmount"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"collateralAmount":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Collateral token"}}}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawals","mint","referenceInputs"],"properties":{"inputs":{"type":"object","description":"Inputs info for building transaction","required":["poolInUtxo"],"properties":{"stakingContractInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Staking Contract Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs"}]},"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Pool, used for input\n- Spending redeemer struct:\n  - Pool Out Index: Int - Index of Pool UTxO in outputs\n  - Loan Out Index: Int - Index of Loan UTxO in outputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Pool In OutRef: String - OutRef of Pool UTxO in inputs"}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanOutUtxo"],"properties":{"poolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"loanOutUtxo":{"description":"UTxO of Float Loan, borrower must add collateral to multiAssets","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanOwnerToken","loanToken","loanAmount","initialInterestIndex"],"properties":{"loanOwnerToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Owner NFT, null if loan was liquidated"},"loanToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Loan Token"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"loan amount in lovelace"},"initialInterestIndex":{"type":"string","format":"bigint","nullable":false,"description":"captured interest index when create loan or modify loan"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]}}},"withdrawals":{"type":"array","minItems":1,"maxItems":2,"description":"Withdrawals info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","items":{"type":"object","required":["rewardAddressScriptHash","coin"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}}}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan, include:\n    - Loan Owner NFT: Owner NFT token send to borrower\n    - Loan Validity Token: Token used for loan validity, include in Loan UTxO\n    - Float dToken: The dToken is burned when withdrawing from the Float Pool UTxO\n    - Liqwid qToken: The qToken is burned when withdrawing from the Liqwid Pool UTxO\n  - Minting redeemer struct (Float):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - Loan Out Index: Int - Index of Loan UTxO in outputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n    - Pool In OutRef: String - OutRef of Pool UTxO in inputs\n  - Minting redeemer struct (Float):\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Pool Market Ref Indexers: List\\<PoolMarketIndexer\\>\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - Fee Out Index: Option\\<Int\\> - Index of Fee UTxO in outputs (Null when Fee = 0)\n      - Market Ref Index: Int - Index of Market Ref UTxO in reference inputs\n  - Minting redeemer struct (Staking Contract):\n    - Pool Out Index: Int - Index of Pool UTxO in outputs","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets","redeemerType"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}},"redeemerType":{"type":"string","enum":["FIXED","FLOAT","FLOAT","STAKING"],"description":"Redeemer type, used when building the transaction; each type requires a different redeemer structure"}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","POOL_CONFIG","LOAN_SCRIPT","STAKING_CONTRACT_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_CONFIG","LIQWID_MARKET_STATE","LIQWID_MARKET_PARAM","ORCFAX_FSP","ORCFAX_FS","LIQWID_ORACLE","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP","SPLASH_LP_CFMM_G3"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```

## Get Params for Create Loan to Submit GA Transaction

> Get parameters for Create Loan to Submit GA Transaction\
> Note: API response doesn't include proposal procedures due to object complication, client needs to build themselves.<br>

```json
{"openapi":"3.0.1","info":{"title":"Danogo Lending Public","version":"v1.0.0"},"tags":[{"name":"Loan"}],"servers":[{"url":"https://danogo-lending.preview.tekoapis.net","description":"Preview"},{"url":"https://danogo-lending.tekoapis.com","description":"Mainnet"}],"paths":{"/api/v1/get-create-loan-ga-params":{"post":{"tags":["Loan"],"summary":"Get Params for Create Loan to Submit GA Transaction","description":"Get parameters for Create Loan to Submit GA Transaction\nNote: API response doesn't include proposal procedures due to object complication, client needs to build themselves.\n","operationId":"getCreateLoanToSubmitGAParams","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"poolId":{"type":"string","format":"{policyId}.{assetName}","description":"Token id of the Pool NFT from which the Loan will borrow"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"data":{"type":"object","required":["inputs","outputs","withdrawal","mint","referenceInputs"],"properties":{"poolId":{"type":"string","description":"Token id of the Pool NFT of the Fixed Rate Pool to borrow from."},"gaTreasuryAddress":{"type":"string","format":"bech32","nullable":true,"description":"Stake address of GA Treasury SC, used for receiving reward after Governance Action finalized."},"loanFee":{"type":"string","format":"bigint (lovelace)","description":"The loan fee that user must pay to the lending pool for each governance action, included of:\n- pool's loan interest\n- collector fee / minAda\n- loan origination fee\n"},"govActionParams":{"description":"Parameters for Gov Action, used when building the transaction","type":"object","properties":{"lastGuardrails":{"type":"string","description":"The optional guardrails script defined in the constitution. This script is executed by the ledger alongside the hard-coded ledger rules and applies only to PROTOCOL_PARAMETER_CHANGE and TREASURY_WITHDRAWALS proposals.\n"},"lastGuardrailsScriptOutRef":{"type":"string","description":"The guardrails script has been put on a UTxO so that it can be used as reference script in Treasury Withdrawal and Protocol Parameter Change proposals. [See more](https://book.world.dev.cardano.org/env-mainnet.html#guardrails-reference-script-utxo)"},"lastEnactedNoConfidenceGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NO_CONFIDENCE."},"lastEnactedUpdateCommitteeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type UPDATE_COMMITTEE."},"lastEnactedNewConstitutionGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type NEW_CONSTITUTION."},"lastEnactedHardForkGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type HARD_FORK_INITIATION."},"lastEnactedProtocolParamChangeGovActionId":{"type":"string","description":"The ID of the last enacted governance action of type PROTOCOL_PARAMETER_CHANGE."},"currentProtocolVersion":{"type":"string","description":"The current protocol version in Cardano."},"committeeVotingThreshold":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The voting threshold for committee approval"}]},"protocolParameters":{"title":"Cardano Protocol Parameters","type":"object","properties":{"maxBlockBodySize":{"type":"string","format":"int64","description":"Maximum size of a block body in bytes."},"maxTxSize":{"type":"string","format":"int64","description":"Maximum size of a transaction in bytes."},"maxBlockHeaderSize":{"type":"string","format":"int64","description":"Maximum size of a block header in bytes."},"maxValueSize":{"type":"string","format":"int64","description":"Maximum value size in bytes."},"maxTxExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single transaction"},"maxTxExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single transaction"},"maxBlockExecutionMemUnits":{"type":"string","format":"int64","description":"Maximum memory units in a single block"},"maxBlockExecutionStepUnits":{"type":"string","format":"int64","description":"Maximum step units in a single block"},"maxCollateralInputs":{"type":"string","format":"int64","description":"Maximum number of collateral inputs in a single transaction."},"txFeePerByte":{"type":"string","format":"int64","description":"The fee per byte for transactions."},"txFeeFixed":{"type":"string","format":"int64","description":"The fixed fee for transactions."},"stakeAddressDeposit":{"type":"string","format":"int64","description":"The deposit required for stake key registration."},"stakePoolDeposit":{"type":"string","format":"int64","description":"The deposit required for pool registration."},"monetaryExpansion":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate of monetary expansion."}]},"treasuryCut":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The rate at which the treasury will grow over time."}]},"minPoolCost":{"type":"string","format":"int64","description":"The minimum cost to maintain a pool."},"utxoCostPerByte":{"type":"string","format":"int64","description":"The minimum Lovelace deposit per byte for serialized UTxOs."},"executionMemUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for memory usage in script execution."}]},"executionStepUnitPrices":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"Price for step execution in script execution."}]},"poolPledgeInfluence":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The influence of pool pledge on governance actions."}]},"poolRetireMaxEpoch":{"type":"string","format":"int64","description":"The maximum epoch for pool retirement."},"stakePoolTargetNum":{"type":"string","format":"int64","description":"The desired number of stake pools in the system."},"costModels":{"description":"Cost model data for different versions of Plutus scripts.","type":"object","properties":{"plutusV1":{"type":"array","description":"The cost model for Plutus v1 scripts, typically containing 166 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV2":{"type":"array","description":"The cost model for Plutus v2 scripts, typically containing 175 integers representing resource usage costs.","items":{"type":"integer"}},"plutusV3":{"type":"array","description":"The cost model for Plutus v3 scripts, typically containing 223 integers representing resource usage costs.","items":{"type":"integer"}}}},"collateralPercentage":{"type":"string","format":"int64","description":"The percentage of collateral required for scripts."},"pvtMotionNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for a motion of no confidence."},"pvtCommitteeNormal":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee decisions."},"pvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The pool voting threshold for constitutional committee actions under no confidence."},"pvtHardForkInitiation":{"type":"number","format":"double","description":"The pool voting threshold for approving a hard fork initiation."},"pvtPPSecurityGroup":{"type":"number","format":"double","description":"The pool voting threshold for changes to the protocol parameters security group."},"dvtMotionNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for a motion of no confidence."},"dvtCommitteeNormal":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee decisions."},"dvtCommitteeNoConfidence":{"type":"number","format":"double","description":"The drep voting threshold for constitutional committee actions under no confidence."},"dvtUpdateToConstitution":{"type":"number","format":"double","description":"The drep voting threshold for approving constitutional changes."},"dvtHardForkInitiation":{"type":"number","format":"double","description":"The drep voting threshold for approving a hard fork."},"dvtPPNetworkGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters network group."},"dvtPPEconomicGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters economic group."},"dvtPPTechnicalGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters technical group."},"dvtPPGovGroup":{"type":"number","format":"double","description":"The drep voting threshold for changes to the protocol parameters governance group."},"dvtTreasuryWithdrawal":{"type":"number","format":"double","description":"The drep voting threshold for treasury withdrawals."},"govActionLifetime":{"type":"string","format":"int64","description":"The maximum lifetime of a governance action in epochs, after which it will be considered expired."},"govActionDeposit":{"type":"string","format":"int64","description":"The required deposit for submitting a governance action."},"dRepDeposit":{"type":"string","format":"int64","description":"The deposit required for DRep registration."},"dRepActivity":{"type":"string","format":"int64","description":"The activity period in epochs before a DRep is considered inactive."},"committeeMinSize":{"type":"string","format":"int64","description":"The minimum number of members required for a constitutional committee to function."},"committeeMaxTermLength":{"type":"string","format":"int64","description":"The maximum number of epochs a committee member can serve before their term expires."},"minFeeRefScriptCostPerByte":{"allOf":[{"title":"Ratio","description":"Represents a ratio of a numerator and a denominator.","type":"object","properties":{"numerator":{"type":"string","format":"int64","description":"The numerator of the ratio.","default":"0"},"denominator":{"type":"string","format":"int64","description":"The denominator of the ratio.","default":"1"}}},{"description":"The minimum fee charged per byte for reference scripts used in transactions."}]}}}}},"inputs":{"type":"object","description":"Inputs info for building transaction","required":["poolInUtxo","floatPoolInUtxo"],"properties":{"poolInUtxo":{"allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},{"description":"- UTxO of Fixed Pool, used for input\n- Spending redeemer struct:\n  - Redeemer Indexer: Index for Create loan GA (List of LoanGAPoolIndexer)\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - Pool Out Index: Int - Index of Pool UTxO in outputs\n    - LoanGA Out Index: Int - Index of LoanGA UTxO in outputs\n  - Pool In Index: Int - Index of Pool UTxO in inputs\n  - LoanGA In Index: Int - Index of LoanGA UTxO in inputs (Null when Create new loan)\n  - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n  - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n  - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)"}]},"floatPoolInUtxo":{"description":"UTxO detail for building Transaction","title":"UTxO model","type":"object","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]},"stakingContractInUtxo":{"description":"UTxO detail for building Transaction","title":"UTxO model","type":"object","allOf":[{"title":"UTxO model","type":"object","description":"UTxO detail for building Transaction","required":["address","coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","description":"Output Reference of UTxO","nullable":false}}}]}}},"outputs":{"type":"object","description":"Outputs info for building transaction","required":["poolOutUtxo","loanGAOutUtxo","floatPoolOutUtxo"],"properties":{"poolOutUtxo":{"description":"UTxO of Fixed Pool","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["supplyToken","supplyYieldToken","circulatingPTSupply","circulatingYTSupply","supplyMaturity","collaterals","baseInterestRate","gradient","maxLoanDuration","activeLoanCount","feeCollected","minBorrowAmount"],"properties":{"supplyToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of supply token of Pool"},"supplyYieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":true,"description":"Token id of substitute token of supply token"},"circulatingPTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool PT in circulating"},"circulatingYTSupply":{"type":"string","format":"bigint","nullable":false,"description":"Amount of Pool YT in circulating"},"supplyMaturity":{"type":"integer","nullable":false,"description":"Maturity timestamp of Pool"},"collaterals":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","description":"Collateral token with its price and liquidation threshold","required":["collateralToken","liquidationThreshold"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of the Collateral token"},"liquidationThreshold":{"type":"integer","nullable":false,"description":"Liquidation threshold of collateral token in basis points"}}}},"baseInterestRate":{"type":"integer","nullable":false,"description":"Base Interest Rate in basis points"},"gradient":{"type":"integer","nullable":false,"description":"Gradient in basis points"},"maxLoanDuration":{"type":"integer","nullable":false,"description":"Max loan duration in milliseconds"},"activeLoanCount":{"type":"integer","nullable":false,"description":"Number of Active Loan borrowed from Pool"},"feeCollected":{"type":"boolean","nullable":false,"description":"True if the fee has been collected from the pool, false otherwise"},"minBorrowAmount":{"type":"string","format":"bigint","nullable":true,"description":"The minimum borrow amount when create loan"}}}}}]},"loanGAOutUtxo":{"description":"UTxO of Fixed LoanGA","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"title":"Reference script in UTxO","type":"object","properties":{"refScriptCborHex":{"type":"string","nullable":true,"description":"CBOR hex of reference script"},"refScriptHash":{"type":"string","nullable":true,"description":"Script hash of reference script"}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["loanProfitFee","loanAmount"],"properties":{"loanProfitFee":{"type":"string","format":"bigint","nullable":false,"description":"Fee amount (extracted from loan profit) that will be collected at LoanGA Collection","default":"90000000"},"loanAmount":{"type":"string","format":"bigint","nullable":false,"description":"Debt amount of token in LoanGA UTxO","default":"100000000000"}}}}}]},"feeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"floatPoolOutUtxo":{"allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingDToken","totalBorrow","borrowApy","undistributedFee","interestIndex","interestTime","alternativeSupplyTokens"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"Total supply in pool, in base unit"},"circulatingDToken":{"type":"string","format":"bigint","nullable":false,"description":"Total dToken minted - total dToken burned"},"totalBorrow":{"type":"string","format":"bigint","nullable":false,"description":"Total borrow in pool, in base unit"},"borrowRate":{"type":"integer","nullable":false,"description":"Borrow rate in basis point"},"undistributedFee":{"type":"string","format":"bigint","nullable":false,"description":"Protocol fee not distributed for supplier, in base unit"},"interestIndex":{"type":"string","format":"bigint","nullable":false,"description":"Interest index"},"interestTime":{"type":"number","format":"int64","nullable":false,"description":"updated market state timestamp in millisecond"},"alternativeSupplyTokens":{"type":"array","description":"List of alternative supply tokens in pools","items":{"type":"object","required":["token","latestExchangeRateNum","latestExchangeRateDen"],"properties":{"token":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of alternative token"},"latestExchangeRateNum":{"type":"string","format":"bigint","nullable":false,"description":"Numerator of exchange alternative token rate has been captured at the last interest time"},"latestExchangeRateDen":{"type":"string","format":"bigint","nullable":false,"description":"Denominator of exchange qToken rate has been captured at the last interest time"}}}}}}}}]},"stakingContractOutUtxo":{"type":"object","description":"UTxO of Staking Contract contains ADA of users","allOf":[{"type":"object","description":"Output UTxO detail for building Transaction","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},{"type":"object","required":["datum"],"properties":{"datum":{"type":"object","description":"UTxO Datum Info","required":["totalSupply","circulatingSToken","validUntil"],"properties":{"totalSupply":{"type":"string","format":"bigint","nullable":false,"description":"total supply of staking contract"},"circulatingSToken":{"type":"string","format":"bigint","nullable":false,"description":"circulating sToken for this staking contract"},"validUntil":{"type":"integer","format":"int64","nullable":false,"description":"The maximum time until which the exchange rate between sADA and ADA is accepted, determinedby the end time of the epoch containing the transaction start time in milliseconds"}}}}}]},"withdrawalFeeOutUtxo":{"description":"Output UTxO detail for building Transaction","type":"object","required":["coin"],"properties":{"address":{"type":"string","format":"bech32","description":"address of UTxO, set to null when it should be constructed using borrower information","nullable":true},"coin":{"type":"string","format":"bigint (lovelace)","description":"number ADA of utxo","nullable":false},"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}}}},"withdrawal":{"type":"object","description":"Withdrawal info for building transaction, include Reward Address Script Hash, coin and withdrawal redeemer","required":["rewardAddressScriptHash","coin","withdrawalRedeemer"],"properties":{"rewardAddressScriptHash":{"type":"string","format":"bech32","description":"Script Hash of reward address, used for withdrawal","nullable":false},"coin":{"type":"string","format":"bigint (lovelace)","description":"Number of ADA to withdrawal","nullable":false},"withdrawalRedeemer":{"type":"object","description":"- Withdrawal Redeemer Struct:\n  - Global Config Index: Int - Index of Global Config UTxO in reference inputs\n  - Oracle Path Indexes: ByteArray(List\\<Int\\>) - List Index of Oracle Path UTxO in reference inputs, convert to ByteArray\n  - Oracle Price Indexes: ByteArray(List\\<OraclePriceIndex\\>) - List Index of Oracle Price UTxO in reference inputs or outputs, group by Oracle Source Type and convert to ByteArray\n    - OraclePriceIndex: <UtxoTarget, OracleType, Index> - Index of Oracle Price UTxO\n      - UtxoTarget: Enum - UTxO in reference inputs or outputs, include:\n        - REF\n        - OUT\n        - IN\n      - OracleType: Enum - Type of Oracle Price UTxO, include:\n        - ORCFAX_FSP\n        - ORCFAX_FS\n        - LIQWID_MARKET_STATE\n        - LIQWID_MARKET_PARAM\n        - LIQWID_ORACLE_V1\n        - LIQWID_ORACLE_V2\n        - DANOGO_FLOAT_POOL\n        - INDIGO\n        - DJED\n        - DANOGO_STAKING\n        - MINSWAP_LP\n        - SPLASH_LP_CFMM_G1\n        - SPLASH_LP_CFMM_G2\n        - SPLASH_LP_CFMM_G3\n        - SPLASH_LP_STABLE\n      - Index: Int - Index of Oracle Price UTxO in reference inputs or outputs\n  - Prices: List\\<OraclePrice\\> - List of prices of collateralToken/borrowToken\n    - OraclePrice: List\\<(CalcType, prices)\\> - Prices of each collateral token\n      - CalcType: Int - 0: Normal, 1: Splash\n  - Borrow Rates: List\\<BorrowRate\\> - List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","required":["prices"],"properties":{"prices":{"type":"array","minItems":1,"maxItems":50,"description":"List of prices of token pairs (A/B)","items":{"type":"object","required":["borrowToken","oraclePrices"],"properties":{"borrowToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Borrow token"},"oraclePrices":{"type":"array","minItems":1,"maxItems":50,"description":"Prices of each collateral token","items":{"type":"object","required":["collateralToken","priceNum","priceDen"],"properties":{"collateralToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Collateral token"},"priceNum":{"type":"string","format":"bigint","nullable":true,"description":"Numerator of Collateral token price in Supply token"},"priceDen":{"type":"string","format":"bigint","nullable":true,"description":"Denominator of Collateral token price in Supply token"}}}}}}},"borrowRates":{"type":"array","minItems":1,"maxItems":50,"description":"List of borrow rates from Yield Protocols associated with Danogo Lending (e.g., Liqwid)","items":{"type":"object","properties":{"yieldToken":{"type":"string","format":"{policyId}.{assetName}","nullable":false,"description":"Token id of Yield token"},"borrowRate":{"type":"integer","nullable":false,"description":"borrow rate in basis points"}}}}}},"stakeAddress":{"type":"string","format":"bech32","description":"Stake address of staking contract, used for withdrawal if staking contract involved","nullable":true},"stakeRewards":{"type":"string","format":"bigint","nullable":true,"description":"Rewards of stake address in lovelace"}}},"mint":{"type":"object","description":"- Mint info for building transaction with multiAssets\n  - MultiAssets: List token to mint/burn when create loan GA, include:\n    - Loan NFT: NFT token used for loan validity, include in LoanGA UTxO\n    - Float dToken: The dToken is burned when withdrawing from the Float Pool UTxO\n  - Minting redeemer struct:\n    - Redeemer Indexer: Index for Create loan GA\n      - Pool Out Index: Int - Index of Pool UTxO in outputs\n      - LoanGA Out Index: Int - Index of LoanGA UTxO in outputs\n    - Pool In Index: Int - Index of Pool UTxO in inputs\n    - LoanGA In Index: Int - Index of LoanGA UTxO in inputs (Null when Create new loan)\n    - Protocol Script Index: Int - Index of Protocol Script UTxO in reference inputs\n    - Protocol Config Index: Int - Index of Protocol Config UTxO in reference inputs\n    - Fee Out Index: Int - Index of Fee UTxO in outputs (Null when Fee = 0)","required":["multiAssets"],"properties":{"multiAssets":{"type":"array","minItems":0,"maxItems":100,"items":{"type":"object","required":["policyId","assets"],"properties":{"policyId":{"type":"string","description":"Policy Id of token","nullable":false},"assets":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"Asset Name of token","nullable":false},"value":{"type":"string","format":"bigint","description":"Token amount","nullable":false}}}}}}}}},"referenceInputs":{"type":"array","minItems":1,"maxItems":50,"description":"List of UTxO output reference required to be included in transaction as reference inputs","items":{"type":"object","required":["outRef","type"],"properties":{"outRef":{"type":"string","format":"{transactionHash}#{index}","nullable":false,"description":"Output Reference of UTxO"},"type":{"type":"string","enum":["POOL_SCRIPT","LOAN_SCRIPT","ORACLE_PRICE_SCRIPT","GLOBAL_CONFIG","ORACLE_PATH","ORACLE_PRICE","PROTOCOL_SCRIPT","PROTOCOL_CONFIG","ORCFAX_FSP","ORCFAX_FS","DANOGO_FLOAT_POOL","INDIGO","DJED","DANOGO_STAKING","MINSWAP_LP"],"description":"Type of UTxO OutRef, used for reference inputs and indexer in redeemer"}}}}}}}}]}}}},"default":{"description":"An unexpected error response","content":{"application/json":{"schema":{"title":"runtimeError","allOf":[{"title":"generic message response","type":"object","properties":{"code":{"type":"integer","description":"response code, 200 is success, other code is not success"},"traceId":{"type":"string","description":"Trace ID of the request (required when request is error).\nTrace ID is used to trace the root cause of the error quickly.\n- Why we need it?, please refer TDD: https://confluence.teko.vn/pages/viewpage.action?pageId=368467363\n- Distributed tracing guideline: https://confluence.teko.vn/display/PLAT/Code+example++Golang%2C+Python++for+distributed+tracing+with+Jaeger\n- Service mesh guideline: https://confluence.teko.vn/display/PLAT/Expose+metrics+for+kubernetes+services+by+service+mesh"},"message":{"type":"string","description":"response message"}}},{"type":"object","properties":{"error":{"type":"string","deprecated":true,"description":"do NOT use this field anymore! Use code & message instead!"},"details":{"type":"array","items":{"title":"protobufAny","type":"object","properties":{"typeUrl":{"type":"string","description":"A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Must be a valid serialized protocol buffer of the above specified type.","format":"byte"}},"description":"`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(&foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n\n  Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n  Example 4: Pack and unpack a message in Go\n\n      foo := &pb.Foo{...}\n      any, err := ptypes.MarshalAny(foo)\n      ...\n      foo := &pb.Foo{}\n      if err := ptypes.UnmarshalAny(any, foo); err != nil {\n        ...\n      }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": <string>,\n      \"lastName\": <string>\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"}}}}]}}}}}}}}}
```
