Documentation
¶
Index ¶
- type AavePosition
- func (a *AavePosition) GetApy() optionalnullable.OptionalNullable[string]
- func (a *AavePosition) GetBalance() *string
- func (a *AavePosition) GetDeposits() []DepositEvent
- func (a *AavePosition) GetPnl() optionalnullable.OptionalNullable[PositionPnL]
- func (a *AavePosition) GetReserveAddress() string
- func (a *AavePosition) GetReserveSymbol() string
- func (a *AavePosition) GetType() string
- func (a *AavePosition) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (a *AavePosition) GetWithdrawals() []WithdrawalEvent
- func (a AavePosition) MarshalJSON() ([]byte, error)
- func (a *AavePosition) UnmarshalJSON(data []byte) error
- type AaveVenue
- type AccountSummary
- func (a *AccountSummary) GetAvailableBorrowsUsd() string
- func (a *AccountSummary) GetEmodeCategoryID() *int64
- func (a *AccountSummary) GetEmodeLabel() optionalnullable.OptionalNullable[string]
- func (a *AccountSummary) GetHealthFactor() string
- func (a *AccountSummary) GetLtv() string
- func (a *AccountSummary) GetProtocol() *CreditProtocol
- func (a *AccountSummary) GetSubAccountID() optionalnullable.OptionalNullable[int64]
- func (a *AccountSummary) GetTotalCollateralUsd() string
- func (a *AccountSummary) GetTotalDebtUsd() string
- type ApproveTransferRequest
- type ApproveTransferResponse
- func (a *ApproveTransferResponse) GetEip712() optionalnullable.OptionalNullable[PermitTypedDataResponseOutput]
- func (a *ApproveTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (a ApproveTransferResponse) MarshalJSON() ([]byte, error)
- func (a *ApproveTransferResponse) UnmarshalJSON(data []byte) error
- type BatchedSafeOperationsResponseInput
- func (b *BatchedSafeOperationsResponseInput) GetDomain() CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
- func (b *BatchedSafeOperationsResponseInput) GetMessage() SafeTxMessage
- func (b *BatchedSafeOperationsResponseInput) GetPrimaryType() string
- func (b *BatchedSafeOperationsResponseInput) GetTypes() CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types
- func (b BatchedSafeOperationsResponseInput) MarshalJSON() ([]byte, error)
- func (b *BatchedSafeOperationsResponseInput) UnmarshalJSON(data []byte) error
- type BatchedSafeOperationsResponseOutput
- func (b *BatchedSafeOperationsResponseOutput) GetDomain() CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
- func (b *BatchedSafeOperationsResponseOutput) GetMessage() SafeTxMessage
- func (b *BatchedSafeOperationsResponseOutput) GetPrimaryType() string
- func (b *BatchedSafeOperationsResponseOutput) GetTypes() CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types
- func (b BatchedSafeOperationsResponseOutput) MarshalJSON() ([]byte, error)
- func (b *BatchedSafeOperationsResponseOutput) UnmarshalJSON(data []byte) error
- type BorrowAmount
- type BorrowAmountType
- type BorrowableToken
- func (b *BorrowableToken) GetBorrowApy() optionalnullable.OptionalNullable[string]
- func (b *BorrowableToken) GetMaxBorrowableAmount() string
- func (b *BorrowableToken) GetSymbol() string
- func (b *BorrowableToken) GetToken() string
- func (b *BorrowableToken) GetVault() optionalnullable.OptionalNullable[string]
- type Builder
- type Candle
- type Chain
- type ChainMarketInfo
- func (c *ChainMarketInfo) GetATokenAddress() string
- func (c *ChainMarketInfo) GetAddress() string
- func (c *ChainMarketInfo) GetAvailableLiquidity() string
- func (c *ChainMarketInfo) GetBorrowApy() string
- func (c *ChainMarketInfo) GetBorrowApyAvg() string
- func (c *ChainMarketInfo) GetIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (c *ChainMarketInfo) GetLiquidationThreshold() string
- func (c *ChainMarketInfo) GetLtv() string
- func (c *ChainMarketInfo) GetReserves() []ReserveInfo
- func (c *ChainMarketInfo) GetSupplyApy() string
- func (c *ChainMarketInfo) GetSupplyApyAvg() string
- func (c *ChainMarketInfo) GetTotalBorrowed() string
- func (c *ChainMarketInfo) GetUtilizationRate() string
- func (c ChainMarketInfo) MarshalJSON() ([]byte, error)
- func (c *ChainMarketInfo) UnmarshalJSON(data []byte) error
- type Classification
- type CollateralPosition
- func (c *CollateralPosition) GetAmountSupplied() *string
- func (c *CollateralPosition) GetEvents() []CreditEvent
- func (c *CollateralPosition) GetInterestEarned() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetIsPureSupply() optionalnullable.OptionalNullable[bool]
- func (c *CollateralPosition) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetMaxLtv() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetProtocol() *CreditProtocol
- func (c *CollateralPosition) GetSubAccountID() optionalnullable.OptionalNullable[int64]
- func (c *CollateralPosition) GetSupplyApy() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetSymbol() string
- func (c *CollateralPosition) GetToken() string
- func (c *CollateralPosition) GetTotalDeposited() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetTotalWithdrawn() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (c *CollateralPosition) GetVault() optionalnullable.OptionalNullable[string]
- func (c CollateralPosition) MarshalJSON() ([]byte, error)
- func (c *CollateralPosition) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsBalancesTokenBalance
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalance() string
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalanceFormatted() string
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenAddress() string
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenDecimals() int64
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenSymbol() string
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTransfers() []TokenTransfer
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (c CompassAPIBackendV2ModelsBalancesTokenBalance) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy7d() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy30d() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy90d() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetBalance() *string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetDeposits() []DepositEvent
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetPnl() optionalnullable.OptionalNullable[PositionPnL]
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetType() string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingAddress() string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingSymbol() string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultAddress() string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultName() string
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetWithdrawals() []WithdrawalEvent
- func (c CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetChainID() int64
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetName() *string
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetVerifyingContract() string
- func (c CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetEip712Domain() []Eip712Field
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetPermitTransferFrom() []Eip712Field
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetTokenPermissions() []Eip712Field
- func (c CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetChainID() int64
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetName() string
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVerifyingContract() string
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVersion() string
- func (c CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetEip712Domain() []Eip712DomainField
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetPermit() []PermitField
- func (c CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetChainID() int64
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetVerifyingContract() string
- func (c CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetEip712Domain() []Eip712DomainField
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetSafeTx() []SafeTxField
- func (c CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy7d() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy30d() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetAssetClass() TokenizedAssetClass
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChain() Chain
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hPct() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hUsd() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetContractAddress() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetCurrentPriceUsd() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetDecimals() int64
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetName() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetProvider() TokenizedAssetProvider
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRegionExposure() []string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRestrictedJurisdictions() []string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSectors() []string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetStatus() optionalnullable.OptionalNullable[TradingStatus]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSymbol() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetTvlUsd() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetUnderlyingTicker() string
- func (c CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) UnmarshalJSON(data []byte) error
- type CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetAssetClass() *TokenizedAssetClass
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalance() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalanceUsd() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetChain() *Chain
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetContractAddress() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetCurrentPriceUsd() optionalnullable.OptionalNullable[string]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetDecimals() int64
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetEvents() []TokenizedAssetsActivityEvent
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetName() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetPnl() optionalnullable.OptionalNullable[TokenizedAssetsPnl]
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetProvider() *TokenizedAssetProvider
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetSymbol() string
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetUnderlyingTicker() string
- func (c CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) MarshalJSON() ([]byte, error)
- func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) UnmarshalJSON(data []byte) error
- type CreateAccountRequest
- type CreateAccountRequestChain
- type CreateAccountResponse
- type CreateCreditAccountRequest
- type CreateCreditAccountRequestChain
- type CreateCreditAccountResponse
- type CreateTokenizedAssetsAccountRequest
- type CreateTokenizedAssetsAccountResponse
- type CreditBalancesResponse
- func (c *CreditBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
- func (c *CreditBalancesResponse) GetCreditAccountAddress() string
- func (c *CreditBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
- func (c CreditBalancesResponse) MarshalJSON() ([]byte, error)
- func (c *CreditBalancesResponse) UnmarshalJSON(data []byte) error
- type CreditBorrowParams
- func (c *CreditBorrowParams) GetActionType() *string
- func (c *CreditBorrowParams) GetAmount() CreditBorrowParamsAmount
- func (c *CreditBorrowParams) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowParams) GetFee() optionalnullable.OptionalNullable[CreditFee]
- func (c *CreditBorrowParams) GetInterestRateMode() *InterestRateMode
- func (c *CreditBorrowParams) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowParams) GetProtocol() *CreditProtocol
- func (c *CreditBorrowParams) GetSubAccountID() *int64
- func (c *CreditBorrowParams) GetToken() string
- func (c CreditBorrowParams) MarshalJSON() ([]byte, error)
- func (c *CreditBorrowParams) UnmarshalJSON(data []byte) error
- type CreditBorrowParamsAmount
- type CreditBorrowParamsAmountType
- type CreditBorrowRequest
- func (c *CreditBorrowRequest) GetAmountIn() optionalnullable.OptionalNullable[CreditBorrowRequestAmountIn]
- func (c *CreditBorrowRequest) GetBorrowAmount() BorrowAmount
- func (c *CreditBorrowRequest) GetBorrowToken() string
- func (c *CreditBorrowRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowRequest) GetChain() CreditBorrowRequestChain
- func (c *CreditBorrowRequest) GetCollateralToken() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowRequest) GetFee() optionalnullable.OptionalNullable[CreditFee]
- func (c *CreditBorrowRequest) GetGasSponsorship() *bool
- func (c *CreditBorrowRequest) GetInterestRateMode() *InterestRateMode
- func (c *CreditBorrowRequest) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowRequest) GetOwner() string
- func (c *CreditBorrowRequest) GetPermit2Deadline() optionalnullable.OptionalNullable[int64]
- func (c *CreditBorrowRequest) GetPermit2Nonce() optionalnullable.OptionalNullable[int64]
- func (c *CreditBorrowRequest) GetPermit2Signature() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowRequest) GetProtocol() *CreditProtocol
- func (c *CreditBorrowRequest) GetSlippage() *CreditBorrowRequestSlippage
- func (c *CreditBorrowRequest) GetSubAccountID() *int64
- func (c *CreditBorrowRequest) GetTokenIn() optionalnullable.OptionalNullable[string]
- func (c CreditBorrowRequest) MarshalJSON() ([]byte, error)
- func (c *CreditBorrowRequest) UnmarshalJSON(data []byte) error
- type CreditBorrowRequestAmountIn
- type CreditBorrowRequestAmountInType
- type CreditBorrowRequestChain
- type CreditBorrowRequestSlippage
- type CreditBorrowRequestSlippageType
- type CreditBorrowResponse
- func (c *CreditBorrowResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditBorrowResponse) GetEstimatedCollateralAmount() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowResponse) GetFeeAmount() optionalnullable.OptionalNullable[string]
- func (c *CreditBorrowResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditBorrowResponse) MarshalJSON() ([]byte, error)
- func (c *CreditBorrowResponse) UnmarshalJSON(data []byte) error
- type CreditBundleRequest
- type CreditBundleRequestChain
- type CreditBundleResponse
- func (c *CreditBundleResponse) GetActionsCount() int64
- func (c *CreditBundleResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditBundleResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditBundleResponse) MarshalJSON() ([]byte, error)
- func (c *CreditBundleResponse) UnmarshalJSON(data []byte) error
- type CreditEnableCollateralParams
- func (c *CreditEnableCollateralParams) GetActionType() *string
- func (c *CreditEnableCollateralParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditEnableCollateralParams) GetProtocol() *CreditProtocol
- func (c *CreditEnableCollateralParams) GetSubAccountID() *int64
- func (c *CreditEnableCollateralParams) GetToken() string
- func (c CreditEnableCollateralParams) MarshalJSON() ([]byte, error)
- func (c *CreditEnableCollateralParams) UnmarshalJSON(data []byte) error
- type CreditEvent
- func (c *CreditEvent) GetAmount() string
- func (c *CreditEvent) GetBlockNumber() int64
- func (c *CreditEvent) GetBlockTimestamp() time.Time
- func (c *CreditEvent) GetEventType() CreditEventEventType
- func (c *CreditEvent) GetSymbol() string
- func (c *CreditEvent) GetTransactionHash() string
- func (c CreditEvent) MarshalJSON() ([]byte, error)
- func (c *CreditEvent) UnmarshalJSON(data []byte) error
- type CreditEventEventType
- type CreditFee
- type CreditFeeAmount
- type CreditFeeAmountType
- type CreditFeeDenomination
- type CreditLoopPreview
- func (c *CreditLoopPreview) GetAchievedMultiplier() string
- func (c *CreditLoopPreview) GetEstimatedMaxDust() string
- func (c *CreditLoopPreview) GetEstimatedSwapCost() string
- func (c *CreditLoopPreview) GetIterations() int64
- func (c *CreditLoopPreview) GetLegs() []LoopLegPreview
- func (c *CreditLoopPreview) GetProjectedHealthFactor() string
- func (c *CreditLoopPreview) GetProjectedLtv() string
- func (c *CreditLoopPreview) GetTotalBorrowed() string
- func (c *CreditLoopPreview) GetTotalCollateralSupplied() string
- func (c CreditLoopPreview) MarshalJSON() ([]byte, error)
- func (c *CreditLoopPreview) UnmarshalJSON(data []byte) error
- type CreditLoopRequest
- func (c *CreditLoopRequest) GetBorrowToken() string
- func (c *CreditLoopRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditLoopRequest) GetChain() CreditLoopRequestChain
- func (c *CreditLoopRequest) GetCollateralToken() string
- func (c *CreditLoopRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditLoopRequest) GetEmodeCategory() optionalnullable.OptionalNullable[int64]
- func (c *CreditLoopRequest) GetGasSponsorship() *bool
- func (c *CreditLoopRequest) GetInitialCollateralAmount() InitialCollateralAmount
- func (c *CreditLoopRequest) GetLoanToValue() LoanToValue
- func (c *CreditLoopRequest) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditLoopRequest) GetMaxSlippagePercent() *CreditLoopRequestMaxSlippagePercent
- func (c *CreditLoopRequest) GetMultiplier() Multiplier
- func (c *CreditLoopRequest) GetOwner() string
- func (c *CreditLoopRequest) GetPreview() *bool
- func (c *CreditLoopRequest) GetPricing() *CreditLoopRequestPricing
- func (c *CreditLoopRequest) GetProtocol() *CreditProtocol
- func (c *CreditLoopRequest) GetSubAccountID() *int64
- type CreditLoopRequestChain
- type CreditLoopRequestMaxSlippagePercent
- type CreditLoopRequestMaxSlippagePercentType
- type CreditLoopRequestPricing
- type CreditLoopResponse
- func (c *CreditLoopResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditLoopResponse) GetMaxFirmMultiplier() optionalnullable.OptionalNullable[string]
- func (c *CreditLoopResponse) GetPreview() *CreditLoopPreview
- func (c *CreditLoopResponse) GetQuoteExpiresAt() optionalnullable.OptionalNullable[time.Time]
- func (c *CreditLoopResponse) GetSwapProvider() *CreditLoopResponseSwapProvider
- func (c *CreditLoopResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditLoopResponse) MarshalJSON() ([]byte, error)
- func (c *CreditLoopResponse) UnmarshalJSON(data []byte) error
- type CreditLoopResponseSwapProvider
- type CreditLoopedPositionsResponse
- func (c *CreditLoopedPositionsResponse) GetAaveAccountSummary() optionalnullable.OptionalNullable[AccountSummary]
- func (c *CreditLoopedPositionsResponse) GetCreditAccountAddress() string
- func (c *CreditLoopedPositionsResponse) GetPositions() []LoopedPosition
- func (c CreditLoopedPositionsResponse) MarshalJSON() ([]byte, error)
- func (c *CreditLoopedPositionsResponse) UnmarshalJSON(data []byte) error
- type CreditPositionsResponse
- func (c *CreditPositionsResponse) GetAccountSummary() AccountSummary
- func (c *CreditPositionsResponse) GetBorrowableTokens() []BorrowableToken
- func (c *CreditPositionsResponse) GetCollateralPositions() []CollateralPosition
- func (c *CreditPositionsResponse) GetDebtPositions() []DebtPosition
- func (c *CreditPositionsResponse) GetEulerAccountSummaries() []AccountSummary
- func (c *CreditPositionsResponse) GetEulerAccountSummary() optionalnullable.OptionalNullable[AccountSummary]
- func (c *CreditPositionsResponse) GetEulerBorrowableTokens() []BorrowableToken
- func (c *CreditPositionsResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
- func (c CreditPositionsResponse) MarshalJSON() ([]byte, error)
- func (c *CreditPositionsResponse) UnmarshalJSON(data []byte) error
- type CreditProtocol
- type CreditRebalancePreview
- func (c *CreditRebalancePreview) GetAaveAccountHealthFactor() optionalnullable.OptionalNullable[string]
- func (c *CreditRebalancePreview) GetEstimatedMaxDust() string
- func (c *CreditRebalancePreview) GetNetEquityMovedUsd() string
- func (c *CreditRebalancePreview) GetPerTarget() []RebalanceTargetPreview
- func (c *CreditRebalancePreview) GetRoutingSwaps() []RoutingSwapPreview
- func (c *CreditRebalancePreview) GetTotalLegs() int64
- func (c CreditRebalancePreview) MarshalJSON() ([]byte, error)
- func (c *CreditRebalancePreview) UnmarshalJSON(data []byte) error
- type CreditRebalanceRequest
- func (c *CreditRebalanceRequest) GetChain() CreditRebalanceRequestChain
- func (c *CreditRebalanceRequest) GetGasSponsorship() *bool
- func (c *CreditRebalanceRequest) GetMaxSlippagePercent() *CreditRebalanceRequestMaxSlippagePercent
- func (c *CreditRebalanceRequest) GetOwner() string
- func (c *CreditRebalanceRequest) GetTargets() []RebalanceTarget
- type CreditRebalanceRequestChain
- type CreditRebalanceRequestMaxSlippagePercent
- type CreditRebalanceRequestMaxSlippagePercentType
- type CreditRebalanceResponse
- func (c *CreditRebalanceResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditRebalanceResponse) GetPreview() CreditRebalancePreview
- func (c *CreditRebalanceResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditRebalanceResponse) MarshalJSON() ([]byte, error)
- func (c *CreditRebalanceResponse) UnmarshalJSON(data []byte) error
- type CreditRepayParams
- func (c *CreditRepayParams) GetActionType() *string
- func (c *CreditRepayParams) GetAmount() CreditRepayParamsAmount
- func (c *CreditRepayParams) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayParams) GetInterestRateMode() *InterestRateMode
- func (c *CreditRepayParams) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayParams) GetProtocol() *CreditProtocol
- func (c *CreditRepayParams) GetSubAccountID() *int64
- func (c *CreditRepayParams) GetToken() string
- func (c CreditRepayParams) MarshalJSON() ([]byte, error)
- func (c *CreditRepayParams) UnmarshalJSON(data []byte) error
- type CreditRepayParamsAmount
- type CreditRepayParamsAmountType
- type CreditRepayRequest
- func (c *CreditRepayRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayRequest) GetChain() CreditRepayRequestChain
- func (c *CreditRepayRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayRequest) GetGasSponsorship() *bool
- func (c *CreditRepayRequest) GetInterestRateMode() *InterestRateMode
- func (c *CreditRepayRequest) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayRequest) GetOwner() string
- func (c *CreditRepayRequest) GetPermit2Deadline() optionalnullable.OptionalNullable[int64]
- func (c *CreditRepayRequest) GetPermit2Nonce() optionalnullable.OptionalNullable[int64]
- func (c *CreditRepayRequest) GetPermit2Signature() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayRequest) GetProtocol() *CreditProtocol
- func (c *CreditRepayRequest) GetRepayAmount() RepayAmount
- func (c *CreditRepayRequest) GetRepayToken() string
- func (c *CreditRepayRequest) GetSlippage() *CreditRepayRequestSlippage
- func (c *CreditRepayRequest) GetSubAccountID() *int64
- func (c *CreditRepayRequest) GetTokenOut() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayRequest) GetWithdrawAmount() optionalnullable.OptionalNullable[WithdrawAmount]
- func (c *CreditRepayRequest) GetWithdrawToken() optionalnullable.OptionalNullable[string]
- type CreditRepayRequestChain
- type CreditRepayRequestSlippage
- type CreditRepayRequestSlippageType
- type CreditRepayResponse
- func (c *CreditRepayResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditRepayResponse) GetEstimatedTokenOutAmount() optionalnullable.OptionalNullable[string]
- func (c *CreditRepayResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditRepayResponse) MarshalJSON() ([]byte, error)
- func (c *CreditRepayResponse) UnmarshalJSON(data []byte) error
- type CreditSupplyParams
- func (c *CreditSupplyParams) GetActionType() *string
- func (c *CreditSupplyParams) GetAmount() CreditSupplyParamsAmount
- func (c *CreditSupplyParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditSupplyParams) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditSupplyParams) GetProtocol() *CreditProtocol
- func (c *CreditSupplyParams) GetSubAccountID() *int64
- func (c *CreditSupplyParams) GetToken() string
- func (c CreditSupplyParams) MarshalJSON() ([]byte, error)
- func (c *CreditSupplyParams) UnmarshalJSON(data []byte) error
- type CreditSupplyParamsAmount
- type CreditSupplyParamsAmountType
- type CreditTransferRequest
- func (c *CreditTransferRequest) GetAction() CreditTransferRequestAction
- func (c *CreditTransferRequest) GetAmount() CreditTransferRequestAmount
- func (c *CreditTransferRequest) GetChain() CreditTransferRequestChain
- func (c *CreditTransferRequest) GetGasSponsorship() *bool
- func (c *CreditTransferRequest) GetOwner() string
- func (c *CreditTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
- func (c *CreditTransferRequest) GetToken() string
- type CreditTransferRequestAction
- type CreditTransferRequestAmount
- type CreditTransferRequestAmountType
- type CreditTransferRequestChain
- type CreditTransferResponse
- func (c *CreditTransferResponse) GetEip712() optionalnullable.OptionalNullable[CreditTransferResponseEip712]
- func (c *CreditTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditTransferResponse) MarshalJSON() ([]byte, error)
- func (c *CreditTransferResponse) UnmarshalJSON(data []byte) error
- type CreditTransferResponseEip712
- func CreateCreditTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) CreditTransferResponseEip712
- func CreateCreditTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) CreditTransferResponseEip712
- func CreateCreditTransferResponseEip712Unknown(raw json.RawMessage) CreditTransferResponseEip712
- type CreditTransferResponseEip712Type
- type CreditTransferToAddressParams
- func (c *CreditTransferToAddressParams) GetActionType() *string
- func (c *CreditTransferToAddressParams) GetAmount() CreditTransferToAddressParamsAmount
- func (c *CreditTransferToAddressParams) GetRecipient() string
- func (c *CreditTransferToAddressParams) GetToken() string
- func (c CreditTransferToAddressParams) MarshalJSON() ([]byte, error)
- func (c *CreditTransferToAddressParams) UnmarshalJSON(data []byte) error
- type CreditTransferToAddressParamsAmount
- type CreditTransferToAddressParamsAmountType
- type CreditUnloopPreview
- func (c *CreditUnloopPreview) GetEndingCollateral() string
- func (c *CreditUnloopPreview) GetEndingDebt() string
- func (c *CreditUnloopPreview) GetEndingMultiplier() string
- func (c *CreditUnloopPreview) GetEstimatedMaxDust() string
- func (c *CreditUnloopPreview) GetFullyUnwound() bool
- func (c *CreditUnloopPreview) GetIterations() int64
- func (c *CreditUnloopPreview) GetLegs() []UnloopLegPreview
- func (c *CreditUnloopPreview) GetProjectedHealthFactor() string
- func (c *CreditUnloopPreview) GetProjectedLtv() string
- func (c *CreditUnloopPreview) GetTotalCollateralWithdrawn() string
- func (c *CreditUnloopPreview) GetTotalDebtRepaid() string
- func (c CreditUnloopPreview) MarshalJSON() ([]byte, error)
- func (c *CreditUnloopPreview) UnmarshalJSON(data []byte) error
- type CreditUnloopRequest
- func (c *CreditUnloopRequest) GetAllowPartial() *bool
- func (c *CreditUnloopRequest) GetBorrowToken() string
- func (c *CreditUnloopRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
- func (c *CreditUnloopRequest) GetChain() CreditUnloopRequestChain
- func (c *CreditUnloopRequest) GetCollateralToken() string
- func (c *CreditUnloopRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditUnloopRequest) GetGasSponsorship() *bool
- func (c *CreditUnloopRequest) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditUnloopRequest) GetMaxSlippagePercent() *CreditUnloopRequestMaxSlippagePercent
- func (c *CreditUnloopRequest) GetOwner() string
- func (c *CreditUnloopRequest) GetPreview() *bool
- func (c *CreditUnloopRequest) GetPricing() *CreditUnloopRequestPricing
- func (c *CreditUnloopRequest) GetProtocol() *CreditProtocol
- func (c *CreditUnloopRequest) GetSubAccountID() *int64
- func (c *CreditUnloopRequest) GetTargetMultiplier() optionalnullable.OptionalNullable[CreditUnloopRequestTargetMultiplier]
- type CreditUnloopRequestChain
- type CreditUnloopRequestMaxSlippagePercent
- type CreditUnloopRequestMaxSlippagePercentType
- type CreditUnloopRequestPricing
- type CreditUnloopRequestTargetMultiplier
- type CreditUnloopRequestTargetMultiplierType
- type CreditUnloopResponse
- func (c *CreditUnloopResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (c *CreditUnloopResponse) GetFirmAvailable() optionalnullable.OptionalNullable[bool]
- func (c *CreditUnloopResponse) GetPreview() *CreditUnloopPreview
- func (c *CreditUnloopResponse) GetQuoteExpiresAt() optionalnullable.OptionalNullable[time.Time]
- func (c *CreditUnloopResponse) GetSwapProvider() *CreditUnloopResponseSwapProvider
- func (c *CreditUnloopResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (c CreditUnloopResponse) MarshalJSON() ([]byte, error)
- func (c *CreditUnloopResponse) UnmarshalJSON(data []byte) error
- type CreditUnloopResponseSwapProvider
- type CreditUserOperation
- func (c *CreditUserOperation) GetBody() CreditUserOperationBody
- func (c *CreditUserOperation) GetBodyCreditBorrow() *CreditBorrowParams
- func (c *CreditUserOperation) GetBodyCreditEnableCollateral() *CreditEnableCollateralParams
- func (c *CreditUserOperation) GetBodyCreditRepay() *CreditRepayParams
- func (c *CreditUserOperation) GetBodyCreditSupply() *CreditSupplyParams
- func (c *CreditUserOperation) GetBodyCreditTransferToAddress() *CreditTransferToAddressParams
- func (c *CreditUserOperation) GetBodyCreditWithdraw() *CreditWithdrawParams
- func (c *CreditUserOperation) GetBodyV2Swap() *EarnSwapParams
- func (c *CreditUserOperation) GetBodyV2TransferFromEoa() *EarnTransferFromEOAParams
- func (c *CreditUserOperation) GetBodyV2TransferToEoa() *EarnTransferToEOAParams
- type CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditBorrow(creditBorrow CreditBorrowParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditEnableCollateral(creditEnableCollateral CreditEnableCollateralParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditRepay(creditRepay CreditRepayParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditSupply(creditSupply CreditSupplyParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditTransferToAddress(creditTransferToAddress CreditTransferToAddressParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyCreditWithdraw(creditWithdraw CreditWithdrawParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyV2Swap(v2Swap EarnSwapParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyV2TransferFromEoa(v2TransferFromEoa EarnTransferFromEOAParams) CreditUserOperationBody
- func CreateCreditUserOperationBodyV2TransferToEoa(v2TransferToEoa EarnTransferToEOAParams) CreditUserOperationBody
- type CreditUserOperationBodyType
- type CreditWithdrawParams
- func (c *CreditWithdrawParams) GetActionType() *string
- func (c *CreditWithdrawParams) GetAmount() CreditWithdrawParamsAmount
- func (c *CreditWithdrawParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
- func (c *CreditWithdrawParams) GetMarketID() optionalnullable.OptionalNullable[string]
- func (c *CreditWithdrawParams) GetProtocol() *CreditProtocol
- func (c *CreditWithdrawParams) GetSubAccountID() *int64
- func (c *CreditWithdrawParams) GetToken() string
- func (c CreditWithdrawParams) MarshalJSON() ([]byte, error)
- func (c *CreditWithdrawParams) UnmarshalJSON(data []byte) error
- type CreditWithdrawParamsAmount
- type CreditWithdrawParamsAmountType
- type DebtPosition
- func (d *DebtPosition) GetAmountBorrowed() *string
- func (d *DebtPosition) GetBorrowApy() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetEvents() []CreditEvent
- func (d *DebtPosition) GetHealthFactor() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetInterestPaid() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetMarketID() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetProtocol() *CreditProtocol
- func (d *DebtPosition) GetSubAccountID() optionalnullable.OptionalNullable[int64]
- func (d *DebtPosition) GetSymbol() string
- func (d *DebtPosition) GetToken() string
- func (d *DebtPosition) GetTotalBorrowed() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetTotalRepaid() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (d *DebtPosition) GetVault() optionalnullable.OptionalNullable[string]
- func (d DebtPosition) MarshalJSON() ([]byte, error)
- func (d *DebtPosition) UnmarshalJSON(data []byte) error
- type DepositEvent
- func (d *DepositEvent) GetBlockNumber() int64
- func (d *DepositEvent) GetBlockTimestamp() time.Time
- func (d *DepositEvent) GetCostPerUnit() string
- func (d *DepositEvent) GetInputAmount() string
- func (d *DepositEvent) GetInputSymbol() string
- func (d *DepositEvent) GetOutputAmount() string
- func (d *DepositEvent) GetOutputSymbol() string
- func (d *DepositEvent) GetTransactionHash() string
- func (d DepositEvent) MarshalJSON() ([]byte, error)
- func (d *DepositEvent) UnmarshalJSON(data []byte) error
- type Direction
- type EarnBalancesResponse
- func (e *EarnBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
- func (e *EarnBalancesResponse) GetEarnAccountAddress() string
- func (e *EarnBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
- func (e EarnBalancesResponse) MarshalJSON() ([]byte, error)
- func (e *EarnBalancesResponse) UnmarshalJSON(data []byte) error
- type EarnManageParams
- func (e *EarnManageParams) GetAction() EarnManageParamsAction
- func (e *EarnManageParams) GetActionType() *string
- func (e *EarnManageParams) GetAmount() EarnManageParamsAmount
- func (e *EarnManageParams) GetFee() optionalnullable.OptionalNullable[Fee]
- func (e *EarnManageParams) GetVenue() EarnManageParamsVenue
- func (e *EarnManageParams) GetVenueAave() *AaveVenue
- func (e *EarnManageParams) GetVenuePendlePt() *PendlePTVenue
- func (e *EarnManageParams) GetVenueVault() *VaultVenue
- func (e EarnManageParams) MarshalJSON() ([]byte, error)
- func (e *EarnManageParams) UnmarshalJSON(data []byte) error
- type EarnManageParamsAction
- type EarnManageParamsAmount
- type EarnManageParamsAmountType
- type EarnManageParamsVenue
- type EarnManageParamsVenueType
- type EarnManageRequest
- func (e *EarnManageRequest) GetAction() EarnManageRequestAction
- func (e *EarnManageRequest) GetActionType() *string
- func (e *EarnManageRequest) GetAmount() EarnManageRequestAmount
- func (e *EarnManageRequest) GetChain() Chain
- func (e *EarnManageRequest) GetFee() optionalnullable.OptionalNullable[Fee]
- func (e *EarnManageRequest) GetGasSponsorship() *bool
- func (e *EarnManageRequest) GetOwner() string
- func (e *EarnManageRequest) GetVenue() EarnManageRequestVenue
- func (e *EarnManageRequest) GetVenueAave() *AaveVenue
- func (e *EarnManageRequest) GetVenuePendlePt() *PendlePTVenue
- func (e *EarnManageRequest) GetVenueVault() *VaultVenue
- func (e EarnManageRequest) MarshalJSON() ([]byte, error)
- func (e *EarnManageRequest) UnmarshalJSON(data []byte) error
- type EarnManageRequestAction
- type EarnManageRequestAmount
- type EarnManageRequestAmountType
- type EarnManageRequestVenue
- type EarnManageRequestVenueType
- type EarnManageResponse
- func (e *EarnManageResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (e *EarnManageResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (e EarnManageResponse) MarshalJSON() ([]byte, error)
- func (e *EarnManageResponse) UnmarshalJSON(data []byte) error
- type EarnPositionsAllResponse
- type EarnPositionsResponse
- func (e *EarnPositionsResponse) GetAave() []AavePosition
- func (e *EarnPositionsResponse) GetPendlePt() []PendlePTPosition
- func (e *EarnPositionsResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
- func (e *EarnPositionsResponse) GetVaults() []CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition
- func (e EarnPositionsResponse) MarshalJSON() ([]byte, error)
- func (e *EarnPositionsResponse) UnmarshalJSON(data []byte) error
- type EarnSwapParams
- func (e *EarnSwapParams) GetActionType() *string
- func (e *EarnSwapParams) GetAmountIn() EarnSwapParamsAmountIn
- func (e *EarnSwapParams) GetSlippage() *EarnSwapParamsSlippage
- func (e *EarnSwapParams) GetTokenIn() string
- func (e *EarnSwapParams) GetTokenOut() string
- func (e EarnSwapParams) MarshalJSON() ([]byte, error)
- func (e *EarnSwapParams) UnmarshalJSON(data []byte) error
- type EarnSwapParamsAmountIn
- type EarnSwapParamsAmountInType
- type EarnSwapParamsSlippage
- type EarnSwapParamsSlippageType
- type EarnSwapQuoteResponse
- type EarnSwapRequest
- func (e *EarnSwapRequest) GetActionType() *string
- func (e *EarnSwapRequest) GetAmountIn() EarnSwapRequestAmountIn
- func (e *EarnSwapRequest) GetChain() Chain
- func (e *EarnSwapRequest) GetGasSponsorship() *bool
- func (e *EarnSwapRequest) GetOwner() string
- func (e *EarnSwapRequest) GetSlippage() *EarnSwapRequestSlippage
- func (e *EarnSwapRequest) GetTokenIn() string
- func (e *EarnSwapRequest) GetTokenOut() string
- func (e EarnSwapRequest) MarshalJSON() ([]byte, error)
- func (e *EarnSwapRequest) UnmarshalJSON(data []byte) error
- type EarnSwapRequestAmountIn
- type EarnSwapRequestAmountInType
- type EarnSwapRequestSlippage
- type EarnSwapRequestSlippageType
- type EarnSwapResponse
- func (e *EarnSwapResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (e *EarnSwapResponse) GetEstimatedAmountOut() string
- func (e *EarnSwapResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (e EarnSwapResponse) MarshalJSON() ([]byte, error)
- func (e *EarnSwapResponse) UnmarshalJSON(data []byte) error
- type EarnTransferFromEOAParams
- func (e *EarnTransferFromEOAParams) GetActionType() *string
- func (e *EarnTransferFromEOAParams) GetAmount() EarnTransferFromEOAParamsAmount
- func (e *EarnTransferFromEOAParams) GetPermit2Deadline() int64
- func (e *EarnTransferFromEOAParams) GetPermit2Nonce() int64
- func (e *EarnTransferFromEOAParams) GetPermit2Signature() string
- func (e *EarnTransferFromEOAParams) GetToken() string
- func (e EarnTransferFromEOAParams) MarshalJSON() ([]byte, error)
- func (e *EarnTransferFromEOAParams) UnmarshalJSON(data []byte) error
- type EarnTransferFromEOAParamsAmount
- type EarnTransferFromEOAParamsAmountType
- type EarnTransferRequest
- func (e *EarnTransferRequest) GetAction() EarnTransferRequestAction
- func (e *EarnTransferRequest) GetAmount() EarnTransferRequestAmount
- func (e *EarnTransferRequest) GetChain() Chain
- func (e *EarnTransferRequest) GetGasSponsorship() *bool
- func (e *EarnTransferRequest) GetOwner() string
- func (e *EarnTransferRequest) GetRecipient() optionalnullable.OptionalNullable[string]
- func (e *EarnTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
- func (e *EarnTransferRequest) GetToken() string
- type EarnTransferRequestAction
- type EarnTransferRequestAmount
- type EarnTransferRequestAmountType
- type EarnTransferResponse
- func (e *EarnTransferResponse) GetEip712() optionalnullable.OptionalNullable[EarnTransferResponseEip712]
- func (e *EarnTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (e EarnTransferResponse) MarshalJSON() ([]byte, error)
- func (e *EarnTransferResponse) UnmarshalJSON(data []byte) error
- type EarnTransferResponseEip712
- func CreateEarnTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) EarnTransferResponseEip712
- func CreateEarnTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) EarnTransferResponseEip712
- func CreateEarnTransferResponseEip712Unknown(raw json.RawMessage) EarnTransferResponseEip712
- type EarnTransferResponseEip712Type
- type EarnTransferToAddressParams
- func (e *EarnTransferToAddressParams) GetActionType() *string
- func (e *EarnTransferToAddressParams) GetAmount() EarnTransferToAddressParamsAmount
- func (e *EarnTransferToAddressParams) GetRecipient() string
- func (e *EarnTransferToAddressParams) GetToken() string
- func (e EarnTransferToAddressParams) MarshalJSON() ([]byte, error)
- func (e *EarnTransferToAddressParams) UnmarshalJSON(data []byte) error
- type EarnTransferToAddressParamsAmount
- type EarnTransferToAddressParamsAmountType
- type EarnTransferToEOAParams
- func (e *EarnTransferToEOAParams) GetActionType() *string
- func (e *EarnTransferToEOAParams) GetAmount() EarnTransferToEOAParamsAmount
- func (e *EarnTransferToEOAParams) GetToken() string
- func (e EarnTransferToEOAParams) MarshalJSON() ([]byte, error)
- func (e *EarnTransferToEOAParams) UnmarshalJSON(data []byte) error
- type EarnTransferToEOAParamsAmount
- type EarnTransferToEOAParamsAmountType
- type Eip712DomainField
- type Eip712Field
- type EulerMarket
- func (e *EulerMarket) GetAsset() string
- func (e *EulerMarket) GetAssetDecimals() int64
- func (e *EulerMarket) GetAssetPriceUsd() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetAssetSymbol() string
- func (e *EulerMarket) GetAvailableLiquidity() string
- func (e *EulerMarket) GetBorrowApy() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetBorrowCap() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetCollaterals() []EulerMarketCollateral
- func (e *EulerMarket) GetSupplyApy() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetSupplyCap() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetTotalBorrowAssets() string
- func (e *EulerMarket) GetTotalSupplyAssets() string
- func (e *EulerMarket) GetUnitOfAccountSymbol() optionalnullable.OptionalNullable[string]
- func (e *EulerMarket) GetUtilization() string
- func (e *EulerMarket) GetVault() string
- func (e *EulerMarket) GetVaultSymbol() string
- func (e EulerMarket) MarshalJSON() ([]byte, error)
- func (e *EulerMarket) UnmarshalJSON(data []byte) error
- type EulerMarketCollateral
- func (e *EulerMarketCollateral) GetAsset() string
- func (e *EulerMarketCollateral) GetAssetDecimals() int64
- func (e *EulerMarketCollateral) GetAssetPriceUsd() optionalnullable.OptionalNullable[string]
- func (e *EulerMarketCollateral) GetAssetSymbol() string
- func (e *EulerMarketCollateral) GetBorrowLtv() string
- func (e *EulerMarketCollateral) GetLiquidationLtv() string
- func (e *EulerMarketCollateral) GetSupplyApy() optionalnullable.OptionalNullable[string]
- func (e *EulerMarketCollateral) GetVault() string
- type EulerMarketsResponse
- type Fee
- type FeeAmount
- type FeeAmountType
- type FeeDenomination
- type HTTPMetadata
- type InitialCollateralAmount
- type InitialCollateralAmountType
- type InterestRateMode
- type ListAaveMarketsResponse
- type LoanToValue
- type LoanToValueType
- type Loc
- type LocType
- type LoopLegPreview
- func (l *LoopLegPreview) GetBorrowAmount() optionalnullable.OptionalNullable[string]
- func (l *LoopLegPreview) GetExpectedSwapOut() optionalnullable.OptionalNullable[string]
- func (l *LoopLegPreview) GetMinSwapOut() optionalnullable.OptionalNullable[string]
- func (l *LoopLegPreview) GetSupplyAmount() *string
- type LoopedPosition
- func (l *LoopedPosition) GetClosedAt() optionalnullable.OptionalNullable[time.Time]
- func (l *LoopedPosition) GetCollateralSymbol() string
- func (l *LoopedPosition) GetCollateralToken() string
- func (l *LoopedPosition) GetCurrent() optionalnullable.OptionalNullable[LoopedPositionCurrentState]
- func (l *LoopedPosition) GetDebtSymbol() string
- func (l *LoopedPosition) GetDebtToken() string
- func (l *LoopedPosition) GetHistory() []LoopedPositionHistoryEntry
- func (l *LoopedPosition) GetMarketID() optionalnullable.OptionalNullable[string]
- func (l *LoopedPosition) GetOpenedAt() time.Time
- func (l *LoopedPosition) GetProtocol() CreditProtocol
- func (l *LoopedPosition) GetStatus() LoopedPositionStatus
- func (l *LoopedPosition) GetTotals() LoopedPositionTotals
- func (l LoopedPosition) MarshalJSON() ([]byte, error)
- func (l *LoopedPosition) UnmarshalJSON(data []byte) error
- type LoopedPositionCurrentState
- func (l *LoopedPositionCurrentState) GetBorrowApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetBorrowIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetBorrowLendingApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetCollateralAmount() *string
- func (l *LoopedPositionCurrentState) GetCollateralApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetCollateralIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetCollateralLendingApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetCollateralUsd() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetDebtAmount() *string
- func (l *LoopedPositionCurrentState) GetDebtUsd() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetHealthFactor() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetHealthFactorScope() LoopedPositionCurrentStateHealthFactorScope
- func (l *LoopedPositionCurrentState) GetLeverage() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetNetApy() optionalnullable.OptionalNullable[string]
- func (l *LoopedPositionCurrentState) GetNetUsdValue() optionalnullable.OptionalNullable[string]
- type LoopedPositionCurrentStateHealthFactorScope
- type LoopedPositionHistoryEntry
- func (l *LoopedPositionHistoryEntry) GetBlockNumber() int64
- func (l *LoopedPositionHistoryEntry) GetBlockTimestamp() time.Time
- func (l *LoopedPositionHistoryEntry) GetClassification() Classification
- func (l *LoopedPositionHistoryEntry) GetCollateralDelta() string
- func (l *LoopedPositionHistoryEntry) GetDebtDelta() string
- func (l *LoopedPositionHistoryEntry) GetEvents() []CreditEvent
- func (l *LoopedPositionHistoryEntry) GetIterations() optionalnullable.OptionalNullable[int64]
- func (l *LoopedPositionHistoryEntry) GetSwap() optionalnullable.OptionalNullable[SwapInfo]
- func (l *LoopedPositionHistoryEntry) GetTransactionHash() string
- func (l LoopedPositionHistoryEntry) MarshalJSON() ([]byte, error)
- func (l *LoopedPositionHistoryEntry) UnmarshalJSON(data []byte) error
- type LoopedPositionStatus
- type LoopedPositionTotals
- func (l *LoopedPositionTotals) GetLiquidationCount() int64
- func (l *LoopedPositionTotals) GetLoopTxCount() int64
- func (l *LoopedPositionTotals) GetTotalCollateralAdded() string
- func (l *LoopedPositionTotals) GetTotalCollateralRemoved() string
- func (l *LoopedPositionTotals) GetTotalDebtAdded() string
- func (l *LoopedPositionTotals) GetTotalDebtRemoved() string
- func (l *LoopedPositionTotals) GetUnwindTxCount() int64
- type MarketAllocation
- func (m *MarketAllocation) GetAllocationPct() optionalnullable.OptionalNullable[float64]
- func (m *MarketAllocation) GetCollateralToken() string
- func (m *MarketAllocation) GetCollateralTokenSymbol() optionalnullable.OptionalNullable[string]
- func (m *MarketAllocation) GetLltv() string
- func (m *MarketAllocation) GetLoanToken() string
- func (m *MarketAllocation) GetLoanTokenSymbol() optionalnullable.OptionalNullable[string]
- func (m *MarketAllocation) GetMarketID() string
- func (m *MarketAllocation) GetSupplyAssets() optionalnullable.OptionalNullable[string]
- func (m *MarketAllocation) GetSupplyCap() optionalnullable.OptionalNullable[string]
- type MarketDetail
- func (m *MarketDetail) GetApy7d() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetApy30d() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetAssetClass() TokenizedAssetClass
- func (m *MarketDetail) GetAverageVolume() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetCandles() optionalnullable.OptionalNullable[[]OhlcCandle]
- func (m *MarketDetail) GetChain() Chain
- func (m *MarketDetail) GetChange24hPct() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetChange24hUsd() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetContractAddress() string
- func (m *MarketDetail) GetCurrentPriceUsd() string
- func (m *MarketDetail) GetDecimals() int64
- func (m *MarketDetail) GetMarketCap() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetName() string
- func (m *MarketDetail) GetPriceHigh52w() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetPriceHistory24h() []PricePoint
- func (m *MarketDetail) GetPriceLow52w() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetProvider() TokenizedAssetProvider
- func (m *MarketDetail) GetRegionExposure() []string
- func (m *MarketDetail) GetRestrictedJurisdictions() []string
- func (m *MarketDetail) GetSectors() []string
- func (m *MarketDetail) GetSharesMultiplier() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetSharesOutstanding() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetStatus() optionalnullable.OptionalNullable[TradingStatus]
- func (m *MarketDetail) GetSymbol() string
- func (m *MarketDetail) GetTotalHolders() optionalnullable.OptionalNullable[int64]
- func (m *MarketDetail) GetTradableSessions() []string
- func (m *MarketDetail) GetTvlUsd() optionalnullable.OptionalNullable[string]
- func (m *MarketDetail) GetUnderlyingTicker() string
- func (m *MarketDetail) GetVolume24h() optionalnullable.OptionalNullable[string]
- func (m MarketDetail) MarshalJSON() ([]byte, error)
- func (m *MarketDetail) UnmarshalJSON(data []byte) error
- type MaxSupplyApyInfo
- type MorphoLendingMarket
- func (m *MorphoLendingMarket) GetAvailableLiquidity() string
- func (m *MorphoLendingMarket) GetBorrowApy() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetCollateralIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetCollateralToken() string
- func (m *MorphoLendingMarket) GetCollateralTokenDecimals() int64
- func (m *MorphoLendingMarket) GetCollateralTokenSymbol() string
- func (m *MorphoLendingMarket) GetFee() string
- func (m *MorphoLendingMarket) GetIrm() string
- func (m *MorphoLendingMarket) GetLiquidityUsd() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetLltv() string
- func (m *MorphoLendingMarket) GetLoanIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetLoanToken() string
- func (m *MorphoLendingMarket) GetLoanTokenDecimals() int64
- func (m *MorphoLendingMarket) GetLoanTokenSymbol() string
- func (m *MorphoLendingMarket) GetMarketID() string
- func (m *MorphoLendingMarket) GetOracle() string
- func (m *MorphoLendingMarket) GetSupplyApy() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetTotalBorrowAssets() string
- func (m *MorphoLendingMarket) GetTotalSupplyAssets() string
- func (m *MorphoLendingMarket) GetTvlUsd() optionalnullable.OptionalNullable[string]
- func (m *MorphoLendingMarket) GetUtilization() string
- type MorphoMarketsResponse
- func (m *MorphoMarketsResponse) GetLimit() int64
- func (m *MorphoMarketsResponse) GetMarkets() []MorphoLendingMarket
- func (m *MorphoMarketsResponse) GetMorpho() string
- func (m *MorphoMarketsResponse) GetOffset() int64
- func (m *MorphoMarketsResponse) GetTotal() int64
- func (m MorphoMarketsResponse) MarshalJSON() ([]byte, error)
- func (m *MorphoMarketsResponse) UnmarshalJSON(data []byte) error
- type Multiplier
- type MultiplierType
- type OhlcCandle
- type OnrampCreate
- type OnrampCreateRequest
- type OnrampCreateStatus
- type OnrampFees
- type OnrampQuote
- func (o *OnrampQuote) GetExchangeRate() string
- func (o *OnrampQuote) GetExpiresAt() optionalnullable.OptionalNullable[string]
- func (o *OnrampQuote) GetFees() OnrampFees
- func (o *OnrampQuote) GetFiatAmount() string
- func (o *OnrampQuote) GetFiatCurrency() string
- func (o *OnrampQuote) GetMaxAmount() optionalnullable.OptionalNullable[string]
- func (o *OnrampQuote) GetMinAmount() optionalnullable.OptionalNullable[string]
- func (o *OnrampQuote) GetOutputAmount() string
- func (o *OnrampQuote) GetOutputAsset() *string
- func (o *OnrampQuote) GetOutputChain() *string
- func (o OnrampQuote) MarshalJSON() ([]byte, error)
- func (o *OnrampQuote) UnmarshalJSON(data []byte) error
- type OnrampQuoteRequest
- type OnrampStatus
- func (o *OnrampStatus) GetDeliveryTxHash() optionalnullable.OptionalNullable[string]
- func (o *OnrampStatus) GetDestinationAddress() optionalnullable.OptionalNullable[string]
- func (o *OnrampStatus) GetOutputAmountDelivered() optionalnullable.OptionalNullable[string]
- func (o *OnrampStatus) GetPaymentID() string
- func (o *OnrampStatus) GetStatus() OnrampStatusStatus
- func (o *OnrampStatus) GetUpdatedAt() optionalnullable.OptionalNullable[string]
- type OnrampStatusStatus
- type OperationType
- type OrderStatus
- func (o *OrderStatus) GetFillPriceUsd() optionalnullable.OptionalNullable[string]
- func (o *OrderStatus) GetFillTxHash() optionalnullable.OptionalNullable[string]
- func (o *OrderStatus) GetFilledAmount() optionalnullable.OptionalNullable[string]
- func (o *OrderStatus) GetOrderHash() string
- func (o *OrderStatus) GetStatus() OrderStatusStatus
- func (o *OrderStatus) GetSubmittedAt() optionalnullable.OptionalNullable[string]
- func (o *OrderStatus) GetUpdatedAt() string
- type OrderStatusStatus
- type OrderToSign
- type PendleDepositEvent
- func (p *PendleDepositEvent) GetBlockNumber() int64
- func (p *PendleDepositEvent) GetBlockTimestamp() time.Time
- func (p *PendleDepositEvent) GetCostPerUnit() string
- func (p *PendleDepositEvent) GetInputAmount() string
- func (p *PendleDepositEvent) GetInputSymbol() string
- func (p *PendleDepositEvent) GetOutputAmount() string
- func (p *PendleDepositEvent) GetOutputSymbol() string
- func (p *PendleDepositEvent) GetTransactionHash() string
- func (p PendleDepositEvent) MarshalJSON() ([]byte, error)
- func (p *PendleDepositEvent) UnmarshalJSON(data []byte) error
- type PendleMarketInfo
- func (p *PendleMarketInfo) GetChain() string
- func (p *PendleMarketInfo) GetExpiry() optionalnullable.OptionalNullable[int64]
- func (p *PendleMarketInfo) GetImpliedApy() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetMarketAddress() string
- func (p *PendleMarketInfo) GetPtAddress() string
- func (p *PendleMarketInfo) GetPtName() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetPtSymbol() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetSyAddress() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetTvlUsd() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetUnderlyingAsset() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetUnderlyingName() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetUnderlyingSymbol() optionalnullable.OptionalNullable[string]
- func (p *PendleMarketInfo) GetYtAddress() optionalnullable.OptionalNullable[string]
- type PendleMarketsResponse
- type PendlePTPosition
- func (p *PendlePTPosition) GetCurrentPtToSyRate() *string
- func (p *PendlePTPosition) GetDeposits() []PendleDepositEvent
- func (p *PendlePTPosition) GetExpiry() int64
- func (p *PendlePTPosition) GetImpliedApy() optionalnullable.OptionalNullable[string]
- func (p *PendlePTPosition) GetMarketAddress() string
- func (p *PendlePTPosition) GetPnl() optionalnullable.OptionalNullable[PositionPnL]
- func (p *PendlePTPosition) GetPtAddress() string
- func (p *PendlePTPosition) GetPtBalance() *string
- func (p *PendlePTPosition) GetType() string
- func (p *PendlePTPosition) GetUnderlyingAddress() string
- func (p *PendlePTPosition) GetUnderlyingSymbol() string
- func (p *PendlePTPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
- func (p *PendlePTPosition) GetWithdrawals() []PendleWithdrawalEvent
- func (p *PendlePTPosition) GetYieldTokenAddress() string
- func (p PendlePTPosition) MarshalJSON() ([]byte, error)
- func (p *PendlePTPosition) UnmarshalJSON(data []byte) error
- type PendlePTVenue
- func (p *PendlePTVenue) GetMarketAddress() string
- func (p *PendlePTVenue) GetMaxSlippagePercent() *float64
- func (p *PendlePTVenue) GetToken() optionalnullable.OptionalNullable[string]
- func (p *PendlePTVenue) GetType() string
- func (p PendlePTVenue) MarshalJSON() ([]byte, error)
- func (p *PendlePTVenue) UnmarshalJSON(data []byte) error
- type PendleWithdrawalEvent
- func (p *PendleWithdrawalEvent) GetBlockNumber() int64
- func (p *PendleWithdrawalEvent) GetBlockTimestamp() time.Time
- func (p *PendleWithdrawalEvent) GetCostPerUnit() string
- func (p *PendleWithdrawalEvent) GetInputAmount() string
- func (p *PendleWithdrawalEvent) GetInputSymbol() string
- func (p *PendleWithdrawalEvent) GetOutputAmount() string
- func (p *PendleWithdrawalEvent) GetOutputSymbol() string
- func (p *PendleWithdrawalEvent) GetRealizedPnl() string
- func (p *PendleWithdrawalEvent) GetTransactionHash() string
- func (p PendleWithdrawalEvent) MarshalJSON() ([]byte, error)
- func (p *PendleWithdrawalEvent) UnmarshalJSON(data []byte) error
- type Permit2TypedDataInput
- func (p *Permit2TypedDataInput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain
- func (p *Permit2TypedDataInput) GetMessage() PermitTransferFromMessage
- func (p *Permit2TypedDataInput) GetPrimaryType() *string
- func (p *Permit2TypedDataInput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types
- func (p Permit2TypedDataInput) MarshalJSON() ([]byte, error)
- func (p *Permit2TypedDataInput) UnmarshalJSON(data []byte) error
- type Permit2TypedDataOutput
- func (p *Permit2TypedDataOutput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain
- func (p *Permit2TypedDataOutput) GetMessage() PermitTransferFromMessage
- func (p *Permit2TypedDataOutput) GetPrimaryType() *string
- func (p *Permit2TypedDataOutput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types
- func (p Permit2TypedDataOutput) MarshalJSON() ([]byte, error)
- func (p *Permit2TypedDataOutput) UnmarshalJSON(data []byte) error
- type PermitField
- type PermitMessage
- func (p *PermitMessage) GetDeadline() string
- func (p *PermitMessage) GetNonce() string
- func (p *PermitMessage) GetOwner() string
- func (p *PermitMessage) GetSpender() string
- func (p *PermitMessage) GetValue() string
- func (p PermitMessage) MarshalJSON() ([]byte, error)
- func (p *PermitMessage) UnmarshalJSON(data []byte) error
- type PermitTransferFromMessage
- func (p *PermitTransferFromMessage) GetDeadline() int64
- func (p *PermitTransferFromMessage) GetNonce() int64
- func (p *PermitTransferFromMessage) GetPermitted() TokenPermissions
- func (p *PermitTransferFromMessage) GetSpender() string
- func (p PermitTransferFromMessage) MarshalJSON() ([]byte, error)
- func (p *PermitTransferFromMessage) UnmarshalJSON(data []byte) error
- type PermitTypedDataResponseInput
- func (p *PermitTypedDataResponseInput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain
- func (p *PermitTypedDataResponseInput) GetMessage() PermitMessage
- func (p *PermitTypedDataResponseInput) GetPrimaryType() string
- func (p *PermitTypedDataResponseInput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types
- func (p PermitTypedDataResponseInput) MarshalJSON() ([]byte, error)
- func (p *PermitTypedDataResponseInput) UnmarshalJSON(data []byte) error
- type PermitTypedDataResponseOutput
- func (p *PermitTypedDataResponseOutput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain
- func (p *PermitTypedDataResponseOutput) GetMessage() PermitMessage
- func (p *PermitTypedDataResponseOutput) GetPrimaryType() string
- func (p *PermitTypedDataResponseOutput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types
- func (p PermitTypedDataResponseOutput) MarshalJSON() ([]byte, error)
- func (p *PermitTypedDataResponseOutput) UnmarshalJSON(data []byte) error
- type PerpetualTradingActivityPartialError
- type PerpetualTradingActivityResponse
- func (p *PerpetualTradingActivityResponse) GetAccountValue() *string
- func (p *PerpetualTradingActivityResponse) GetBuilderApproval() optionalnullable.OptionalNullable[PerpetualTradingBuilderApproval]
- func (p *PerpetualTradingActivityResponse) GetFills() []PerpetualTradingFill
- func (p *PerpetualTradingActivityResponse) GetOpenOrders() []PerpetualTradingOpenOrder
- func (p *PerpetualTradingActivityResponse) GetOwner() string
- func (p *PerpetualTradingActivityResponse) GetPartialErrors() []PerpetualTradingActivityPartialError
- func (p *PerpetualTradingActivityResponse) GetPositions() []PerpetualTradingPosition
- func (p *PerpetualTradingActivityResponse) GetWithdrawable() *string
- func (p PerpetualTradingActivityResponse) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingActivityResponse) UnmarshalJSON(data []byte) error
- type PerpetualTradingApproveBuilderFeeRequest
- type PerpetualTradingBuilderApproval
- type PerpetualTradingCancelOrderRequest
- func (p *PerpetualTradingCancelOrderRequest) GetAsset() string
- func (p *PerpetualTradingCancelOrderRequest) GetClientOrderID() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingCancelOrderRequest) GetOrderID() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingCancelOrderRequest) GetOwner() string
- type PerpetualTradingCandlesResponse
- type PerpetualTradingCategory
- type PerpetualTradingDepositRequest
- type PerpetualTradingDepositResponse
- type PerpetualTradingDepositSponsorPrepareRequest
- func (p *PerpetualTradingDepositSponsorPrepareRequest) GetAmountRaw() int64
- func (p *PerpetualTradingDepositSponsorPrepareRequest) GetDeadline() int64
- func (p *PerpetualTradingDepositSponsorPrepareRequest) GetOwner() string
- func (p *PerpetualTradingDepositSponsorPrepareRequest) GetSender() string
- func (p *PerpetualTradingDepositSponsorPrepareRequest) GetSignature() string
- type PerpetualTradingDepositSponsorPrepareResponse
- type PerpetualTradingEnableUnifiedAccountRequest
- type PerpetualTradingEnableUnifiedAccountResponse
- func (p *PerpetualTradingEnableUnifiedAccountResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
- func (p *PerpetualTradingEnableUnifiedAccountResponse) GetMode() string
- func (p *PerpetualTradingEnableUnifiedAccountResponse) GetNonce() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingEnableUnifiedAccountResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
- func (p PerpetualTradingEnableUnifiedAccountResponse) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingEnableUnifiedAccountResponse) UnmarshalJSON(data []byte) error
- type PerpetualTradingEnsureLeverageRequest
- type PerpetualTradingEnsureLeverageResponse
- func (p *PerpetualTradingEnsureLeverageResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
- func (p *PerpetualTradingEnsureLeverageResponse) GetLeverageOk() bool
- func (p *PerpetualTradingEnsureLeverageResponse) GetNonce() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingEnsureLeverageResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
- func (p PerpetualTradingEnsureLeverageResponse) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingEnsureLeverageResponse) UnmarshalJSON(data []byte) error
- type PerpetualTradingExecuteRequest
- type PerpetualTradingExecuteResponse
- type PerpetualTradingFill
- func (p *PerpetualTradingFill) GetAsset() string
- func (p *PerpetualTradingFill) GetBuilderFee() optionalnullable.OptionalNullable[string]
- func (p *PerpetualTradingFill) GetClosedPnl() optionalnullable.OptionalNullable[string]
- func (p *PerpetualTradingFill) GetFee() string
- func (p *PerpetualTradingFill) GetOrderID() int64
- func (p *PerpetualTradingFill) GetPrice() string
- func (p *PerpetualTradingFill) GetSide() PerpetualTradingFillSide
- func (p *PerpetualTradingFill) GetSize() string
- func (p *PerpetualTradingFill) GetTimeMs() int64
- type PerpetualTradingFillSide
- type PerpetualTradingLimitOrderRequest
- func (p *PerpetualTradingLimitOrderRequest) GetAsset() string
- func (p *PerpetualTradingLimitOrderRequest) GetBuilder() optionalnullable.OptionalNullable[Builder]
- func (p *PerpetualTradingLimitOrderRequest) GetClientOrderID() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingLimitOrderRequest) GetOwner() string
- func (p *PerpetualTradingLimitOrderRequest) GetPrice() string
- func (p *PerpetualTradingLimitOrderRequest) GetReduceOnly() *bool
- func (p *PerpetualTradingLimitOrderRequest) GetSide() string
- func (p *PerpetualTradingLimitOrderRequest) GetSize() string
- func (p *PerpetualTradingLimitOrderRequest) GetTimeInForce() *string
- func (p PerpetualTradingLimitOrderRequest) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingLimitOrderRequest) UnmarshalJSON(data []byte) error
- type PerpetualTradingMarketOrderRequest
- func (p *PerpetualTradingMarketOrderRequest) GetAsset() string
- func (p *PerpetualTradingMarketOrderRequest) GetBuilder() optionalnullable.OptionalNullable[Builder]
- func (p *PerpetualTradingMarketOrderRequest) GetOwner() string
- func (p *PerpetualTradingMarketOrderRequest) GetReduceOnly() *bool
- func (p *PerpetualTradingMarketOrderRequest) GetSide() string
- func (p *PerpetualTradingMarketOrderRequest) GetSize() string
- func (p *PerpetualTradingMarketOrderRequest) GetSlippagePercent() *float64
- func (p PerpetualTradingMarketOrderRequest) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingMarketOrderRequest) UnmarshalJSON(data []byte) error
- type PerpetualTradingOpenOrder
- func (p *PerpetualTradingOpenOrder) GetAsset() string
- func (p *PerpetualTradingOpenOrder) GetLimitPrice() string
- func (p *PerpetualTradingOpenOrder) GetOrderID() int64
- func (p *PerpetualTradingOpenOrder) GetReduceOnly() bool
- func (p *PerpetualTradingOpenOrder) GetSide() PerpetualTradingOpenOrderSide
- func (p *PerpetualTradingOpenOrder) GetSize() string
- func (p *PerpetualTradingOpenOrder) GetTimeMs() int64
- type PerpetualTradingOpenOrderSide
- type PerpetualTradingOpportunitiesResponse
- type PerpetualTradingOpportunity
- func (p *PerpetualTradingOpportunity) GetAsset() string
- func (p *PerpetualTradingOpportunity) GetAssetID() int64
- func (p *PerpetualTradingOpportunity) GetCategory() string
- func (p *PerpetualTradingOpportunity) GetFundingRate() string
- func (p *PerpetualTradingOpportunity) GetMarkPrice() string
- func (p *PerpetualTradingOpportunity) GetMaxLeverage() int64
- func (p *PerpetualTradingOpportunity) GetOpenInterest() string
- func (p *PerpetualTradingOpportunity) GetOraclePrice() string
- func (p *PerpetualTradingOpportunity) GetSzDecimals() int64
- func (p *PerpetualTradingOpportunity) GetVolume24h() string
- type PerpetualTradingPosition
- func (p *PerpetualTradingPosition) GetAsset() string
- func (p *PerpetualTradingPosition) GetAssetID() int64
- func (p *PerpetualTradingPosition) GetEntryPrice() string
- func (p *PerpetualTradingPosition) GetFundingAccrued() string
- func (p *PerpetualTradingPosition) GetLeverage() string
- func (p *PerpetualTradingPosition) GetLiquidationPrice() optionalnullable.OptionalNullable[string]
- func (p *PerpetualTradingPosition) GetMarginUsed() string
- func (p *PerpetualTradingPosition) GetMarkPrice() string
- func (p *PerpetualTradingPosition) GetSide() PerpetualTradingPositionSide
- func (p *PerpetualTradingPosition) GetSize() string
- func (p *PerpetualTradingPosition) GetUnrealizedPnl() string
- type PerpetualTradingPositionSide
- type PerpetualTradingPositionsResponse
- type PerpetualTradingSetLeverageRequest
- type PerpetualTradingSetLeverageResponse
- func (p *PerpetualTradingSetLeverageResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
- func (p *PerpetualTradingSetLeverageResponse) GetLeverageOk() bool
- func (p *PerpetualTradingSetLeverageResponse) GetNonce() optionalnullable.OptionalNullable[int64]
- func (p *PerpetualTradingSetLeverageResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
- func (p PerpetualTradingSetLeverageResponse) MarshalJSON() ([]byte, error)
- func (p *PerpetualTradingSetLeverageResponse) UnmarshalJSON(data []byte) error
- type PerpetualTradingSignableActionResponse
- type PerpetualTradingWithdrawRequest
- type PositionPnL
- type PricePoint
- type Product
- type Protocol
- type Quote
- type QuoteFee
- type RebalanceDirection
- type RebalanceTarget
- func (r *RebalanceTarget) GetBorrowToken() string
- func (r *RebalanceTarget) GetClose() *bool
- func (r *RebalanceTarget) GetCollateralToken() string
- func (r *RebalanceTarget) GetMarketID() optionalnullable.OptionalNullable[string]
- func (r *RebalanceTarget) GetMaxSlippagePercent() optionalnullable.OptionalNullable[RebalanceTargetMaxSlippagePercent]
- func (r *RebalanceTarget) GetProtocol() *CreditProtocol
- func (r *RebalanceTarget) GetTargetEquityUsd() optionalnullable.OptionalNullable[TargetEquityUsd]
- func (r *RebalanceTarget) GetTargetMultiplier() optionalnullable.OptionalNullable[RebalanceTargetTargetMultiplier]
- type RebalanceTargetMaxSlippagePercent
- type RebalanceTargetMaxSlippagePercentType
- type RebalanceTargetPreview
- func (r *RebalanceTargetPreview) GetBorrowToken() string
- func (r *RebalanceTargetPreview) GetCollateralToken() string
- func (r *RebalanceTargetPreview) GetDirection() RebalanceDirection
- func (r *RebalanceTargetPreview) GetEstimatedMaxDust() string
- func (r *RebalanceTargetPreview) GetHealthFactorScope() RebalanceTargetPreviewHealthFactorScope
- func (r *RebalanceTargetPreview) GetLegs() int64
- func (r *RebalanceTargetPreview) GetLoopLegs() []LoopLegPreview
- func (r *RebalanceTargetPreview) GetMarketID() optionalnullable.OptionalNullable[string]
- func (r *RebalanceTargetPreview) GetProtocol() CreditProtocol
- func (r *RebalanceTargetPreview) GetResultingCollateral() string
- func (r *RebalanceTargetPreview) GetResultingDebt() string
- func (r *RebalanceTargetPreview) GetResultingHealthFactor() string
- func (r *RebalanceTargetPreview) GetResultingMultiplier() string
- func (r *RebalanceTargetPreview) GetUnloopLegs() []UnloopLegPreview
- func (r RebalanceTargetPreview) MarshalJSON() ([]byte, error)
- func (r *RebalanceTargetPreview) UnmarshalJSON(data []byte) error
- type RebalanceTargetPreviewHealthFactorScope
- type RebalanceTargetTargetMultiplier
- type RebalanceTargetTargetMultiplierType
- type Redemption
- func (r *Redemption) GetExpectedNetAssets() optionalnullable.OptionalNullable[string]
- func (r *Redemption) GetID() int64
- func (r *Redemption) GetProcessedAt() optionalnullable.OptionalNullable[int64]
- func (r *Redemption) GetRequestedAt() int64
- func (r *Redemption) GetShares() string
- func (r *Redemption) GetStatus() RedemptionStatus
- type RedemptionStatus
- type RedemptionsResponse
- type RepayAmount
- type RepayAmountType
- type ReserveInfo
- func (r *ReserveInfo) GetATokenAddress() string
- func (r *ReserveInfo) GetAddress() string
- func (r *ReserveInfo) GetAvailableLiquidity() string
- func (r *ReserveInfo) GetBorrowApy() string
- func (r *ReserveInfo) GetBorrowApyAvg() string
- func (r *ReserveInfo) GetIntrinsicApy() optionalnullable.OptionalNullable[string]
- func (r *ReserveInfo) GetLiquidationThreshold() string
- func (r *ReserveInfo) GetLtv() string
- func (r *ReserveInfo) GetSupplyApy() string
- func (r *ReserveInfo) GetSupplyApyAvg() string
- func (r *ReserveInfo) GetTotalBorrowed() string
- func (r *ReserveInfo) GetUtilizationRate() string
- type RoutingSwapPreview
- type SafeMessageEip712Response
- func (s *SafeMessageEip712Response) GetDomain() CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain
- func (s *SafeMessageEip712Response) GetMessage() SafeMessageMessage
- func (s *SafeMessageEip712Response) GetPrimaryType() string
- func (s *SafeMessageEip712Response) GetTypes() SafeMessageEip712Types
- func (s SafeMessageEip712Response) MarshalJSON() ([]byte, error)
- func (s *SafeMessageEip712Response) UnmarshalJSON(data []byte) error
- type SafeMessageEip712Types
- type SafeMessageField
- type SafeMessageMessage
- type SafeTxField
- type SafeTxMessage
- func (s *SafeTxMessage) GetBaseGas() string
- func (s *SafeTxMessage) GetData() string
- func (s *SafeTxMessage) GetGasPrice() string
- func (s *SafeTxMessage) GetGasToken() string
- func (s *SafeTxMessage) GetNonce() string
- func (s *SafeTxMessage) GetOperation() OperationType
- func (s *SafeTxMessage) GetRefundReceiver() string
- func (s *SafeTxMessage) GetSafeTxGas() string
- func (s *SafeTxMessage) GetTo() string
- func (s *SafeTxMessage) GetValue() string
- func (s SafeTxMessage) MarshalJSON() ([]byte, error)
- func (s *SafeTxMessage) UnmarshalJSON(data []byte) error
- type Section
- type Security
- type Settlement
- type SponsorGasRequest
- func (s *SponsorGasRequest) GetChain() Chain
- func (s *SponsorGasRequest) GetEip712() SponsorGasRequestEip712
- func (s *SponsorGasRequest) GetOwner() string
- func (s *SponsorGasRequest) GetProduct() *Product
- func (s *SponsorGasRequest) GetSender() string
- func (s *SponsorGasRequest) GetSignature() string
- type SponsorGasRequestEip712
- func CreateSponsorGasRequestEip712BatchedSafeOperationsResponseInput(batchedSafeOperationsResponseInput BatchedSafeOperationsResponseInput) SponsorGasRequestEip712
- func CreateSponsorGasRequestEip712Permit2TypedDataInput(permit2TypedDataInput Permit2TypedDataInput) SponsorGasRequestEip712
- func CreateSponsorGasRequestEip712PermitTypedDataResponseInput(permitTypedDataResponseInput PermitTypedDataResponseInput) SponsorGasRequestEip712
- type SponsorGasRequestEip712Type
- type SponsorGasResponse
- type SwapInfo
- func (s *SwapInfo) GetBoughtAmount() string
- func (s *SwapInfo) GetBoughtSymbol() string
- func (s *SwapInfo) GetBoughtToken() string
- func (s *SwapInfo) GetRouter() optionalnullable.OptionalNullable[string]
- func (s *SwapInfo) GetSoldAmount() string
- func (s *SwapInfo) GetSoldSymbol() string
- func (s *SwapInfo) GetSoldToken() string
- type TargetEquityUsd
- type TargetEquityUsdType
- type TokenAmount
- type TokenMarketData
- type TokenPermissions
- type TokenTransfer
- func (t *TokenTransfer) GetAmount() string
- func (t *TokenTransfer) GetAmountFormatted() string
- func (t *TokenTransfer) GetBlockNumber() int64
- func (t *TokenTransfer) GetBlockTimestamp() time.Time
- func (t *TokenTransfer) GetDirection() Direction
- func (t *TokenTransfer) GetFromAddress() string
- func (t *TokenTransfer) GetToAddress() string
- func (t *TokenTransfer) GetTransactionHash() string
- func (t TokenTransfer) MarshalJSON() ([]byte, error)
- func (t *TokenTransfer) UnmarshalJSON(data []byte) error
- type TokenizedAssetClass
- type TokenizedAssetProvider
- type TokenizedAssetsActivityEvent
- func (t *TokenizedAssetsActivityEvent) GetBlockNumber() int64
- func (t *TokenizedAssetsActivityEvent) GetBlockTimestamp() time.Time
- func (t *TokenizedAssetsActivityEvent) GetCostPerUnit() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetEventType() TokenizedAssetsActivityEventEventType
- func (t *TokenizedAssetsActivityEvent) GetInputAmount() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetInputSymbol() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetOutputAmount() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetOutputSymbol() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetRealizedPnl() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsActivityEvent) GetTransactionHash() string
- func (t TokenizedAssetsActivityEvent) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsActivityEvent) UnmarshalJSON(data []byte) error
- type TokenizedAssetsActivityEventEventType
- type TokenizedAssetsBalancesResponse
- func (t *TokenizedAssetsBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
- func (t *TokenizedAssetsBalancesResponse) GetTokenizedAssetsAccountAddress() string
- func (t *TokenizedAssetsBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
- func (t TokenizedAssetsBalancesResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsBalancesResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsBuildOrderRequest
- func (t *TokenizedAssetsBuildOrderRequest) GetAmount() string
- func (t *TokenizedAssetsBuildOrderRequest) GetFromToken() string
- func (t *TokenizedAssetsBuildOrderRequest) GetOwner() string
- func (t *TokenizedAssetsBuildOrderRequest) GetSlippageBps() *int64
- func (t *TokenizedAssetsBuildOrderRequest) GetToToken() string
- type TokenizedAssetsBuildOrderResponse
- func (t *TokenizedAssetsBuildOrderResponse) GetApprovalSafeTxEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (t *TokenizedAssetsBuildOrderResponse) GetOrder() OrderToSign
- func (t *TokenizedAssetsBuildOrderResponse) GetQuote() Quote
- func (t TokenizedAssetsBuildOrderResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsBuildOrderResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsCancelOrderRequest
- type TokenizedAssetsCancelOrderResponse
- type TokenizedAssetsChargeFeeRequest
- type TokenizedAssetsChargeFeeResponse
- func (t *TokenizedAssetsChargeFeeResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (t *TokenizedAssetsChargeFeeResponse) GetFeeAmount() string
- func (t *TokenizedAssetsChargeFeeResponse) GetProceeds() string
- func (t *TokenizedAssetsChargeFeeResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (t TokenizedAssetsChargeFeeResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsChargeFeeResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsFee
- type TokenizedAssetsFeeAmount
- type TokenizedAssetsFeeAmountType
- type TokenizedAssetsFeeDenomination
- type TokenizedAssetsMarketsListResponse
- type TokenizedAssetsOhlcInterval
- type TokenizedAssetsOhlcRange
- type TokenizedAssetsPnl
- func (t *TokenizedAssetsPnl) GetCurrentValue() string
- func (t *TokenizedAssetsPnl) GetRealizedPnl() string
- func (t *TokenizedAssetsPnl) GetTotalDeposited() string
- func (t *TokenizedAssetsPnl) GetTotalPnl() string
- func (t *TokenizedAssetsPnl) GetTotalPnlPercent() string
- func (t *TokenizedAssetsPnl) GetUnrealizedPnl() string
- type TokenizedAssetsPositionsResponse
- func (t *TokenizedAssetsPositionsResponse) GetOwner() string
- func (t *TokenizedAssetsPositionsResponse) GetPnl() optionalnullable.OptionalNullable[TokenizedAssetsPnl]
- func (t *TokenizedAssetsPositionsResponse) GetPositions() []CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition
- func (t *TokenizedAssetsPositionsResponse) GetTotalUsd() string
- func (t TokenizedAssetsPositionsResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsPositionsResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsQuoteRequest
- type TokenizedAssetsQuoteResponse
- type TokenizedAssetsSubmitOrderRequest
- func (t *TokenizedAssetsSubmitOrderRequest) GetExtension() string
- func (t *TokenizedAssetsSubmitOrderRequest) GetOrderHash() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsSubmitOrderRequest) GetQuoteID() string
- func (t *TokenizedAssetsSubmitOrderRequest) GetSignature() string
- func (t *TokenizedAssetsSubmitOrderRequest) GetSignedOrder() map[string]any
- type TokenizedAssetsSubmitOrderResponse
- type TokenizedAssetsTradeRequest
- func (t *TokenizedAssetsTradeRequest) GetAmountIn() TokenizedAssetsTradeRequestAmountIn
- func (t *TokenizedAssetsTradeRequest) GetChain() Chain
- func (t *TokenizedAssetsTradeRequest) GetFee() optionalnullable.OptionalNullable[TokenizedAssetsFee]
- func (t *TokenizedAssetsTradeRequest) GetGasSponsorship() *bool
- func (t *TokenizedAssetsTradeRequest) GetOwner() string
- func (t *TokenizedAssetsTradeRequest) GetSlippage() *TokenizedAssetsTradeRequestSlippage
- func (t *TokenizedAssetsTradeRequest) GetTokenIn() string
- func (t *TokenizedAssetsTradeRequest) GetTokenOut() string
- func (t *TokenizedAssetsTradeRequest) GetWisdomtree() optionalnullable.OptionalNullable[WisdomTreeCredentials]
- func (t TokenizedAssetsTradeRequest) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsTradeRequest) UnmarshalJSON(data []byte) error
- type TokenizedAssetsTradeRequestAmountIn
- type TokenizedAssetsTradeRequestAmountInType
- type TokenizedAssetsTradeRequestSlippage
- type TokenizedAssetsTradeRequestSlippageType
- type TokenizedAssetsTradeResponse
- func (t *TokenizedAssetsTradeResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (t *TokenizedAssetsTradeResponse) GetEstimatedAmountOut() string
- func (t *TokenizedAssetsTradeResponse) GetFeeAmount() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsTradeResponse) GetPollEndpoint() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsTradeResponse) GetSettlement() *Settlement
- func (t *TokenizedAssetsTradeResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (t TokenizedAssetsTradeResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsTradeResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsTransferRequest
- func (t *TokenizedAssetsTransferRequest) GetAction() TokenizedAssetsTransferRequestAction
- func (t *TokenizedAssetsTransferRequest) GetAmount() TokenizedAssetsTransferRequestAmount
- func (t *TokenizedAssetsTransferRequest) GetChain() *Chain
- func (t *TokenizedAssetsTransferRequest) GetGasSponsorship() *bool
- func (t *TokenizedAssetsTransferRequest) GetOwner() string
- func (t *TokenizedAssetsTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
- func (t *TokenizedAssetsTransferRequest) GetToken() string
- type TokenizedAssetsTransferRequestAction
- type TokenizedAssetsTransferRequestAmount
- type TokenizedAssetsTransferRequestAmountType
- type TokenizedAssetsTransferResponse
- func (t *TokenizedAssetsTransferResponse) GetEip712() optionalnullable.OptionalNullable[TokenizedAssetsTransferResponseEip712]
- func (t *TokenizedAssetsTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (t TokenizedAssetsTransferResponse) MarshalJSON() ([]byte, error)
- func (t *TokenizedAssetsTransferResponse) UnmarshalJSON(data []byte) error
- type TokenizedAssetsTransferResponseEip712
- func CreateTokenizedAssetsTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) TokenizedAssetsTransferResponseEip712
- func CreateTokenizedAssetsTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) TokenizedAssetsTransferResponseEip712
- func CreateTokenizedAssetsTransferResponseEip712Unknown(raw json.RawMessage) TokenizedAssetsTransferResponseEip712
- func (u TokenizedAssetsTransferResponseEip712) GetUnknownRaw() json.RawMessage
- func (u TokenizedAssetsTransferResponseEip712) IsUnknown() bool
- func (u TokenizedAssetsTransferResponseEip712) MarshalJSON() ([]byte, error)
- func (u *TokenizedAssetsTransferResponseEip712) UnmarshalJSON(data []byte) error
- type TokenizedAssetsTransferResponseEip712Type
- type TradingState
- type TradingStatus
- func (t *TradingStatus) GetIsOpen() bool
- func (t *TradingStatus) GetNextClose() optionalnullable.OptionalNullable[string]
- func (t *TradingStatus) GetNextOpen() optionalnullable.OptionalNullable[string]
- func (t *TradingStatus) GetReason() optionalnullable.OptionalNullable[string]
- func (t *TradingStatus) GetSession() optionalnullable.OptionalNullable[string]
- func (t *TradingStatus) GetState() TradingState
- type UnloopLegPreview
- type UnsignedTransaction
- func (u *UnsignedTransaction) GetChainID() string
- func (u *UnsignedTransaction) GetData() string
- func (u *UnsignedTransaction) GetFrom() string
- func (u *UnsignedTransaction) GetGas() *string
- func (u *UnsignedTransaction) GetMaxFeePerGas() string
- func (u *UnsignedTransaction) GetMaxPriorityFeePerGas() string
- func (u *UnsignedTransaction) GetNonce() string
- func (u *UnsignedTransaction) GetTo() string
- func (u *UnsignedTransaction) GetValue() string
- type V2BundleRequest
- type V2BundleResponse
- func (v *V2BundleResponse) GetActionsCount() int64
- func (v *V2BundleResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
- func (v *V2BundleResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
- func (v V2BundleResponse) MarshalJSON() ([]byte, error)
- func (v *V2BundleResponse) UnmarshalJSON(data []byte) error
- type V2UserOperation
- func (v *V2UserOperation) GetBody() V2UserOperationBody
- func (v *V2UserOperation) GetBodyV2Manage() *EarnManageParams
- func (v *V2UserOperation) GetBodyV2Swap() *EarnSwapParams
- func (v *V2UserOperation) GetBodyV2TransferFromEoa() *EarnTransferFromEOAParams
- func (v *V2UserOperation) GetBodyV2TransferToAddress() *EarnTransferToAddressParams
- func (v *V2UserOperation) GetBodyV2TransferToEoa() *EarnTransferToEOAParams
- type V2UserOperationBody
- func CreateV2UserOperationBodyV2Manage(v2Manage EarnManageParams) V2UserOperationBody
- func CreateV2UserOperationBodyV2Swap(v2Swap EarnSwapParams) V2UserOperationBody
- func CreateV2UserOperationBodyV2TransferFromEoa(v2TransferFromEoa EarnTransferFromEOAParams) V2UserOperationBody
- func CreateV2UserOperationBodyV2TransferToAddress(v2TransferToAddress EarnTransferToAddressParams) V2UserOperationBody
- func CreateV2UserOperationBodyV2TransferToEoa(v2TransferToEoa EarnTransferToEOAParams) V2UserOperationBody
- type V2UserOperationBodyType
- type ValidationError
- type VaultInfo
- func (v *VaultInfo) GetApy7d() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetApy30d() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetApy90d() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetAsset() string
- func (v *VaultInfo) GetAssetName() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetAssetSymbol() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetChain() string
- func (v *VaultInfo) GetDepositCap() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetDepositCapUsd() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetFactoryVersion() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetLiquidityUsd() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetMarkets() []MarketAllocation
- func (v *VaultInfo) GetName() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetOwner() string
- func (v *VaultInfo) GetProtocol() *Protocol
- func (v *VaultInfo) GetSymbol() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetTvlUsd() optionalnullable.OptionalNullable[string]
- func (v *VaultInfo) GetVaultAddress() string
- func (v VaultInfo) MarshalJSON() ([]byte, error)
- func (v *VaultInfo) UnmarshalJSON(data []byte) error
- type VaultVenue
- type VaultsResponse
- type WisdomTreeCredentials
- type WithdrawAmount
- type WithdrawAmountType
- type WithdrawalEvent
- func (w *WithdrawalEvent) GetBlockNumber() int64
- func (w *WithdrawalEvent) GetBlockTimestamp() time.Time
- func (w *WithdrawalEvent) GetInputAmount() string
- func (w *WithdrawalEvent) GetInputSymbol() string
- func (w *WithdrawalEvent) GetOutputAmount() string
- func (w *WithdrawalEvent) GetOutputSymbol() string
- func (w *WithdrawalEvent) GetRealizedPnl() string
- func (w *WithdrawalEvent) GetTransactionHash() string
- func (w WithdrawalEvent) MarshalJSON() ([]byte, error)
- func (w *WithdrawalEvent) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AavePosition ¶
type AavePosition struct {
// The reserve (underlying token) address.
ReserveAddress string `json:"reserve_address"`
// Symbol of the reserve asset (e.g., USDC).
ReserveSymbol string `json:"reserve_symbol"`
// The user's position value (aToken balance).
Balance *string `json:"balance"`
// Position value in USD (null if price unavailable).
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// PnL metrics for this position.
Pnl optionalnullable.OptionalNullable[PositionPnL] `json:"pnl,omitzero"`
// All deposit events for this position.
Deposits []DepositEvent `json:"deposits,omitzero"`
// All withdrawal events for this position.
Withdrawals []WithdrawalEvent `json:"withdrawals,omitzero"`
// Current supply APY (percentage).
Apy optionalnullable.OptionalNullable[string] `json:"apy,omitzero"`
// contains filtered or unexported fields
}
AavePosition - Aave V3 lending position.
Note: Unlike the old model, this no longer has vault_address/vault_name fields as they were nonsensical for Aave positions.
func (*AavePosition) GetApy ¶
func (a *AavePosition) GetApy() optionalnullable.OptionalNullable[string]
func (*AavePosition) GetBalance ¶
func (a *AavePosition) GetBalance() *string
func (*AavePosition) GetDeposits ¶
func (a *AavePosition) GetDeposits() []DepositEvent
func (*AavePosition) GetPnl ¶
func (a *AavePosition) GetPnl() optionalnullable.OptionalNullable[PositionPnL]
func (*AavePosition) GetReserveAddress ¶
func (a *AavePosition) GetReserveAddress() string
func (*AavePosition) GetReserveSymbol ¶
func (a *AavePosition) GetReserveSymbol() string
func (*AavePosition) GetType ¶
func (a *AavePosition) GetType() string
func (*AavePosition) GetUsdValue ¶
func (a *AavePosition) GetUsdValue() optionalnullable.OptionalNullable[string]
func (*AavePosition) GetWithdrawals ¶
func (a *AavePosition) GetWithdrawals() []WithdrawalEvent
func (AavePosition) MarshalJSON ¶
func (a AavePosition) MarshalJSON() ([]byte, error)
func (*AavePosition) UnmarshalJSON ¶
func (a *AavePosition) UnmarshalJSON(data []byte) error
type AaveVenue ¶
type AaveVenue struct {
// The reserve token for the Aave pool you are interacting with.
Token string `json:"token"`
// contains filtered or unexported fields
}
func (AaveVenue) MarshalJSON ¶
func (*AaveVenue) UnmarshalJSON ¶
type AccountSummary ¶
type AccountSummary struct {
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVC sub-account (0–255) this summary describes. Euler health is per-sub-account. Null for Aave/Morpho.
SubAccountID optionalnullable.OptionalNullable[int64] `json:"sub_account_id,omitzero"`
// Health factor. Above 1 is safe; below 1 risks liquidation.
HealthFactor string `json:"health_factor"`
// Total collateral value in USD.
TotalCollateralUsd string `json:"total_collateral_usd"`
// Total debt value in USD.
TotalDebtUsd string `json:"total_debt_usd"`
// Available borrow capacity in USD.
AvailableBorrowsUsd string `json:"available_borrows_usd"`
// Current loan-to-value ratio.
Ltv string `json:"ltv"`
// E-Mode category ID. 0 = disabled. E-Mode gives higher LTV when collateral and debt are price-correlated (e.g. stablecoin-to-stablecoin or ETH-to-ETH-derivative).
EmodeCategoryID *int64 `json:"emode_category_id,omitzero"`
// Human-readable E-Mode category name (e.g. 'Stablecoins', 'ETH correlated'). Null when E-Mode is disabled (category 0).
EmodeLabel optionalnullable.OptionalNullable[string] `json:"emode_label,omitzero"`
}
AccountSummary - Account-level summary for one lending protocol.
Populated from Aave “getUserAccountData()“ or, for Euler, from the controller vault's risk engine (“accountLiquidity“). The E-Mode fields are Aave-only and stay at their defaults for Euler.
func (*AccountSummary) GetAvailableBorrowsUsd ¶
func (a *AccountSummary) GetAvailableBorrowsUsd() string
func (*AccountSummary) GetEmodeCategoryID ¶
func (a *AccountSummary) GetEmodeCategoryID() *int64
func (*AccountSummary) GetEmodeLabel ¶
func (a *AccountSummary) GetEmodeLabel() optionalnullable.OptionalNullable[string]
func (*AccountSummary) GetHealthFactor ¶
func (a *AccountSummary) GetHealthFactor() string
func (*AccountSummary) GetLtv ¶
func (a *AccountSummary) GetLtv() string
func (*AccountSummary) GetProtocol ¶ added in v0.1.27
func (a *AccountSummary) GetProtocol() *CreditProtocol
func (*AccountSummary) GetSubAccountID ¶ added in v0.1.41
func (a *AccountSummary) GetSubAccountID() optionalnullable.OptionalNullable[int64]
func (*AccountSummary) GetTotalCollateralUsd ¶
func (a *AccountSummary) GetTotalCollateralUsd() string
func (*AccountSummary) GetTotalDebtUsd ¶
func (a *AccountSummary) GetTotalDebtUsd() string
type ApproveTransferRequest ¶
type ApproveTransferRequest struct {
// The wallet address that owns the Earn Account.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// The token you would like to transfer with gas sponsorship.
Token string `json:"token"`
// Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
}
func (*ApproveTransferRequest) GetChain ¶
func (a *ApproveTransferRequest) GetChain() Chain
func (*ApproveTransferRequest) GetGasSponsorship ¶
func (a *ApproveTransferRequest) GetGasSponsorship() *bool
func (*ApproveTransferRequest) GetOwner ¶
func (a *ApproveTransferRequest) GetOwner() string
func (*ApproveTransferRequest) GetToken ¶
func (a *ApproveTransferRequest) GetToken() string
type ApproveTransferResponse ¶
type ApproveTransferResponse struct {
// Unsigned approval transaction. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for off-chain permit signing. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[PermitTypedDataResponseOutput] `json:"eip_712,omitzero"`
}
func (*ApproveTransferResponse) GetEip712 ¶
func (a *ApproveTransferResponse) GetEip712() optionalnullable.OptionalNullable[PermitTypedDataResponseOutput]
func (*ApproveTransferResponse) GetTransaction ¶
func (a *ApproveTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (ApproveTransferResponse) MarshalJSON ¶
func (a ApproveTransferResponse) MarshalJSON() ([]byte, error)
func (*ApproveTransferResponse) UnmarshalJSON ¶
func (a *ApproveTransferResponse) UnmarshalJSON(data []byte) error
type BatchedSafeOperationsResponseInput ¶
type BatchedSafeOperationsResponseInput struct {
// The EIP-712 domain separator.
Domain CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain `json:"domain"`
// The type definitions for EIP-712 structured data.
Types CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types `json:"types"`
// The message data for the transaction.
Message SafeTxMessage `json:"message"`
// contains filtered or unexported fields
}
BatchedSafeOperationsResponseInput - Response containing EIP-712 typed data for Safe transaction signing.
func (*BatchedSafeOperationsResponseInput) GetMessage ¶
func (b *BatchedSafeOperationsResponseInput) GetMessage() SafeTxMessage
func (*BatchedSafeOperationsResponseInput) GetPrimaryType ¶
func (b *BatchedSafeOperationsResponseInput) GetPrimaryType() string
func (BatchedSafeOperationsResponseInput) MarshalJSON ¶
func (b BatchedSafeOperationsResponseInput) MarshalJSON() ([]byte, error)
func (*BatchedSafeOperationsResponseInput) UnmarshalJSON ¶
func (b *BatchedSafeOperationsResponseInput) UnmarshalJSON(data []byte) error
type BatchedSafeOperationsResponseOutput ¶
type BatchedSafeOperationsResponseOutput struct {
// The EIP-712 domain separator.
Domain CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain `json:"domain"`
// The type definitions for EIP-712 structured data.
Types CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types `json:"types"`
// The message data for the transaction.
Message SafeTxMessage `json:"message"`
// contains filtered or unexported fields
}
BatchedSafeOperationsResponseOutput - Response containing EIP-712 typed data for Safe transaction signing.
func (*BatchedSafeOperationsResponseOutput) GetMessage ¶
func (b *BatchedSafeOperationsResponseOutput) GetMessage() SafeTxMessage
func (*BatchedSafeOperationsResponseOutput) GetPrimaryType ¶
func (b *BatchedSafeOperationsResponseOutput) GetPrimaryType() string
func (BatchedSafeOperationsResponseOutput) MarshalJSON ¶
func (b BatchedSafeOperationsResponseOutput) MarshalJSON() ([]byte, error)
func (*BatchedSafeOperationsResponseOutput) UnmarshalJSON ¶
func (b *BatchedSafeOperationsResponseOutput) UnmarshalJSON(data []byte) error
type BorrowAmount ¶
type BorrowAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type BorrowAmountType
}
BorrowAmount - Amount to borrow (in token units, not wei).
func CreateBorrowAmountNumber ¶
func CreateBorrowAmountNumber(number float64) BorrowAmount
func CreateBorrowAmountStr ¶
func CreateBorrowAmountStr(str string) BorrowAmount
func (BorrowAmount) MarshalJSON ¶
func (u BorrowAmount) MarshalJSON() ([]byte, error)
func (*BorrowAmount) UnmarshalJSON ¶
func (u *BorrowAmount) UnmarshalJSON(data []byte) error
type BorrowAmountType ¶
type BorrowAmountType string
const ( BorrowAmountTypeNumber BorrowAmountType = "number" BorrowAmountTypeStr BorrowAmountType = "str" )
type BorrowableToken ¶
type BorrowableToken struct {
// Address of the borrowable token.
Token string `json:"token"`
// Symbol of the borrowable token (e.g. WETH).
Symbol string `json:"symbol"`
// Euler only: the EVK borrow vault to borrow this token from (pass as borrow_vault).
Vault optionalnullable.OptionalNullable[string] `json:"vault,omitzero"`
// Maximum amount that can be borrowed based on available borrow capacity and token price.
MaxBorrowableAmount string `json:"max_borrowable_amount"`
// Current variable borrow APY in percentage (e.g. 4.5 means 4.5%). Null if the rate is unavailable.
BorrowApy optionalnullable.OptionalNullable[string] `json:"borrow_apy,omitzero"`
}
BorrowableToken - A token available for borrowing with the maximum borrowable amount.
func (*BorrowableToken) GetBorrowApy ¶
func (b *BorrowableToken) GetBorrowApy() optionalnullable.OptionalNullable[string]
func (*BorrowableToken) GetMaxBorrowableAmount ¶
func (b *BorrowableToken) GetMaxBorrowableAmount() string
func (*BorrowableToken) GetSymbol ¶
func (b *BorrowableToken) GetSymbol() string
func (*BorrowableToken) GetToken ¶
func (b *BorrowableToken) GetToken() string
func (*BorrowableToken) GetVault ¶ added in v0.1.29
func (b *BorrowableToken) GetVault() optionalnullable.OptionalNullable[string]
type Builder ¶ added in v0.1.3
type Builder struct {
// Builder address that receives the fee. The address must hold ≥100 USDC on Hyperliquid perps and must not be the zero address.
Address string `json:"address"`
// Maximum fee rate the end-user authorizes for this builder, in Hyperliquid grammar (e.g. '0.01%'). Must end with '%' and parse to a value in [0, 100].
MaxFeeRate string `json:"max_fee_rate"`
}
Builder address + max fee rate the end-user authorizes.
func (*Builder) GetAddress ¶ added in v0.1.3
func (*Builder) GetMaxFeeRate ¶ added in v0.1.3
type Candle ¶ added in v0.1.5
type Candle struct {
// Candle open time as unix seconds (already converted from Hyperliquid's milliseconds — drop-in compatible with TradingView lightweight-charts).
Time int64 `json:"time"`
// Open price
Open string `json:"open"`
// High price
High string `json:"high"`
// Low price
Low string `json:"low"`
// Close price
Close string `json:"close"`
// Volume in base asset units
Volume string `json:"volume"`
// Number of trades in this candle
Trades int64 `json:"trades"`
}
Candle - A single OHLCV candle.
type Chain ¶
type Chain string
Chain - The chain to use.
type ChainMarketInfo ¶
type ChainMarketInfo struct {
// Underlying token (reserve) contract address on this chain. This is Aave's canonical per-reserve identifier.
Address string `json:"address"`
// Aave aToken contract address on this chain. This is the interest-bearing token that represents the supply position.
ATokenAddress string `json:"a_token_address"`
// Variable rate APY for deposits, in percentage (e.g., 4.5 means 4.5%). This is LENDING interest only — what borrowers pay. For a staked or wrapped asset it is not the whole yield; add `intrinsic_apy`.
SupplyApy string `json:"supply_apy"`
// What holding this asset earns OUTSIDE the lending pool, in percentage: staking rewards or vault yield accruing inside the token's own exchange rate, which the pool neither pays nor observes. A trailing 7-day measurement. ABSENT when no measurement is available (the route omits null fields) — absent does not mean zero. For an asset that plainly earns beyond lending (wstETH, sUSDe, wstHYPE) `supply_apy` alone understates what it earns by percentage points, since almost nobody borrows these and their supply rate rounds to nothing: Hyperlend's wstHYPE reserve pays 0.00006% against a ~2.5% staking yield. Treat an absent value as unknown rather than as the asset earning nothing beyond `supply_apy`.
IntrinsicApy optionalnullable.OptionalNullable[string] `json:"intrinsic_apy,omitzero"`
// Variable rate APY for loans, in percentage (e.g., 6.2 means 6.2%).
BorrowApy string `json:"borrow_apy"`
// Variable rate APY for deposits averaged over the `days` window in the request (default 30 days), in percentage. Computed the same way as the v1 `/v1/aave/avg_rate` endpoint.
SupplyApyAvg string `json:"supply_apy_avg"`
// Variable rate APY for loans averaged over the `days` window in the request (default 30 days), in percentage. Computed the same way as the v1 `/v1/aave/avg_rate` endpoint.
BorrowApyAvg string `json:"borrow_apy_avg"`
// Total amount currently borrowed from this market, in token units (e.g., 1234567.89 USDC).
TotalBorrowed string `json:"total_borrowed"`
// Amount of tokens available to borrow, in token units. Equals total supplied minus total borrowed.
AvailableLiquidity string `json:"available_liquidity"`
// Percentage of supplied tokens that are currently borrowed (e.g., 85.0 means 85%).
UtilizationRate string `json:"utilization_rate"`
// Maximum loan-to-value when this reserve is used as collateral, in percentage (e.g., 80.0 means 80%). This is the highest LTV you can borrow at against this asset; 0 means it cannot be used as collateral.
Ltv string `json:"ltv"`
// Liquidation threshold when this reserve is used as collateral, in percentage (e.g., 82.5 means 82.5%). A position whose LTV crosses this can be liquidated; 0 means the asset cannot be used as collateral.
LiquidationThreshold string `json:"liquidation_threshold"`
// Every Aave reserve for this token on this chain, ordered by liquidity (highest first). Identified by underlying `address`. For most tokens this has a single entry equal to the canonical reserve above; where a chain has multiple reserves for one symbol (e.g. Arbitrum native USDC and bridged USDC.e), all are listed with their individual rates.
Reserves []ReserveInfo `json:"reserves,omitzero"`
}
ChainMarketInfo - Rate information for a token on a specific chain.
The top-level fields describe the canonical (highest-liquidity) reserve for this token on this chain, preserving the original single-reserve shape. `reserves` lists every reserve for the token on this chain so clients can disambiguate cases like native USDC vs bridged USDC.e on Arbitrum.
func (*ChainMarketInfo) GetATokenAddress ¶
func (c *ChainMarketInfo) GetATokenAddress() string
func (*ChainMarketInfo) GetAddress ¶
func (c *ChainMarketInfo) GetAddress() string
func (*ChainMarketInfo) GetAvailableLiquidity ¶
func (c *ChainMarketInfo) GetAvailableLiquidity() string
func (*ChainMarketInfo) GetBorrowApy ¶
func (c *ChainMarketInfo) GetBorrowApy() string
func (*ChainMarketInfo) GetBorrowApyAvg ¶ added in v0.1.6
func (c *ChainMarketInfo) GetBorrowApyAvg() string
func (*ChainMarketInfo) GetIntrinsicApy ¶ added in v0.1.54
func (c *ChainMarketInfo) GetIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*ChainMarketInfo) GetLiquidationThreshold ¶ added in v0.1.43
func (c *ChainMarketInfo) GetLiquidationThreshold() string
func (*ChainMarketInfo) GetLtv ¶ added in v0.1.43
func (c *ChainMarketInfo) GetLtv() string
func (*ChainMarketInfo) GetReserves ¶ added in v0.1.16
func (c *ChainMarketInfo) GetReserves() []ReserveInfo
func (*ChainMarketInfo) GetSupplyApy ¶
func (c *ChainMarketInfo) GetSupplyApy() string
func (*ChainMarketInfo) GetSupplyApyAvg ¶ added in v0.1.6
func (c *ChainMarketInfo) GetSupplyApyAvg() string
func (*ChainMarketInfo) GetTotalBorrowed ¶
func (c *ChainMarketInfo) GetTotalBorrowed() string
func (*ChainMarketInfo) GetUtilizationRate ¶
func (c *ChainMarketInfo) GetUtilizationRate() string
func (ChainMarketInfo) MarshalJSON ¶ added in v0.1.16
func (c ChainMarketInfo) MarshalJSON() ([]byte, error)
func (*ChainMarketInfo) UnmarshalJSON ¶ added in v0.1.16
func (c *ChainMarketInfo) UnmarshalJSON(data []byte) error
type Classification ¶ added in v0.1.34
type Classification string
Classification - What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed.
const ( ClassificationLoopOpen Classification = "loop_open" ClassificationLoopIncrease Classification = "loop_increase" ClassificationUnwind Classification = "unwind" ClassificationSupply Classification = "supply" ClassificationWithdraw Classification = "withdraw" ClassificationBorrow Classification = "borrow" ClassificationRepay Classification = "repay" ClassificationLiquidation Classification = "liquidation" ClassificationMixed Classification = "mixed" )
func (*Classification) IsExact ¶ added in v0.1.34
func (e *Classification) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (Classification) ToPointer ¶ added in v0.1.34
func (e Classification) ToPointer() *Classification
type CollateralPosition ¶
type CollateralPosition struct {
// Address of the collateral token.
Token string `json:"token"`
// Symbol of the collateral token (e.g. USDC).
Symbol string `json:"symbol"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK collateral vault holding this position.
Vault optionalnullable.OptionalNullable[string] `json:"vault,omitzero"`
// Euler only: the EVC sub-account (0–255) this position belongs to. Each sub-account is an independent Euler position with its own health. Null for Aave/Morpho.
SubAccountID optionalnullable.OptionalNullable[int64] `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 id of the isolated market holding this position.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows.
IsPureSupply optionalnullable.OptionalNullable[bool] `json:"is_pure_supply,omitzero"`
// Current on-chain collateral balance (the vault's underlying asset for Euler).
AmountSupplied *string `json:"amount_supplied"`
// Collateral value in USD.
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// Current supply APY in percentage (e.g. 4.5 means 4.5%).
SupplyApy optionalnullable.OptionalNullable[string] `json:"supply_apy,omitzero"`
// Total collateral deposited over all time.
TotalDeposited optionalnullable.OptionalNullable[string] `json:"total_deposited,omitzero"`
// Total collateral withdrawn over all time.
TotalWithdrawn optionalnullable.OptionalNullable[string] `json:"total_withdrawn,omitzero"`
// Interest earned on collateral: on_chain_balance + total_withdrawn - total_deposited.
InterestEarned optionalnullable.OptionalNullable[string] `json:"interest_earned,omitzero"`
// Maximum loan-to-value ratio for this collateral in percentage (e.g. 80 means 80%).
MaxLtv optionalnullable.OptionalNullable[string] `json:"max_ltv,omitzero"`
// All historical events for this collateral reserve.
Events []CreditEvent `json:"events,omitzero"`
}
CollateralPosition - A per-reserve collateral position.
func (*CollateralPosition) GetAmountSupplied ¶
func (c *CollateralPosition) GetAmountSupplied() *string
func (*CollateralPosition) GetEvents ¶
func (c *CollateralPosition) GetEvents() []CreditEvent
func (*CollateralPosition) GetInterestEarned ¶
func (c *CollateralPosition) GetInterestEarned() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetIsPureSupply ¶ added in v0.1.34
func (c *CollateralPosition) GetIsPureSupply() optionalnullable.OptionalNullable[bool]
func (*CollateralPosition) GetMarketID ¶ added in v0.1.34
func (c *CollateralPosition) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetMaxLtv ¶
func (c *CollateralPosition) GetMaxLtv() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetProtocol ¶ added in v0.1.27
func (c *CollateralPosition) GetProtocol() *CreditProtocol
func (*CollateralPosition) GetSubAccountID ¶ added in v0.1.41
func (c *CollateralPosition) GetSubAccountID() optionalnullable.OptionalNullable[int64]
func (*CollateralPosition) GetSupplyApy ¶
func (c *CollateralPosition) GetSupplyApy() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetSymbol ¶
func (c *CollateralPosition) GetSymbol() string
func (*CollateralPosition) GetToken ¶
func (c *CollateralPosition) GetToken() string
func (*CollateralPosition) GetTotalDeposited ¶
func (c *CollateralPosition) GetTotalDeposited() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetTotalWithdrawn ¶
func (c *CollateralPosition) GetTotalWithdrawn() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetUsdValue ¶
func (c *CollateralPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
func (*CollateralPosition) GetVault ¶ added in v0.1.27
func (c *CollateralPosition) GetVault() optionalnullable.OptionalNullable[string]
func (CollateralPosition) MarshalJSON ¶
func (c CollateralPosition) MarshalJSON() ([]byte, error)
func (*CollateralPosition) UnmarshalJSON ¶
func (c *CollateralPosition) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsBalancesTokenBalance ¶
type CompassAPIBackendV2ModelsBalancesTokenBalance struct {
// The token contract address.
TokenAddress string `json:"token_address"`
// The token symbol (e.g., 'USDC').
TokenSymbol string `json:"token_symbol"`
// The token's decimal places.
TokenDecimals int64 `json:"token_decimals"`
// The current on-chain balance (raw).
Balance string `json:"balance"`
// The human-readable balance.
BalanceFormatted string `json:"balance_formatted"`
// Balance value in USD (null if price unavailable).
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// List of all transfers involving this token.
Transfers []TokenTransfer `json:"transfers,omitzero"`
}
CompassAPIBackendV2ModelsBalancesTokenBalance - Balance and transfer history for a single token.
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalance ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalance() string
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalanceFormatted ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetBalanceFormatted() string
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenAddress ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenAddress() string
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenDecimals ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenDecimals() int64
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenSymbol ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTokenSymbol() string
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetTransfers ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetTransfers() []TokenTransfer
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) GetUsdValue ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) GetUsdValue() optionalnullable.OptionalNullable[string]
func (CompassAPIBackendV2ModelsBalancesTokenBalance) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsBalancesTokenBalance) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsBalancesTokenBalance) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsBalancesTokenBalance) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition ¶
type CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition struct {
// The vault address.
VaultAddress string `json:"vault_address"`
// Name of the vault token (share token).
VaultName string `json:"vault_name"`
// Symbol of the underlying token (e.g., USDC).
UnderlyingSymbol string `json:"underlying_symbol"`
// Address of the underlying token.
UnderlyingAddress string `json:"underlying_address"`
// The user's position value in underlying token.
Balance *string `json:"balance"`
// Position value in USD (null if price unavailable).
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// PnL metrics for this position.
Pnl optionalnullable.OptionalNullable[PositionPnL] `json:"pnl,omitzero"`
// All deposit events for this position.
Deposits []DepositEvent `json:"deposits,omitzero"`
// All withdrawal events for this position.
Withdrawals []WithdrawalEvent `json:"withdrawals,omitzero"`
// 7-day annualized APY (percentage).
Apy7d optionalnullable.OptionalNullable[string] `json:"apy_7d,omitzero"`
// 30-day annualized APY (percentage).
Apy30d optionalnullable.OptionalNullable[string] `json:"apy_30d,omitzero"`
// 90-day annualized APY (percentage).
Apy90d optionalnullable.OptionalNullable[string] `json:"apy_90d,omitzero"`
// contains filtered or unexported fields
}
CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition - ERC-4626 vault position.
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy30d ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy30d() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy90d ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetApy90d() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetBalance ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetBalance() *string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetDeposits ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetDeposits() []DepositEvent
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetType ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetType() string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingAddress ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingAddress() string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingSymbol ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUnderlyingSymbol() string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUsdValue ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultAddress ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultAddress() string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultName ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetVaultName() string
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetWithdrawals ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) GetWithdrawals() []WithdrawalEvent
func (CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain ¶
type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain struct {
// EVM chain ID
ChainID int64 `json:"chainId"`
// Permit2 contract address
VerifyingContract string `json:"verifyingContract"`
// contains filtered or unexported fields
}
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetChainID ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetChainID() int64
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetName ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetName() *string
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetVerifyingContract ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) GetVerifyingContract() string
func (CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types ¶
type CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types struct {
// Standard EIP-712 domain type
Eip712Domain []Eip712Field `json:"EIP712Domain,omitzero"`
// TokenPermissions struct
TokenPermissions []Eip712Field `json:"TokenPermissions,omitzero"`
// Main permit message type
PermitTransferFrom []Eip712Field `json:"PermitTransferFrom,omitzero"`
}
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetEip712Domain ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetEip712Domain() []Eip712Field
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetPermitTransferFrom ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetPermitTransferFrom() []Eip712Field
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetTokenPermissions ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) GetTokenPermissions() []Eip712Field
func (CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain ¶
type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain struct {
// Token name
Name string `json:"name"`
// Token version (usually '1' or '2')
Version string `json:"version"`
// Chain ID
ChainID int64 `json:"chainId"`
// Token contract address
VerifyingContract string `json:"verifyingContract"`
}
CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain - The EIP-712 domain separator for ERC-20 Permit.
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetChainID ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetChainID() int64
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetName ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetName() string
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVerifyingContract ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVerifyingContract() string
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVersion ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) GetVersion() string
func (CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types ¶
type CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types struct {
// EIP712Domain type definition
Eip712Domain []Eip712DomainField `json:"EIP712Domain"`
// Permit type definition
Permit []PermitField `json:"Permit"`
}
CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types - The type definitions for EIP-712 structured data (ERC-20 Permit).
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetEip712Domain ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetEip712Domain() []Eip712DomainField
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetPermit ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) GetPermit() []PermitField
func (CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain ¶
type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain struct {
// Chain ID
ChainID int64 `json:"chainId"`
// Address of the Product Account
VerifyingContract string `json:"verifyingContract"`
}
CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain - The EIP-712 domain separator.
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetChainID ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetChainID() int64
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetVerifyingContract ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) GetVerifyingContract() string
func (CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types ¶
type CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types struct {
// EIP712Domain type definition
Eip712Domain []Eip712DomainField `json:"EIP712Domain"`
// SafeTx type definition
SafeTx []SafeTxField `json:"SafeTx"`
}
CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types - The type definitions for EIP-712 structured data.
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetEip712Domain ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetEip712Domain() []Eip712DomainField
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetSafeTx ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) GetSafeTx() []SafeTxField
func (CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Types) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket ¶
type CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket struct {
// On-chain token symbol (e.g. 'TSLAon').
Symbol string `json:"symbol"`
// Underlying equity ticker (e.g. 'TSLA').
UnderlyingTicker string `json:"underlying_ticker"`
// Underlying equity full name (e.g. 'Tesla, Inc. Common Stock').
Name string `json:"name"`
// On-chain ERC-20 address for this token, on the network given by `chain`.
ContractAddress string `json:"contract_address"`
// ERC-20 decimals for this token.
Decimals int64 `json:"decimals"`
// Latest price in USD as a decimal string.
CurrentPriceUsd string `json:"current_price_usd"`
// Absolute USD price change vs 24h ago (decimal string).
Change24hUsd optionalnullable.OptionalNullable[string] `json:"change_24h_usd,omitzero"`
// Percent price change vs 24h ago (decimal string).
Change24hPct optionalnullable.OptionalNullable[string] `json:"change_24h_pct,omitzero"`
// Sector / industry tags from the issuer (e.g. ['Technology']).
Sectors []string `json:"sectors,omitzero"`
// Regional market exposure tags (e.g. ['US']).
RegionExposure []string `json:"region_exposure,omitzero"`
// Issuer/provider of a tokenized asset.
Provider TokenizedAssetProvider `json:"provider"`
// Asset class of a tokenized asset.
//
// `EQUITY` trades via the order endpoints (build/submit/cancel); the RWA
// yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`), `MANAGED_VAULT`, and
// `DERWA` trade via the swap-based `transact/buy` and `transact/sell`
// endpoints. `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell
// is an *asynchronous* redemption request settled off-chain by the vault
// operator. `DERWA` (Centrifuge freely-transferable RWA wrappers) settles
// each buy/sell as a single instant DEX swap.
//
// `MONEY_MARKET` (WisdomTree Connect digital funds) also uses `transact/buy`
// and `transact/sell`, but neither swaps nor mints: a buy transfers the
// settlement stablecoin to the issuer's deposit address and the issuer mints
// fund shares back at the next NAV cycle, so settlement is *asynchronous*.
AssetClass TokenizedAssetClass `json:"asset_class"`
// The chain to use.
Chain Chain `json:"chain"`
// Trailing 7-day annualized NAV growth (decimal fraction string, e.g. '0.0512' = 5.12%). RWA yield assets only; null until enough NAV history exists.
Apy7d optionalnullable.OptionalNullable[string] `json:"apy_7d,omitzero"`
// Trailing 30-day annualized NAV growth (decimal fraction string). RWA yield assets only; null until enough NAV history exists.
Apy30d optionalnullable.OptionalNullable[string] `json:"apy_30d,omitzero"`
// Total value locked in USD (RWA yield assets only).
TvlUsd optionalnullable.OptionalNullable[string] `json:"tvl_usd,omitzero"`
// Live tradability: whether this market can be traded right now, and if not, why (and when it reopens). Equities follow US market sessions (some are 24-7 via an off-hours track); RWA yield / vault assets trade continuously unless the issuer pauses. Null if status is unavailable.
Status optionalnullable.OptionalNullable[TradingStatus] `json:"status,omitzero"`
// ISO country codes where this asset must not be offered (e.g. ['US']). Regulation-S instruments (Centrifuge deRWA) restrict US persons; the API surfaces the restriction for integrators to enforce — it does not itself geo-gate. Empty for unrestricted assets (Ondo/Midas/IXS).
RestrictedJurisdictions []string `json:"restricted_jurisdictions,omitzero"`
}
CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket - Compact market entry returned in list responses.
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy7d ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy7d() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy30d ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetApy30d() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetAssetClass ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetAssetClass() TokenizedAssetClass
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChain ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChain() Chain
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hPct ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hPct() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hUsd ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetChange24hUsd() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetContractAddress ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetContractAddress() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetCurrentPriceUsd ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetCurrentPriceUsd() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetDecimals ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetDecimals() int64
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetName ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetName() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetProvider ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetProvider() TokenizedAssetProvider
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRegionExposure ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRegionExposure() []string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRestrictedJurisdictions ¶ added in v0.1.47
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetRestrictedJurisdictions() []string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSectors ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSectors() []string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetStatus ¶ added in v0.1.36
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetStatus() optionalnullable.OptionalNullable[TradingStatus]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSymbol ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetSymbol() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetTvlUsd ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetTvlUsd() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetUnderlyingTicker ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) GetUnderlyingTicker() string
func (CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) MarshalJSON ¶
func (c CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) UnmarshalJSON ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket) UnmarshalJSON(data []byte) error
type CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition ¶
type CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition struct {
// On-chain Ondo symbol (e.g. `TSLAon`).
Symbol string `json:"symbol"`
// Underlying equity ticker.
UnderlyingTicker string `json:"underlying_ticker"`
// Underlying equity name (or ticker fallback).
Name string `json:"name"`
// Ethereum mainnet ERC-20 address.
ContractAddress string `json:"contract_address"`
// ERC-20 decimals.
Decimals int64 `json:"decimals"`
// Human-readable balance (already scaled by `decimals`).
Balance string `json:"balance"`
// USD spot price at read time (decimal string).
CurrentPriceUsd optionalnullable.OptionalNullable[string] `json:"current_price_usd,omitzero"`
// `balance * current_price_usd` when the price is available.
BalanceUsd optionalnullable.OptionalNullable[string] `json:"balance_usd,omitzero"`
// Issuer/provider of a tokenized asset.
Provider *TokenizedAssetProvider `json:"provider,omitzero"`
// Asset class of a tokenized asset.
//
// `EQUITY` trades via the order endpoints (build/submit/cancel); the RWA
// yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`), `MANAGED_VAULT`, and
// `DERWA` trade via the swap-based `transact/buy` and `transact/sell`
// endpoints. `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell
// is an *asynchronous* redemption request settled off-chain by the vault
// operator. `DERWA` (Centrifuge freely-transferable RWA wrappers) settles
// each buy/sell as a single instant DEX swap.
//
// `MONEY_MARKET` (WisdomTree Connect digital funds) also uses `transact/buy`
// and `transact/sell`, but neither swaps nor mints: a buy transfers the
// settlement stablecoin to the issuer's deposit address and the issuer mints
// fund shares back at the next NAV cycle, so settlement is *asynchronous*.
AssetClass *TokenizedAssetClass `json:"asset_class,omitzero"`
// The chain to use.
Chain *Chain `json:"chain,omitzero"`
// Realized + unrealized PnL for this position, or `null` when it cannot be priced (no current price, or externally-funded inventory with no on-chain cost basis).
Pnl optionalnullable.OptionalNullable[TokenizedAssetsPnl] `json:"pnl,omitzero"`
// Chronological activity for this position (buy / sell / transfer_in / transfer_out). Pure-USDC funding is excluded — it appears on the balances endpoint.
Events []TokenizedAssetsActivityEvent `json:"events,omitzero"`
}
CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition - One non-zero on-chain position in a tokenized equity.
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetAssetClass ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetAssetClass() *TokenizedAssetClass
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalance ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalance() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalanceUsd ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetBalanceUsd() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetChain ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetChain() *Chain
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetContractAddress ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetContractAddress() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetCurrentPriceUsd ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetCurrentPriceUsd() optionalnullable.OptionalNullable[string]
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetDecimals ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetDecimals() int64
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetEvents ¶ added in v0.1.23
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetEvents() []TokenizedAssetsActivityEvent
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetName ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetName() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetPnl ¶ added in v0.1.21
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetProvider ¶ added in v0.1.17
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetProvider() *TokenizedAssetProvider
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetSymbol ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetSymbol() string
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetUnderlyingTicker ¶
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) GetUnderlyingTicker() string
func (CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) MarshalJSON ¶ added in v0.1.21
func (c CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) MarshalJSON() ([]byte, error)
func (*CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) UnmarshalJSON ¶ added in v0.1.21
func (c *CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition) UnmarshalJSON(data []byte) error
type CreateAccountRequest ¶
type CreateAccountRequest struct {
Chain CreateAccountRequestChain `json:"chain"`
// The address of the transaction sender.
Sender string `json:"sender"`
// Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
EstimateGas *bool `json:"estimate_gas,omitzero"`
// The address that will own and control the compass account
Owner string `json:"owner"`
}
CreateAccountRequest - Request to create a compass account.
func (*CreateAccountRequest) GetChain ¶
func (c *CreateAccountRequest) GetChain() CreateAccountRequestChain
func (*CreateAccountRequest) GetEstimateGas ¶
func (c *CreateAccountRequest) GetEstimateGas() *bool
func (*CreateAccountRequest) GetOwner ¶
func (c *CreateAccountRequest) GetOwner() string
func (*CreateAccountRequest) GetSender ¶
func (c *CreateAccountRequest) GetSender() string
type CreateAccountRequestChain ¶
type CreateAccountRequestChain string
const ( CreateAccountRequestChainArbitrum CreateAccountRequestChain = "arbitrum" CreateAccountRequestChainBase CreateAccountRequestChain = "base" CreateAccountRequestChainBsc CreateAccountRequestChain = "bsc" CreateAccountRequestChainEthereum CreateAccountRequestChain = "ethereum" CreateAccountRequestChainTempo CreateAccountRequestChain = "tempo" )
func (CreateAccountRequestChain) ToPointer ¶
func (e CreateAccountRequestChain) ToPointer() *CreateAccountRequestChain
func (*CreateAccountRequestChain) UnmarshalJSON ¶
func (e *CreateAccountRequestChain) UnmarshalJSON(data []byte) error
type CreateAccountResponse ¶
type CreateAccountResponse struct {
// Transaction to create compass account
Transaction *UnsignedTransaction `json:"transaction"`
// Predicted address of the compass earn account that will be deployed
EarnAccountAddress string `json:"earn_account_address"`
}
CreateAccountResponse - Response containing unsigned transaction to create compass Earn account.
func (*CreateAccountResponse) GetEarnAccountAddress ¶
func (c *CreateAccountResponse) GetEarnAccountAddress() string
func (*CreateAccountResponse) GetTransaction ¶
func (c *CreateAccountResponse) GetTransaction() *UnsignedTransaction
type CreateCreditAccountRequest ¶
type CreateCreditAccountRequest struct {
Chain CreateCreditAccountRequestChain `json:"chain"`
// The address of the transaction sender.
Sender string `json:"sender"`
// Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
EstimateGas *bool `json:"estimate_gas,omitzero"`
// The address that will own and control the compass credit account
Owner string `json:"owner"`
}
CreateCreditAccountRequest - Request to create a compass credit account.
func (*CreateCreditAccountRequest) GetChain ¶
func (c *CreateCreditAccountRequest) GetChain() CreateCreditAccountRequestChain
func (*CreateCreditAccountRequest) GetEstimateGas ¶
func (c *CreateCreditAccountRequest) GetEstimateGas() *bool
func (*CreateCreditAccountRequest) GetOwner ¶
func (c *CreateCreditAccountRequest) GetOwner() string
func (*CreateCreditAccountRequest) GetSender ¶
func (c *CreateCreditAccountRequest) GetSender() string
type CreateCreditAccountRequestChain ¶
type CreateCreditAccountRequestChain string
const ( CreateCreditAccountRequestChainArbitrum CreateCreditAccountRequestChain = "arbitrum" CreateCreditAccountRequestChainBase CreateCreditAccountRequestChain = "base" CreateCreditAccountRequestChainBsc CreateCreditAccountRequestChain = "bsc" CreateCreditAccountRequestChainEthereum CreateCreditAccountRequestChain = "ethereum" CreateCreditAccountRequestChainHyperevm CreateCreditAccountRequestChain = "hyperevm" CreateCreditAccountRequestChainTempo CreateCreditAccountRequestChain = "tempo" )
func (CreateCreditAccountRequestChain) ToPointer ¶
func (e CreateCreditAccountRequestChain) ToPointer() *CreateCreditAccountRequestChain
func (*CreateCreditAccountRequestChain) UnmarshalJSON ¶
func (e *CreateCreditAccountRequestChain) UnmarshalJSON(data []byte) error
type CreateCreditAccountResponse ¶
type CreateCreditAccountResponse struct {
// Transaction to create compass credit account
Transaction *UnsignedTransaction `json:"transaction"`
// Predicted address of the compass credit account that will be deployed
CreditAccountAddress string `json:"credit_account_address"`
}
CreateCreditAccountResponse - Response containing unsigned transaction to create compass Credit account.
func (*CreateCreditAccountResponse) GetCreditAccountAddress ¶
func (c *CreateCreditAccountResponse) GetCreditAccountAddress() string
func (*CreateCreditAccountResponse) GetTransaction ¶
func (c *CreateCreditAccountResponse) GetTransaction() *UnsignedTransaction
type CreateTokenizedAssetsAccountRequest ¶
type CreateTokenizedAssetsAccountRequest struct {
// The address of the transaction sender.
Sender string `json:"sender"`
// The address that will own and control the compass Tokenized Assets Account
Owner string `json:"owner"`
// Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
EstimateGas *bool `json:"estimate_gas,omitzero"`
// The chain to use.
Chain *Chain `json:"chain,omitzero"`
}
CreateTokenizedAssetsAccountRequest - Request to create a compass Tokenized Assets Account.
func (*CreateTokenizedAssetsAccountRequest) GetChain ¶
func (c *CreateTokenizedAssetsAccountRequest) GetChain() *Chain
func (*CreateTokenizedAssetsAccountRequest) GetEstimateGas ¶
func (c *CreateTokenizedAssetsAccountRequest) GetEstimateGas() *bool
func (*CreateTokenizedAssetsAccountRequest) GetOwner ¶
func (c *CreateTokenizedAssetsAccountRequest) GetOwner() string
func (*CreateTokenizedAssetsAccountRequest) GetSender ¶
func (c *CreateTokenizedAssetsAccountRequest) GetSender() string
type CreateTokenizedAssetsAccountResponse ¶
type CreateTokenizedAssetsAccountResponse struct {
// Transaction to create compass Tokenized Assets Account
Transaction *UnsignedTransaction `json:"transaction"`
// Predicted address of the compass Tokenized Assets Account that will be deployed
TokenizedAssetsAccountAddress string `json:"tokenized_assets_account_address"`
}
CreateTokenizedAssetsAccountResponse - Response containing unsigned transaction to create compass Tokenized Assets Account.
func (*CreateTokenizedAssetsAccountResponse) GetTokenizedAssetsAccountAddress ¶
func (c *CreateTokenizedAssetsAccountResponse) GetTokenizedAssetsAccountAddress() string
func (*CreateTokenizedAssetsAccountResponse) GetTransaction ¶
func (c *CreateTokenizedAssetsAccountResponse) GetTransaction() *UnsignedTransaction
type CreditBalancesResponse ¶
type CreditBalancesResponse struct {
// The derived credit account address.
CreditAccountAddress string `json:"credit_account_address"`
// Token balances keyed by token symbol. Symbols are not unique on-chain: when two tokens collide, each key becomes 'SYMBOL (0xAddress)' — match on token_address for exactness.
Balances map[string]CompassAPIBackendV2ModelsBalancesTokenBalance `json:"balances,omitzero"`
// Total USD value of all balances (sum of available values).
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
CreditBalancesResponse - Response containing credit account balances and transfer history.
func (*CreditBalancesResponse) GetBalances ¶
func (c *CreditBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
func (*CreditBalancesResponse) GetCreditAccountAddress ¶
func (c *CreditBalancesResponse) GetCreditAccountAddress() string
func (*CreditBalancesResponse) GetTotalUsdValue ¶
func (c *CreditBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
func (CreditBalancesResponse) MarshalJSON ¶
func (c CreditBalancesResponse) MarshalJSON() ([]byte, error)
func (*CreditBalancesResponse) UnmarshalJSON ¶
func (c *CreditBalancesResponse) UnmarshalJSON(data []byte) error
type CreditBorrowParams ¶
type CreditBorrowParams struct {
// Token to borrow from Aave.
Token string `json:"token"`
// Amount in token units to borrow.
Amount CreditBorrowParamsAmount `json:"amount"`
// On AAVE there are 2 different interest modes.
//
// A stable (but typically higher rate), or a variable rate.
InterestRateMode *InterestRateMode `json:"interest_rate_mode,omitzero"`
// Optional fee on the borrowed amount.
Fee optionalnullable.OptionalNullable[CreditFee] `json:"fee,omitzero"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK vault to borrow from. Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Euler only: EVC sub-account (0–255) to borrow against. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// contains filtered or unexported fields
}
CreditBorrowParams - Borrow from Aave via Credit Account.
func (*CreditBorrowParams) GetActionType ¶
func (c *CreditBorrowParams) GetActionType() *string
func (*CreditBorrowParams) GetAmount ¶
func (c *CreditBorrowParams) GetAmount() CreditBorrowParamsAmount
func (*CreditBorrowParams) GetBorrowVault ¶ added in v0.1.27
func (c *CreditBorrowParams) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditBorrowParams) GetFee ¶
func (c *CreditBorrowParams) GetFee() optionalnullable.OptionalNullable[CreditFee]
func (*CreditBorrowParams) GetInterestRateMode ¶
func (c *CreditBorrowParams) GetInterestRateMode() *InterestRateMode
func (*CreditBorrowParams) GetMarketID ¶ added in v0.1.34
func (c *CreditBorrowParams) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditBorrowParams) GetProtocol ¶ added in v0.1.27
func (c *CreditBorrowParams) GetProtocol() *CreditProtocol
func (*CreditBorrowParams) GetSubAccountID ¶ added in v0.1.41
func (c *CreditBorrowParams) GetSubAccountID() *int64
func (*CreditBorrowParams) GetToken ¶
func (c *CreditBorrowParams) GetToken() string
func (CreditBorrowParams) MarshalJSON ¶
func (c CreditBorrowParams) MarshalJSON() ([]byte, error)
func (*CreditBorrowParams) UnmarshalJSON ¶
func (c *CreditBorrowParams) UnmarshalJSON(data []byte) error
type CreditBorrowParamsAmount ¶
type CreditBorrowParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditBorrowParamsAmountType
}
CreditBorrowParamsAmount - Amount in token units to borrow.
func CreateCreditBorrowParamsAmountNumber ¶
func CreateCreditBorrowParamsAmountNumber(number float64) CreditBorrowParamsAmount
func CreateCreditBorrowParamsAmountStr ¶
func CreateCreditBorrowParamsAmountStr(str string) CreditBorrowParamsAmount
func (CreditBorrowParamsAmount) MarshalJSON ¶
func (u CreditBorrowParamsAmount) MarshalJSON() ([]byte, error)
func (*CreditBorrowParamsAmount) UnmarshalJSON ¶
func (u *CreditBorrowParamsAmount) UnmarshalJSON(data []byte) error
type CreditBorrowParamsAmountType ¶
type CreditBorrowParamsAmountType string
const ( CreditBorrowParamsAmountTypeNumber CreditBorrowParamsAmountType = "number" CreditBorrowParamsAmountTypeStr CreditBorrowParamsAmountType = "str" )
type CreditBorrowRequest ¶
type CreditBorrowRequest struct {
// The address that owns the Credit Account.
Owner string `json:"owner"`
// Blockchain network.
Chain CreditBorrowRequestChain `json:"chain"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK collateral vault to supply into. Required when protocol=EULER and supplying collateral.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: the EVK vault to borrow from. Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Euler only: EVC sub-account (0–255) to isolate this position. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health, letting one Credit Account hold multiple isolated Euler positions. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed. Omit together with amount_in and collateral_token to borrow against existing collateral.
TokenIn optionalnullable.OptionalNullable[string] `json:"token_in,omitzero"`
// Amount of token_in to use (in token units, not wei). Omit together with token_in and collateral_token for borrow-only mode.
AmountIn optionalnullable.OptionalNullable[CreditBorrowRequestAmountIn] `json:"amount_in,omitzero"`
// Aave reserve token to supply as collateral. Omit together with token_in and amount_in for borrow-only mode.
CollateralToken optionalnullable.OptionalNullable[string] `json:"collateral_token,omitzero"`
// Asset to borrow from Aave.
BorrowToken string `json:"borrow_token"`
// Amount to borrow (in token units, not wei).
BorrowAmount BorrowAmount `json:"borrow_amount"`
// On AAVE there are 2 different interest modes.
//
// A stable (but typically higher rate), or a variable rate.
InterestRateMode *InterestRateMode `json:"interest_rate_mode,omitzero"`
// Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
Slippage *CreditBorrowRequestSlippage `json:"slippage,omitzero"`
// If true, returns EIP-712 signature data instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// Optional fee configuration. If provided, a fee will be deducted from the borrowed amount and sent to the specified recipient address.
Fee optionalnullable.OptionalNullable[CreditFee] `json:"fee,omitzero"`
// The EOA owner's signature of the Permit2 PermitTransferFrom typed data. When provided, the borrow bundle will first pull token_in from the owner's EOA into the Credit Account via Permit2. Obtain by calling /v2/credit/transfer and signing the returned EIP-712 data.
Permit2Signature optionalnullable.OptionalNullable[string] `json:"permit2_signature,omitzero"`
// The nonce used in the Permit2 signature (from the signed typed data).
Permit2Nonce optionalnullable.OptionalNullable[int64] `json:"permit2_nonce,omitzero"`
// The deadline timestamp used in the Permit2 signature (from the signed typed data).
Permit2Deadline optionalnullable.OptionalNullable[int64] `json:"permit2_deadline,omitzero"`
}
func (*CreditBorrowRequest) GetAmountIn ¶
func (c *CreditBorrowRequest) GetAmountIn() optionalnullable.OptionalNullable[CreditBorrowRequestAmountIn]
func (*CreditBorrowRequest) GetBorrowAmount ¶
func (c *CreditBorrowRequest) GetBorrowAmount() BorrowAmount
func (*CreditBorrowRequest) GetBorrowToken ¶
func (c *CreditBorrowRequest) GetBorrowToken() string
func (*CreditBorrowRequest) GetBorrowVault ¶ added in v0.1.27
func (c *CreditBorrowRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditBorrowRequest) GetChain ¶
func (c *CreditBorrowRequest) GetChain() CreditBorrowRequestChain
func (*CreditBorrowRequest) GetCollateralToken ¶
func (c *CreditBorrowRequest) GetCollateralToken() optionalnullable.OptionalNullable[string]
func (*CreditBorrowRequest) GetCollateralVault ¶ added in v0.1.27
func (c *CreditBorrowRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditBorrowRequest) GetFee ¶
func (c *CreditBorrowRequest) GetFee() optionalnullable.OptionalNullable[CreditFee]
func (*CreditBorrowRequest) GetGasSponsorship ¶
func (c *CreditBorrowRequest) GetGasSponsorship() *bool
func (*CreditBorrowRequest) GetInterestRateMode ¶
func (c *CreditBorrowRequest) GetInterestRateMode() *InterestRateMode
func (*CreditBorrowRequest) GetMarketID ¶ added in v0.1.34
func (c *CreditBorrowRequest) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditBorrowRequest) GetOwner ¶
func (c *CreditBorrowRequest) GetOwner() string
func (*CreditBorrowRequest) GetPermit2Deadline ¶
func (c *CreditBorrowRequest) GetPermit2Deadline() optionalnullable.OptionalNullable[int64]
func (*CreditBorrowRequest) GetPermit2Nonce ¶
func (c *CreditBorrowRequest) GetPermit2Nonce() optionalnullable.OptionalNullable[int64]
func (*CreditBorrowRequest) GetPermit2Signature ¶
func (c *CreditBorrowRequest) GetPermit2Signature() optionalnullable.OptionalNullable[string]
func (*CreditBorrowRequest) GetProtocol ¶ added in v0.1.27
func (c *CreditBorrowRequest) GetProtocol() *CreditProtocol
func (*CreditBorrowRequest) GetSlippage ¶
func (c *CreditBorrowRequest) GetSlippage() *CreditBorrowRequestSlippage
func (*CreditBorrowRequest) GetSubAccountID ¶ added in v0.1.41
func (c *CreditBorrowRequest) GetSubAccountID() *int64
func (*CreditBorrowRequest) GetTokenIn ¶
func (c *CreditBorrowRequest) GetTokenIn() optionalnullable.OptionalNullable[string]
func (CreditBorrowRequest) MarshalJSON ¶
func (c CreditBorrowRequest) MarshalJSON() ([]byte, error)
func (*CreditBorrowRequest) UnmarshalJSON ¶
func (c *CreditBorrowRequest) UnmarshalJSON(data []byte) error
type CreditBorrowRequestAmountIn ¶
type CreditBorrowRequestAmountIn struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditBorrowRequestAmountInType
}
CreditBorrowRequestAmountIn - Amount of token_in to use (in token units, not wei). Omit together with token_in and collateral_token for borrow-only mode.
func CreateCreditBorrowRequestAmountInNumber ¶
func CreateCreditBorrowRequestAmountInNumber(number float64) CreditBorrowRequestAmountIn
func CreateCreditBorrowRequestAmountInStr ¶
func CreateCreditBorrowRequestAmountInStr(str string) CreditBorrowRequestAmountIn
func (CreditBorrowRequestAmountIn) MarshalJSON ¶
func (u CreditBorrowRequestAmountIn) MarshalJSON() ([]byte, error)
func (*CreditBorrowRequestAmountIn) UnmarshalJSON ¶
func (u *CreditBorrowRequestAmountIn) UnmarshalJSON(data []byte) error
type CreditBorrowRequestAmountInType ¶
type CreditBorrowRequestAmountInType string
const ( CreditBorrowRequestAmountInTypeNumber CreditBorrowRequestAmountInType = "number" CreditBorrowRequestAmountInTypeStr CreditBorrowRequestAmountInType = "str" )
type CreditBorrowRequestChain ¶ added in v0.1.53
type CreditBorrowRequestChain string
CreditBorrowRequestChain - Blockchain network.
const ( CreditBorrowRequestChainArbitrum CreditBorrowRequestChain = "arbitrum" CreditBorrowRequestChainBase CreditBorrowRequestChain = "base" CreditBorrowRequestChainBsc CreditBorrowRequestChain = "bsc" CreditBorrowRequestChainEthereum CreditBorrowRequestChain = "ethereum" CreditBorrowRequestChainHyperevm CreditBorrowRequestChain = "hyperevm" CreditBorrowRequestChainTempo CreditBorrowRequestChain = "tempo" )
func (CreditBorrowRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditBorrowRequestChain) ToPointer() *CreditBorrowRequestChain
func (*CreditBorrowRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditBorrowRequestChain) UnmarshalJSON(data []byte) error
type CreditBorrowRequestSlippage ¶
type CreditBorrowRequestSlippage struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditBorrowRequestSlippageType
}
CreditBorrowRequestSlippage - Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
func CreateCreditBorrowRequestSlippageNumber ¶
func CreateCreditBorrowRequestSlippageNumber(number float64) CreditBorrowRequestSlippage
func CreateCreditBorrowRequestSlippageStr ¶
func CreateCreditBorrowRequestSlippageStr(str string) CreditBorrowRequestSlippage
func (CreditBorrowRequestSlippage) MarshalJSON ¶
func (u CreditBorrowRequestSlippage) MarshalJSON() ([]byte, error)
func (*CreditBorrowRequestSlippage) UnmarshalJSON ¶
func (u *CreditBorrowRequestSlippage) UnmarshalJSON(data []byte) error
type CreditBorrowRequestSlippageType ¶
type CreditBorrowRequestSlippageType string
const ( CreditBorrowRequestSlippageTypeNumber CreditBorrowRequestSlippageType = "number" CreditBorrowRequestSlippageTypeStr CreditBorrowRequestSlippageType = "str" )
type CreditBorrowResponse ¶
type CreditBorrowResponse struct {
// Unsigned transaction to execute the borrow bundle. Present when gas_sponsorship is false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship is true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Estimated amount of collateral token received from swap. Only present when token_in differs from collateral_token.
EstimatedCollateralAmount optionalnullable.OptionalNullable[string] `json:"estimated_collateral_amount,omitzero"`
// The fee amount charged on the borrow, in borrow token units. Present when a fee was applied.
FeeAmount optionalnullable.OptionalNullable[string] `json:"fee_amount,omitzero"`
}
func (*CreditBorrowResponse) GetEip712 ¶
func (c *CreditBorrowResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditBorrowResponse) GetEstimatedCollateralAmount ¶
func (c *CreditBorrowResponse) GetEstimatedCollateralAmount() optionalnullable.OptionalNullable[string]
func (*CreditBorrowResponse) GetFeeAmount ¶
func (c *CreditBorrowResponse) GetFeeAmount() optionalnullable.OptionalNullable[string]
func (*CreditBorrowResponse) GetTransaction ¶
func (c *CreditBorrowResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditBorrowResponse) MarshalJSON ¶
func (c CreditBorrowResponse) MarshalJSON() ([]byte, error)
func (*CreditBorrowResponse) UnmarshalJSON ¶
func (c *CreditBorrowResponse) UnmarshalJSON(data []byte) error
type CreditBundleRequest ¶
type CreditBundleRequest struct {
// The owner's wallet address that controls the Credit Account.
Owner string `json:"owner"`
// Target blockchain network where the bundled actions will execute.
Chain CreditBundleRequestChain `json:"chain"`
// List of actions to bundle. Actions are executed in order.
Actions []CreditUserOperation `json:"actions"`
// If true, returns EIP-712 typed data for gas-sponsored execution.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
}
CreditBundleRequest - Request to execute multiple credit actions in a single atomic transaction.
func (*CreditBundleRequest) GetActions ¶
func (c *CreditBundleRequest) GetActions() []CreditUserOperation
func (*CreditBundleRequest) GetChain ¶
func (c *CreditBundleRequest) GetChain() CreditBundleRequestChain
func (*CreditBundleRequest) GetGasSponsorship ¶
func (c *CreditBundleRequest) GetGasSponsorship() *bool
func (*CreditBundleRequest) GetOwner ¶
func (c *CreditBundleRequest) GetOwner() string
type CreditBundleRequestChain ¶ added in v0.1.53
type CreditBundleRequestChain string
CreditBundleRequestChain - Target blockchain network where the bundled actions will execute.
const ( CreditBundleRequestChainArbitrum CreditBundleRequestChain = "arbitrum" CreditBundleRequestChainBase CreditBundleRequestChain = "base" CreditBundleRequestChainBsc CreditBundleRequestChain = "bsc" CreditBundleRequestChainEthereum CreditBundleRequestChain = "ethereum" CreditBundleRequestChainHyperevm CreditBundleRequestChain = "hyperevm" CreditBundleRequestChainTempo CreditBundleRequestChain = "tempo" )
func (CreditBundleRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditBundleRequestChain) ToPointer() *CreditBundleRequestChain
func (*CreditBundleRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditBundleRequestChain) UnmarshalJSON(data []byte) error
type CreditBundleResponse ¶
type CreditBundleResponse struct {
// Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. Owner must sign and submit to /gas_sponsorship/prepare.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Number of individual transactions bundled in this execution.
ActionsCount int64 `json:"actions_count"`
}
func (*CreditBundleResponse) GetActionsCount ¶
func (c *CreditBundleResponse) GetActionsCount() int64
func (*CreditBundleResponse) GetEip712 ¶
func (c *CreditBundleResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditBundleResponse) GetTransaction ¶
func (c *CreditBundleResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditBundleResponse) MarshalJSON ¶
func (c CreditBundleResponse) MarshalJSON() ([]byte, error)
func (*CreditBundleResponse) UnmarshalJSON ¶
func (c *CreditBundleResponse) UnmarshalJSON(data []byte) error
type CreditEnableCollateralParams ¶
type CreditEnableCollateralParams struct {
// The underlying reserve token to enable as collateral (e.g. USDC, not aUSDC).
Token string `json:"token"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK collateral vault to enable. Required when protocol=EULER.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: EVC sub-account (0–255) to enable the collateral for. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// contains filtered or unexported fields
}
CreditEnableCollateralParams - Enable a reserve asset as collateral in Aave via Credit Account.
Required after receiving aTokens via direct ERC-20 transfer (not via Pool.supply()), since Aave V3 does not auto-enable collateral for transferred aTokens.
func (*CreditEnableCollateralParams) GetActionType ¶
func (c *CreditEnableCollateralParams) GetActionType() *string
func (*CreditEnableCollateralParams) GetCollateralVault ¶ added in v0.1.27
func (c *CreditEnableCollateralParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditEnableCollateralParams) GetProtocol ¶ added in v0.1.27
func (c *CreditEnableCollateralParams) GetProtocol() *CreditProtocol
func (*CreditEnableCollateralParams) GetSubAccountID ¶ added in v0.1.41
func (c *CreditEnableCollateralParams) GetSubAccountID() *int64
func (*CreditEnableCollateralParams) GetToken ¶
func (c *CreditEnableCollateralParams) GetToken() string
func (CreditEnableCollateralParams) MarshalJSON ¶
func (c CreditEnableCollateralParams) MarshalJSON() ([]byte, error)
func (*CreditEnableCollateralParams) UnmarshalJSON ¶
func (c *CreditEnableCollateralParams) UnmarshalJSON(data []byte) error
type CreditEvent ¶
type CreditEvent struct {
// Type of credit event.
EventType CreditEventEventType `json:"event_type"`
// Block number when the event occurred
BlockNumber int64 `json:"block_number"`
// Timestamp when the event occurred
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash of the event
TransactionHash string `json:"transaction_hash"`
// Amount involved in the event
Amount string `json:"amount"`
// Symbol of the token
Symbol string `json:"symbol"`
}
CreditEvent - A single historical event in a credit position.
func (*CreditEvent) GetAmount ¶
func (c *CreditEvent) GetAmount() string
func (*CreditEvent) GetBlockNumber ¶
func (c *CreditEvent) GetBlockNumber() int64
func (*CreditEvent) GetBlockTimestamp ¶
func (c *CreditEvent) GetBlockTimestamp() time.Time
func (*CreditEvent) GetEventType ¶
func (c *CreditEvent) GetEventType() CreditEventEventType
func (*CreditEvent) GetSymbol ¶
func (c *CreditEvent) GetSymbol() string
func (*CreditEvent) GetTransactionHash ¶
func (c *CreditEvent) GetTransactionHash() string
func (CreditEvent) MarshalJSON ¶
func (c CreditEvent) MarshalJSON() ([]byte, error)
func (*CreditEvent) UnmarshalJSON ¶
func (c *CreditEvent) UnmarshalJSON(data []byte) error
type CreditEventEventType ¶ added in v0.1.23
type CreditEventEventType string
CreditEventEventType - Type of credit event.
const ( CreditEventEventTypeSupply CreditEventEventType = "supply" CreditEventEventTypeWithdraw CreditEventEventType = "withdraw" CreditEventEventTypeBorrow CreditEventEventType = "borrow" CreditEventEventTypeRepay CreditEventEventType = "repay" CreditEventEventTypeLiquidation CreditEventEventType = "liquidation" CreditEventEventTypeTransferIn CreditEventEventType = "transfer_in" CreditEventEventTypeTransferOut CreditEventEventType = "transfer_out" )
func (*CreditEventEventType) IsExact ¶ added in v0.1.23
func (e *CreditEventEventType) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (CreditEventEventType) ToPointer ¶ added in v0.1.23
func (e CreditEventEventType) ToPointer() *CreditEventEventType
type CreditFee ¶
type CreditFee struct {
// The wallet address that will receive the fee.
Recipient string `json:"recipient"`
// The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
Amount CreditFeeAmount `json:"amount"`
// The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the borrow amount), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
Denomination *CreditFeeDenomination `json:"denomination,omitzero"`
}
CreditFee - Fee configuration for credit-product actions.
Same shape as `Fee`, but narrows `denomination` to the values supported by credit borrows. PERFORMANCE is not supported because realized-profit fees are not meaningful for debt positions.
func (*CreditFee) GetAmount ¶
func (c *CreditFee) GetAmount() CreditFeeAmount
func (*CreditFee) GetDenomination ¶
func (c *CreditFee) GetDenomination() *CreditFeeDenomination
func (*CreditFee) GetRecipient ¶
func (CreditFee) MarshalJSON ¶
func (*CreditFee) UnmarshalJSON ¶
type CreditFeeAmount ¶
type CreditFeeAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditFeeAmountType
}
CreditFeeAmount - The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
func CreateCreditFeeAmountNumber ¶
func CreateCreditFeeAmountNumber(number float64) CreditFeeAmount
func CreateCreditFeeAmountStr ¶
func CreateCreditFeeAmountStr(str string) CreditFeeAmount
func (CreditFeeAmount) MarshalJSON ¶
func (u CreditFeeAmount) MarshalJSON() ([]byte, error)
func (*CreditFeeAmount) UnmarshalJSON ¶
func (u *CreditFeeAmount) UnmarshalJSON(data []byte) error
type CreditFeeAmountType ¶
type CreditFeeAmountType string
const ( CreditFeeAmountTypeNumber CreditFeeAmountType = "number" CreditFeeAmountTypeStr CreditFeeAmountType = "str" )
type CreditFeeDenomination ¶
type CreditFeeDenomination string
CreditFeeDenomination - The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the borrow amount), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
const ( CreditFeeDenominationPercentage CreditFeeDenomination = "PERCENTAGE" CreditFeeDenominationFixed CreditFeeDenomination = "FIXED" )
func (CreditFeeDenomination) ToPointer ¶
func (e CreditFeeDenomination) ToPointer() *CreditFeeDenomination
func (*CreditFeeDenomination) UnmarshalJSON ¶
func (e *CreditFeeDenomination) UnmarshalJSON(data []byte) error
type CreditLoopPreview ¶ added in v0.1.34
type CreditLoopPreview struct {
// Number of loop iterations bundled.
Iterations int64 `json:"iterations"`
// Guaranteed minimum total collateral supplied (token units); actual can only be higher (swap fills above the floor become dust).
TotalCollateralSupplied string `json:"total_collateral_supplied"`
// Total loan tokens borrowed across iterations.
TotalBorrowed string `json:"total_borrowed"`
// Guaranteed leverage floor: total_collateral_supplied / initial_collateral_amount.
AchievedMultiplier string `json:"achieved_multiplier"`
// Projected end loan-to-value in percent, at the sizing oracle prices.
ProjectedLtv string `json:"projected_ltv"`
// Projected health factor (liquidation threshold / projected LTV). Below 1 would be liquidatable — the request is rejected long before that.
ProjectedHealthFactor string `json:"projected_health_factor"`
// Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote − guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost.
EstimatedMaxDust string `json:"estimated_max_dust"`
// Expected one-off cost of entering this loop, in COLLATERAL token units: the sum over swap legs of the market oracle's fair output minus the router's quote. This is the DEX fee plus price impact — the amount the position must earn back before it is ahead. Multiply by the collateral price for a USD figure. Distinct from estimated_max_dust, which is surplus retained in the account, not a cost. Excludes gas. Measured against the protocol's own oracle, so it also carries any oracle-to-market basis; clamped at zero.
EstimatedSwapCost string `json:"estimated_swap_cost"`
// Per-iteration breakdown.
Legs []LoopLegPreview `json:"legs,omitzero"`
}
CreditLoopPreview - Projected end state of the loop, computed on GUARANTEED swap floors.
func (*CreditLoopPreview) GetAchievedMultiplier ¶ added in v0.1.34
func (c *CreditLoopPreview) GetAchievedMultiplier() string
func (*CreditLoopPreview) GetEstimatedMaxDust ¶ added in v0.1.34
func (c *CreditLoopPreview) GetEstimatedMaxDust() string
func (*CreditLoopPreview) GetEstimatedSwapCost ¶ added in v0.1.52
func (c *CreditLoopPreview) GetEstimatedSwapCost() string
func (*CreditLoopPreview) GetIterations ¶ added in v0.1.34
func (c *CreditLoopPreview) GetIterations() int64
func (*CreditLoopPreview) GetLegs ¶ added in v0.1.34
func (c *CreditLoopPreview) GetLegs() []LoopLegPreview
func (*CreditLoopPreview) GetProjectedHealthFactor ¶ added in v0.1.34
func (c *CreditLoopPreview) GetProjectedHealthFactor() string
func (*CreditLoopPreview) GetProjectedLtv ¶ added in v0.1.34
func (c *CreditLoopPreview) GetProjectedLtv() string
func (*CreditLoopPreview) GetTotalBorrowed ¶ added in v0.1.34
func (c *CreditLoopPreview) GetTotalBorrowed() string
func (*CreditLoopPreview) GetTotalCollateralSupplied ¶ added in v0.1.34
func (c *CreditLoopPreview) GetTotalCollateralSupplied() string
func (CreditLoopPreview) MarshalJSON ¶ added in v0.1.34
func (c CreditLoopPreview) MarshalJSON() ([]byte, error)
func (*CreditLoopPreview) UnmarshalJSON ¶ added in v0.1.34
func (c *CreditLoopPreview) UnmarshalJSON(data []byte) error
type CreditLoopRequest ¶ added in v0.1.34
type CreditLoopRequest struct {
// The address that owns the Credit Account.
Owner string `json:"owner"`
// Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
Chain CreditLoopRequestChain `json:"chain"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Euler only: the EVK vault address collateral is supplied to (from /v2/credit/euler_markets). Required when protocol=EULER.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: the EVK vault address borrowed from (the sub-account's controller). Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Euler only: the EVC sub-account (0-255) holding this isolated looped position. 0 is the Credit Account itself.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Token supplied as collateral each iteration. Must already be in the Credit Account for the initial amount. For MORPHO it must be the market's collateral token.
CollateralToken string `json:"collateral_token"`
// Token borrowed each iteration and swapped back to the collateral token. For MORPHO it must be the market's loan token.
BorrowToken string `json:"borrow_token"`
// Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
InitialCollateralAmount InitialCollateralAmount `json:"initial_collateral_amount"`
// Target leverage: total collateral exposure = multiplier × initial_collateral_amount. Must be achievable at the requested loan_to_value (max ≈ 0.9 / (1 − LTV)).
Multiplier Multiplier `json:"multiplier"`
// Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
LoanToValue LoanToValue `json:"loan_to_value"`
// Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.
MaxSlippagePercent *CreditLoopRequestMaxSlippagePercent `json:"max_slippage_percent,omitzero"`
// Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated). Both tokens must belong to the category or the build returns a 422. On Hyperlend (chain=hyperevm) category 1 is the HYPE-correlated set covering wstHYPE and WHYPE.
EmodeCategory optionalnullable.OptionalNullable[int64] `json:"emode_category,omitzero"`
// If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent transaction: on a pair no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm provider's live price levels (indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
Preview *bool `json:"preview,omitzero"`
// Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews whose target the firm venue cannot serve return the coverage advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator and bounded by max_slippage_percent (which firm legs ignore). 'firm' is incompatible with gas_sponsorship (sponsored loops force market routing).
Pricing *CreditLoopRequestPricing `json:"pricing,omitzero"`
}
CreditLoopRequest - Open a leveraged loop: repeatedly supply collateral, borrow, and swap the borrow back to collateral — all in ONE atomic transaction from the Credit Account.
func (*CreditLoopRequest) GetBorrowToken ¶ added in v0.1.34
func (c *CreditLoopRequest) GetBorrowToken() string
func (*CreditLoopRequest) GetBorrowVault ¶ added in v0.1.45
func (c *CreditLoopRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditLoopRequest) GetChain ¶ added in v0.1.34
func (c *CreditLoopRequest) GetChain() CreditLoopRequestChain
func (*CreditLoopRequest) GetCollateralToken ¶ added in v0.1.34
func (c *CreditLoopRequest) GetCollateralToken() string
func (*CreditLoopRequest) GetCollateralVault ¶ added in v0.1.45
func (c *CreditLoopRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditLoopRequest) GetEmodeCategory ¶ added in v0.1.34
func (c *CreditLoopRequest) GetEmodeCategory() optionalnullable.OptionalNullable[int64]
func (*CreditLoopRequest) GetGasSponsorship ¶ added in v0.1.34
func (c *CreditLoopRequest) GetGasSponsorship() *bool
func (*CreditLoopRequest) GetInitialCollateralAmount ¶ added in v0.1.34
func (c *CreditLoopRequest) GetInitialCollateralAmount() InitialCollateralAmount
func (*CreditLoopRequest) GetLoanToValue ¶ added in v0.1.34
func (c *CreditLoopRequest) GetLoanToValue() LoanToValue
func (*CreditLoopRequest) GetMarketID ¶ added in v0.1.34
func (c *CreditLoopRequest) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditLoopRequest) GetMaxSlippagePercent ¶ added in v0.1.34
func (c *CreditLoopRequest) GetMaxSlippagePercent() *CreditLoopRequestMaxSlippagePercent
func (*CreditLoopRequest) GetMultiplier ¶ added in v0.1.34
func (c *CreditLoopRequest) GetMultiplier() Multiplier
func (*CreditLoopRequest) GetOwner ¶ added in v0.1.34
func (c *CreditLoopRequest) GetOwner() string
func (*CreditLoopRequest) GetPreview ¶ added in v0.1.55
func (c *CreditLoopRequest) GetPreview() *bool
func (*CreditLoopRequest) GetPricing ¶ added in v0.1.58
func (c *CreditLoopRequest) GetPricing() *CreditLoopRequestPricing
func (*CreditLoopRequest) GetProtocol ¶ added in v0.1.34
func (c *CreditLoopRequest) GetProtocol() *CreditProtocol
func (*CreditLoopRequest) GetSubAccountID ¶ added in v0.1.45
func (c *CreditLoopRequest) GetSubAccountID() *int64
type CreditLoopRequestChain ¶ added in v0.1.53
type CreditLoopRequestChain string
CreditLoopRequestChain - Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
const ( CreditLoopRequestChainArbitrum CreditLoopRequestChain = "arbitrum" CreditLoopRequestChainBase CreditLoopRequestChain = "base" CreditLoopRequestChainBsc CreditLoopRequestChain = "bsc" CreditLoopRequestChainEthereum CreditLoopRequestChain = "ethereum" CreditLoopRequestChainHyperevm CreditLoopRequestChain = "hyperevm" CreditLoopRequestChainTempo CreditLoopRequestChain = "tempo" )
func (CreditLoopRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditLoopRequestChain) ToPointer() *CreditLoopRequestChain
func (*CreditLoopRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditLoopRequestChain) UnmarshalJSON(data []byte) error
type CreditLoopRequestMaxSlippagePercent ¶ added in v0.1.35
type CreditLoopRequestMaxSlippagePercent struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditLoopRequestMaxSlippagePercentType
}
CreditLoopRequestMaxSlippagePercent - Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.
func CreateCreditLoopRequestMaxSlippagePercentNumber ¶ added in v0.1.35
func CreateCreditLoopRequestMaxSlippagePercentNumber(number float64) CreditLoopRequestMaxSlippagePercent
func CreateCreditLoopRequestMaxSlippagePercentStr ¶ added in v0.1.35
func CreateCreditLoopRequestMaxSlippagePercentStr(str string) CreditLoopRequestMaxSlippagePercent
func (CreditLoopRequestMaxSlippagePercent) MarshalJSON ¶ added in v0.1.35
func (u CreditLoopRequestMaxSlippagePercent) MarshalJSON() ([]byte, error)
func (*CreditLoopRequestMaxSlippagePercent) UnmarshalJSON ¶ added in v0.1.35
func (u *CreditLoopRequestMaxSlippagePercent) UnmarshalJSON(data []byte) error
type CreditLoopRequestMaxSlippagePercentType ¶ added in v0.1.35
type CreditLoopRequestMaxSlippagePercentType string
const ( CreditLoopRequestMaxSlippagePercentTypeNumber CreditLoopRequestMaxSlippagePercentType = "number" CreditLoopRequestMaxSlippagePercentTypeStr CreditLoopRequestMaxSlippagePercentType = "str" )
type CreditLoopRequestPricing ¶ added in v0.1.59
type CreditLoopRequestPricing string
CreditLoopRequestPricing - Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews whose target the firm venue cannot serve return the coverage advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator and bounded by max_slippage_percent (which firm legs ignore). 'firm' is incompatible with gas_sponsorship (sponsored loops force market routing).
const ( CreditLoopRequestPricingAuto CreditLoopRequestPricing = "auto" CreditLoopRequestPricingFirm CreditLoopRequestPricing = "firm" CreditLoopRequestPricingMarket CreditLoopRequestPricing = "market" )
func (CreditLoopRequestPricing) ToPointer ¶ added in v0.1.59
func (e CreditLoopRequestPricing) ToPointer() *CreditLoopRequestPricing
func (*CreditLoopRequestPricing) UnmarshalJSON ¶ added in v0.1.59
func (e *CreditLoopRequestPricing) UnmarshalJSON(data []byte) error
type CreditLoopResponse ¶ added in v0.1.34
type CreditLoopResponse struct {
// Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose target the firm venue cannot serve: no leg was priced on any venue, and the response carries the coverage advisory (max_firm_multiplier) alone.
Preview *CreditLoopPreview `json:"preview"`
// Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses a firm value means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview — so neither substitutes for this field.
SwapProvider *CreditLoopResponseSwapProvider `json:"swap_provider,omitzero"`
// Deadline of the firm swap quotes (the earliest across the loop's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview).
QuoteExpiresAt optionalnullable.OptionalNullable[time.Time] `json:"quote_expires_at,omitzero"`
// Multiplier bound firm zero-slippage quotes can fill for the requested position size, LTV and target (estimated without spending any quote). The requested multiplier is firm-servable iff it is <= this value; above it the loop executes at market rate with slippage-bounded floors instead. Present only on preview=true responses when a firm-quote venue covers the pair; null otherwise. Recompute per parameter change - minimum-size floors make reachability target-dependent.
MaxFirmMultiplier optionalnullable.OptionalNullable[string] `json:"max_firm_multiplier,omitzero"`
}
CreditLoopResponse - The atomic loop transaction plus its guaranteed-floor preview.
func (*CreditLoopResponse) GetEip712 ¶ added in v0.1.34
func (c *CreditLoopResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditLoopResponse) GetMaxFirmMultiplier ¶ added in v0.1.55
func (c *CreditLoopResponse) GetMaxFirmMultiplier() optionalnullable.OptionalNullable[string]
func (*CreditLoopResponse) GetPreview ¶ added in v0.1.34
func (c *CreditLoopResponse) GetPreview() *CreditLoopPreview
func (*CreditLoopResponse) GetQuoteExpiresAt ¶ added in v0.1.55
func (c *CreditLoopResponse) GetQuoteExpiresAt() optionalnullable.OptionalNullable[time.Time]
func (*CreditLoopResponse) GetSwapProvider ¶ added in v0.1.55
func (c *CreditLoopResponse) GetSwapProvider() *CreditLoopResponseSwapProvider
func (*CreditLoopResponse) GetTransaction ¶ added in v0.1.34
func (c *CreditLoopResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditLoopResponse) MarshalJSON ¶ added in v0.1.34
func (c CreditLoopResponse) MarshalJSON() ([]byte, error)
func (*CreditLoopResponse) UnmarshalJSON ¶ added in v0.1.34
func (c *CreditLoopResponse) UnmarshalJSON(data []byte) error
type CreditLoopResponseSwapProvider ¶ added in v0.1.55
type CreditLoopResponseSwapProvider string
CreditLoopResponseSwapProvider - Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses a firm value means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview — so neither substitutes for this field.
const ( CreditLoopResponseSwapProviderOneInch CreditLoopResponseSwapProvider = "one_inch" CreditLoopResponseSwapProviderBebop CreditLoopResponseSwapProvider = "bebop" )
func (*CreditLoopResponseSwapProvider) IsExact ¶ added in v0.1.55
func (e *CreditLoopResponseSwapProvider) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (CreditLoopResponseSwapProvider) ToPointer ¶ added in v0.1.55
func (e CreditLoopResponseSwapProvider) ToPointer() *CreditLoopResponseSwapProvider
type CreditLoopedPositionsResponse ¶ added in v0.1.34
type CreditLoopedPositionsResponse struct {
// The credit product account address derived from the owner.
CreditAccountAddress string `json:"credit_account_address"`
// All looped positions, on both Aave and Morpho.
Positions []LoopedPosition `json:"positions,omitzero"`
// Aave account-level summary (health factor, LTV, borrow capacity). Present when the account holds any open Aave looped position, since Aave collateral is pooled and health is account-level. Null for Morpho-only accounts.
AaveAccountSummary optionalnullable.OptionalNullable[AccountSummary] `json:"aave_account_summary,omitzero"`
}
CreditLoopedPositionsResponse - Looped positions across Aave V3 and Morpho Blue for a credit account.
func (*CreditLoopedPositionsResponse) GetAaveAccountSummary ¶ added in v0.1.34
func (c *CreditLoopedPositionsResponse) GetAaveAccountSummary() optionalnullable.OptionalNullable[AccountSummary]
func (*CreditLoopedPositionsResponse) GetCreditAccountAddress ¶ added in v0.1.34
func (c *CreditLoopedPositionsResponse) GetCreditAccountAddress() string
func (*CreditLoopedPositionsResponse) GetPositions ¶ added in v0.1.34
func (c *CreditLoopedPositionsResponse) GetPositions() []LoopedPosition
func (CreditLoopedPositionsResponse) MarshalJSON ¶ added in v0.1.34
func (c CreditLoopedPositionsResponse) MarshalJSON() ([]byte, error)
func (*CreditLoopedPositionsResponse) UnmarshalJSON ¶ added in v0.1.34
func (c *CreditLoopedPositionsResponse) UnmarshalJSON(data []byte) error
type CreditPositionsResponse ¶
type CreditPositionsResponse struct {
// All collateral positions, one per reserve.
CollateralPositions []CollateralPosition `json:"collateral_positions,omitzero"`
// All debt positions, one per reserve.
DebtPositions []DebtPosition `json:"debt_positions,omitzero"`
// Account-level summary for one lending protocol.
//
// Populated from Aave “getUserAccountData()“ or, for Euler, from the
// controller vault's risk engine (“accountLiquidity“). The E-Mode fields are
// Aave-only and stay at their defaults for Euler.
AccountSummary AccountSummary `json:"account_summary"`
// Euler account-level summaries — ONE PER ACTIVE EVC SUB-ACCOUNT (Euler health is per-sub-account, so an owner with positions on sub-accounts 0 and 3 gets two entries, each carrying its sub_account_id and independent health factor). Empty for accounts with no Euler positions. Supersedes the singular euler_account_summary.
EulerAccountSummaries []AccountSummary `json:"euler_account_summaries,omitzero"`
// DEPRECATED (use euler_account_summaries): the sub-account-0 Euler account-level summary, kept for one release for backwards compatibility. Present only when the account holds Euler positions; for a multi-sub-account owner it reflects only sub-account 0 (or the first active sub-account if 0 is empty). Null for Aave-only accounts.
EulerAccountSummary optionalnullable.OptionalNullable[AccountSummary] `json:"euler_account_summary,omitzero"`
// Euler-only: additional borrowable amounts given the account's current Euler controller (i.e. borrow more of the controller's asset). Empty for accounts with no Euler borrow position — use /credit/euler_markets to discover a new market to borrow from.
EulerBorrowableTokens []BorrowableToken `json:"euler_borrowable_tokens,omitzero"`
// All tokens available for borrowing with max amounts based on current collateral.
BorrowableTokens []BorrowableToken `json:"borrowable_tokens,omitzero"`
// Net position value in USD (total collateral - total debt). Null if prices unavailable.
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
CreditPositionsResponse - Credit account positions response with per-reserve positions and account summary.
func (*CreditPositionsResponse) GetAccountSummary ¶
func (c *CreditPositionsResponse) GetAccountSummary() AccountSummary
func (*CreditPositionsResponse) GetBorrowableTokens ¶
func (c *CreditPositionsResponse) GetBorrowableTokens() []BorrowableToken
func (*CreditPositionsResponse) GetCollateralPositions ¶
func (c *CreditPositionsResponse) GetCollateralPositions() []CollateralPosition
func (*CreditPositionsResponse) GetDebtPositions ¶
func (c *CreditPositionsResponse) GetDebtPositions() []DebtPosition
func (*CreditPositionsResponse) GetEulerAccountSummaries ¶ added in v0.1.41
func (c *CreditPositionsResponse) GetEulerAccountSummaries() []AccountSummary
func (*CreditPositionsResponse) GetEulerAccountSummary ¶ added in v0.1.27
func (c *CreditPositionsResponse) GetEulerAccountSummary() optionalnullable.OptionalNullable[AccountSummary]
func (*CreditPositionsResponse) GetEulerBorrowableTokens ¶ added in v0.1.29
func (c *CreditPositionsResponse) GetEulerBorrowableTokens() []BorrowableToken
func (*CreditPositionsResponse) GetTotalUsdValue ¶
func (c *CreditPositionsResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
func (CreditPositionsResponse) MarshalJSON ¶
func (c CreditPositionsResponse) MarshalJSON() ([]byte, error)
func (*CreditPositionsResponse) UnmarshalJSON ¶
func (c *CreditPositionsResponse) UnmarshalJSON(data []byte) error
type CreditProtocol ¶ added in v0.1.27
type CreditProtocol string
CreditProtocol - Which lending protocol a credit action targets.
“AAVE“ is the default so existing callers (which never send a “protocol“ field) keep hitting the unchanged Aave code path; markets are named by token symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32 “market_id“. “EULER“ identifies Euler V2 markets by their EVK “collateral_vault“ + “borrow_vault“ addresses and supports isolated per-sub-account positions (“sub_account_id“).
Deployment is per chain, so a valid protocol can still 422 on a given chain: AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does NOT: “/v2/credit/rebalance“ rejects it with a 422, and “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is silently absent there rather than an error, so read it from “/v2/credit/positions“ instead. (EULER still appears in the “looped_positions“ response enum because this enum is shared; it is never emitted.)
const ( CreditProtocolAave CreditProtocol = "AAVE" CreditProtocolEuler CreditProtocol = "EULER" CreditProtocolMorpho CreditProtocol = "MORPHO" )
func (*CreditProtocol) IsExact ¶ added in v0.1.27
func (e *CreditProtocol) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (CreditProtocol) ToPointer ¶ added in v0.1.27
func (e CreditProtocol) ToPointer() *CreditProtocol
type CreditRebalancePreview ¶ added in v0.1.37
type CreditRebalancePreview struct {
// Signed net equity moved: Σ(target − current equity, in USD) over the named targets. Positive = net book growth funded from the Credit Account's idle balance; negative = surplus equity released to idle. Truncated toward zero, so the reported magnitude is never larger than the true amount in either sign.
NetEquityMovedUsd string `json:"net_equity_moved_usd"`
// Total on-chain legs across the whole transaction, including capital-routing swaps. A rebalance too large for one transaction is rejected with a 422.
TotalLegs int64 `json:"total_legs"`
// The capital-routing swaps that move freed tokens between positions, at a guaranteed minimum output enforced on-chain.
RoutingSwaps []RoutingSwapPreview `json:"routing_swaps,omitzero"`
// Upper bound of surplus all swaps (per-target and routing) can leave in the Credit Account (sum of each swap's quote minus its guaranteed floor). It accumulates in the Credit Account, is recoverable, and is never lost.
EstimatedMaxDust string `json:"estimated_max_dust"`
// Projected account-level Aave health factor after the rebalance — Aave collateral is pooled, so this is shared by every Aave target. Present whenever the end state holds any Aave collateral or debt; null for Morpho-only books. Never overstated at the 1.0 boundary.
AaveAccountHealthFactor optionalnullable.OptionalNullable[string] `json:"aave_account_health_factor,omitzero"`
// Per-target end state, in the same order as the request targets.
PerTarget []RebalanceTargetPreview `json:"per_target"`
}
CreditRebalancePreview - Projected end state of the whole rebalance, computed on GUARANTEED swap floors.
func (*CreditRebalancePreview) GetAaveAccountHealthFactor ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetAaveAccountHealthFactor() optionalnullable.OptionalNullable[string]
func (*CreditRebalancePreview) GetEstimatedMaxDust ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetEstimatedMaxDust() string
func (*CreditRebalancePreview) GetNetEquityMovedUsd ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetNetEquityMovedUsd() string
func (*CreditRebalancePreview) GetPerTarget ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetPerTarget() []RebalanceTargetPreview
func (*CreditRebalancePreview) GetRoutingSwaps ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetRoutingSwaps() []RoutingSwapPreview
func (*CreditRebalancePreview) GetTotalLegs ¶ added in v0.1.37
func (c *CreditRebalancePreview) GetTotalLegs() int64
func (CreditRebalancePreview) MarshalJSON ¶ added in v0.1.37
func (c CreditRebalancePreview) MarshalJSON() ([]byte, error)
func (*CreditRebalancePreview) UnmarshalJSON ¶ added in v0.1.37
func (c *CreditRebalancePreview) UnmarshalJSON(data []byte) error
type CreditRebalanceRequest ¶ added in v0.1.37
type CreditRebalanceRequest struct {
// The address that owns the Credit Account.
Owner string `json:"owner"`
// Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.
Chain CreditRebalanceRequestChain `json:"chain"`
// The positions to change. Scoped: only positions named here are touched; any position not listed is left untouched.
Targets []RebalanceTarget `json:"targets"`
// Request-level per-swap slippage tolerance in percent (including routing swaps). A per-target max_slippage_percent overrides it where set.
MaxSlippagePercent *CreditRebalanceRequestMaxSlippagePercent `json:"max_slippage_percent,omitzero"`
// If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
}
CreditRebalanceRequest - Rebalance one or more Credit Account positions to their named end-states — lever up or down, grow or shrink equity, open a new position, close an existing one, or migrate (close one and open another) — all in ONE atomic transaction from the Credit Account.
func (*CreditRebalanceRequest) GetChain ¶ added in v0.1.37
func (c *CreditRebalanceRequest) GetChain() CreditRebalanceRequestChain
func (*CreditRebalanceRequest) GetGasSponsorship ¶ added in v0.1.37
func (c *CreditRebalanceRequest) GetGasSponsorship() *bool
func (*CreditRebalanceRequest) GetMaxSlippagePercent ¶ added in v0.1.37
func (c *CreditRebalanceRequest) GetMaxSlippagePercent() *CreditRebalanceRequestMaxSlippagePercent
func (*CreditRebalanceRequest) GetOwner ¶ added in v0.1.37
func (c *CreditRebalanceRequest) GetOwner() string
func (*CreditRebalanceRequest) GetTargets ¶ added in v0.1.37
func (c *CreditRebalanceRequest) GetTargets() []RebalanceTarget
type CreditRebalanceRequestChain ¶ added in v0.1.53
type CreditRebalanceRequestChain string
CreditRebalanceRequestChain - Blockchain network. Rebalance is not available on HyperEVM yet; use loop/unloop there.
const ( CreditRebalanceRequestChainArbitrum CreditRebalanceRequestChain = "arbitrum" CreditRebalanceRequestChainBase CreditRebalanceRequestChain = "base" CreditRebalanceRequestChainBsc CreditRebalanceRequestChain = "bsc" CreditRebalanceRequestChainEthereum CreditRebalanceRequestChain = "ethereum" CreditRebalanceRequestChainTempo CreditRebalanceRequestChain = "tempo" )
func (CreditRebalanceRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditRebalanceRequestChain) ToPointer() *CreditRebalanceRequestChain
func (*CreditRebalanceRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditRebalanceRequestChain) UnmarshalJSON(data []byte) error
type CreditRebalanceRequestMaxSlippagePercent ¶ added in v0.1.37
type CreditRebalanceRequestMaxSlippagePercent struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditRebalanceRequestMaxSlippagePercentType
}
CreditRebalanceRequestMaxSlippagePercent - Request-level per-swap slippage tolerance in percent (including routing swaps). A per-target max_slippage_percent overrides it where set.
func CreateCreditRebalanceRequestMaxSlippagePercentNumber ¶ added in v0.1.37
func CreateCreditRebalanceRequestMaxSlippagePercentNumber(number float64) CreditRebalanceRequestMaxSlippagePercent
func CreateCreditRebalanceRequestMaxSlippagePercentStr ¶ added in v0.1.37
func CreateCreditRebalanceRequestMaxSlippagePercentStr(str string) CreditRebalanceRequestMaxSlippagePercent
func (CreditRebalanceRequestMaxSlippagePercent) MarshalJSON ¶ added in v0.1.37
func (u CreditRebalanceRequestMaxSlippagePercent) MarshalJSON() ([]byte, error)
func (*CreditRebalanceRequestMaxSlippagePercent) UnmarshalJSON ¶ added in v0.1.37
func (u *CreditRebalanceRequestMaxSlippagePercent) UnmarshalJSON(data []byte) error
type CreditRebalanceRequestMaxSlippagePercentType ¶ added in v0.1.37
type CreditRebalanceRequestMaxSlippagePercentType string
const ( CreditRebalanceRequestMaxSlippagePercentTypeNumber CreditRebalanceRequestMaxSlippagePercentType = "number" CreditRebalanceRequestMaxSlippagePercentTypeStr CreditRebalanceRequestMaxSlippagePercentType = "str" )
type CreditRebalanceResponse ¶ added in v0.1.37
type CreditRebalanceResponse struct {
// Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false. Null when the book is already at its target — nothing to execute.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Projected end state of the whole rebalance, computed on GUARANTEED swap floors.
Preview CreditRebalancePreview `json:"preview"`
}
CreditRebalanceResponse - The atomic rebalance transaction plus its guaranteed-floor preview.
func (*CreditRebalanceResponse) GetEip712 ¶ added in v0.1.37
func (c *CreditRebalanceResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditRebalanceResponse) GetPreview ¶ added in v0.1.37
func (c *CreditRebalanceResponse) GetPreview() CreditRebalancePreview
func (*CreditRebalanceResponse) GetTransaction ¶ added in v0.1.37
func (c *CreditRebalanceResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditRebalanceResponse) MarshalJSON ¶ added in v0.1.37
func (c CreditRebalanceResponse) MarshalJSON() ([]byte, error)
func (*CreditRebalanceResponse) UnmarshalJSON ¶ added in v0.1.37
func (c *CreditRebalanceResponse) UnmarshalJSON(data []byte) error
type CreditRepayParams ¶
type CreditRepayParams struct {
// Token to repay.
Token string `json:"token"`
// Amount in token units to repay.
Amount CreditRepayParamsAmount `json:"amount"`
// On AAVE there are 2 different interest modes.
//
// A stable (but typically higher rate), or a variable rate.
InterestRateMode *InterestRateMode `json:"interest_rate_mode,omitzero"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK vault the debt is owed to. Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Euler only: EVC sub-account (0–255) holding the debt to repay. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// contains filtered or unexported fields
}
CreditRepayParams - Repay debt to Aave via Credit Account.
func (*CreditRepayParams) GetActionType ¶
func (c *CreditRepayParams) GetActionType() *string
func (*CreditRepayParams) GetAmount ¶
func (c *CreditRepayParams) GetAmount() CreditRepayParamsAmount
func (*CreditRepayParams) GetBorrowVault ¶ added in v0.1.27
func (c *CreditRepayParams) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditRepayParams) GetInterestRateMode ¶
func (c *CreditRepayParams) GetInterestRateMode() *InterestRateMode
func (*CreditRepayParams) GetMarketID ¶ added in v0.1.34
func (c *CreditRepayParams) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditRepayParams) GetProtocol ¶ added in v0.1.27
func (c *CreditRepayParams) GetProtocol() *CreditProtocol
func (*CreditRepayParams) GetSubAccountID ¶ added in v0.1.41
func (c *CreditRepayParams) GetSubAccountID() *int64
func (*CreditRepayParams) GetToken ¶
func (c *CreditRepayParams) GetToken() string
func (CreditRepayParams) MarshalJSON ¶
func (c CreditRepayParams) MarshalJSON() ([]byte, error)
func (*CreditRepayParams) UnmarshalJSON ¶
func (c *CreditRepayParams) UnmarshalJSON(data []byte) error
type CreditRepayParamsAmount ¶
type CreditRepayParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditRepayParamsAmountType
}
CreditRepayParamsAmount - Amount in token units to repay.
func CreateCreditRepayParamsAmountNumber ¶
func CreateCreditRepayParamsAmountNumber(number float64) CreditRepayParamsAmount
func CreateCreditRepayParamsAmountStr ¶
func CreateCreditRepayParamsAmountStr(str string) CreditRepayParamsAmount
func (CreditRepayParamsAmount) MarshalJSON ¶
func (u CreditRepayParamsAmount) MarshalJSON() ([]byte, error)
func (*CreditRepayParamsAmount) UnmarshalJSON ¶
func (u *CreditRepayParamsAmount) UnmarshalJSON(data []byte) error
type CreditRepayParamsAmountType ¶
type CreditRepayParamsAmountType string
const ( CreditRepayParamsAmountTypeNumber CreditRepayParamsAmountType = "number" CreditRepayParamsAmountTypeStr CreditRepayParamsAmountType = "str" )
type CreditRepayRequest ¶
type CreditRepayRequest struct {
// The address that owns the Credit Account.
Owner string `json:"owner"`
// Blockchain network.
Chain CreditRepayRequestChain `json:"chain"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK vault the debt is owed to (repay target). Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Euler only: the EVK collateral vault to withdraw from. Required when protocol=EULER and withdrawing collateral.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: EVC sub-account (0–255) holding the debt to repay. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// The borrowed asset to repay (e.g. WETH). Must match the debt position's token.
RepayToken string `json:"repay_token"`
// Amount of repay_token to repay (in token units, not wei).
RepayAmount RepayAmount `json:"repay_amount"`
// On AAVE there are 2 different interest modes.
//
// A stable (but typically higher rate), or a variable rate.
InterestRateMode *InterestRateMode `json:"interest_rate_mode,omitzero"`
// Collateral token to withdraw from Aave after repaying debt. Omit together with withdraw_amount for repay-only mode.
WithdrawToken optionalnullable.OptionalNullable[string] `json:"withdraw_token,omitzero"`
// Amount of collateral to withdraw (in token units, not wei). Omit together with withdraw_token for repay-only mode.
WithdrawAmount optionalnullable.OptionalNullable[WithdrawAmount] `json:"withdraw_amount,omitzero"`
// Desired output token. If different from withdraw_token, a swap is performed after withdrawal. If None, the withdrawn collateral is kept as-is.
TokenOut optionalnullable.OptionalNullable[string] `json:"token_out,omitzero"`
// Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
Slippage *CreditRepayRequestSlippage `json:"slippage,omitzero"`
// If true, returns EIP-712 signature data instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// The EOA owner's signature of the Permit2 PermitTransferFrom typed data. When provided, the repay bundle will first pull repay_token from the owner's EOA into the Credit Account via Permit2. Obtain by calling /v2/credit/transfer and signing the returned EIP-712 data.
Permit2Signature optionalnullable.OptionalNullable[string] `json:"permit2_signature,omitzero"`
// The nonce used in the Permit2 signature (from the signed typed data).
Permit2Nonce optionalnullable.OptionalNullable[int64] `json:"permit2_nonce,omitzero"`
// The deadline timestamp used in the Permit2 signature (from the signed typed data).
Permit2Deadline optionalnullable.OptionalNullable[int64] `json:"permit2_deadline,omitzero"`
}
func (*CreditRepayRequest) GetBorrowVault ¶ added in v0.1.27
func (c *CreditRepayRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditRepayRequest) GetChain ¶
func (c *CreditRepayRequest) GetChain() CreditRepayRequestChain
func (*CreditRepayRequest) GetCollateralVault ¶ added in v0.1.27
func (c *CreditRepayRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditRepayRequest) GetGasSponsorship ¶
func (c *CreditRepayRequest) GetGasSponsorship() *bool
func (*CreditRepayRequest) GetInterestRateMode ¶
func (c *CreditRepayRequest) GetInterestRateMode() *InterestRateMode
func (*CreditRepayRequest) GetMarketID ¶ added in v0.1.34
func (c *CreditRepayRequest) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditRepayRequest) GetOwner ¶
func (c *CreditRepayRequest) GetOwner() string
func (*CreditRepayRequest) GetPermit2Deadline ¶
func (c *CreditRepayRequest) GetPermit2Deadline() optionalnullable.OptionalNullable[int64]
func (*CreditRepayRequest) GetPermit2Nonce ¶
func (c *CreditRepayRequest) GetPermit2Nonce() optionalnullable.OptionalNullable[int64]
func (*CreditRepayRequest) GetPermit2Signature ¶
func (c *CreditRepayRequest) GetPermit2Signature() optionalnullable.OptionalNullable[string]
func (*CreditRepayRequest) GetProtocol ¶ added in v0.1.27
func (c *CreditRepayRequest) GetProtocol() *CreditProtocol
func (*CreditRepayRequest) GetRepayAmount ¶
func (c *CreditRepayRequest) GetRepayAmount() RepayAmount
func (*CreditRepayRequest) GetRepayToken ¶
func (c *CreditRepayRequest) GetRepayToken() string
func (*CreditRepayRequest) GetSlippage ¶
func (c *CreditRepayRequest) GetSlippage() *CreditRepayRequestSlippage
func (*CreditRepayRequest) GetSubAccountID ¶ added in v0.1.41
func (c *CreditRepayRequest) GetSubAccountID() *int64
func (*CreditRepayRequest) GetTokenOut ¶
func (c *CreditRepayRequest) GetTokenOut() optionalnullable.OptionalNullable[string]
func (*CreditRepayRequest) GetWithdrawAmount ¶
func (c *CreditRepayRequest) GetWithdrawAmount() optionalnullable.OptionalNullable[WithdrawAmount]
func (*CreditRepayRequest) GetWithdrawToken ¶
func (c *CreditRepayRequest) GetWithdrawToken() optionalnullable.OptionalNullable[string]
type CreditRepayRequestChain ¶ added in v0.1.53
type CreditRepayRequestChain string
CreditRepayRequestChain - Blockchain network.
const ( CreditRepayRequestChainArbitrum CreditRepayRequestChain = "arbitrum" CreditRepayRequestChainBase CreditRepayRequestChain = "base" CreditRepayRequestChainBsc CreditRepayRequestChain = "bsc" CreditRepayRequestChainEthereum CreditRepayRequestChain = "ethereum" CreditRepayRequestChainHyperevm CreditRepayRequestChain = "hyperevm" CreditRepayRequestChainTempo CreditRepayRequestChain = "tempo" )
func (CreditRepayRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditRepayRequestChain) ToPointer() *CreditRepayRequestChain
func (*CreditRepayRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditRepayRequestChain) UnmarshalJSON(data []byte) error
type CreditRepayRequestSlippage ¶
type CreditRepayRequestSlippage struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditRepayRequestSlippageType
}
CreditRepayRequestSlippage - Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%). Only used when a swap is needed.
func CreateCreditRepayRequestSlippageNumber ¶
func CreateCreditRepayRequestSlippageNumber(number float64) CreditRepayRequestSlippage
func CreateCreditRepayRequestSlippageStr ¶
func CreateCreditRepayRequestSlippageStr(str string) CreditRepayRequestSlippage
func (CreditRepayRequestSlippage) MarshalJSON ¶
func (u CreditRepayRequestSlippage) MarshalJSON() ([]byte, error)
func (*CreditRepayRequestSlippage) UnmarshalJSON ¶
func (u *CreditRepayRequestSlippage) UnmarshalJSON(data []byte) error
type CreditRepayRequestSlippageType ¶
type CreditRepayRequestSlippageType string
const ( CreditRepayRequestSlippageTypeNumber CreditRepayRequestSlippageType = "number" CreditRepayRequestSlippageTypeStr CreditRepayRequestSlippageType = "str" )
type CreditRepayResponse ¶
type CreditRepayResponse struct {
// Unsigned transaction to execute the repay bundle. Present when gas_sponsorship is false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship is true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Estimated amount of token_out received from swap. Only present when token_out differs from withdraw_token.
EstimatedTokenOutAmount optionalnullable.OptionalNullable[string] `json:"estimated_token_out_amount,omitzero"`
}
func (*CreditRepayResponse) GetEip712 ¶
func (c *CreditRepayResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditRepayResponse) GetEstimatedTokenOutAmount ¶
func (c *CreditRepayResponse) GetEstimatedTokenOutAmount() optionalnullable.OptionalNullable[string]
func (*CreditRepayResponse) GetTransaction ¶
func (c *CreditRepayResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditRepayResponse) MarshalJSON ¶
func (c CreditRepayResponse) MarshalJSON() ([]byte, error)
func (*CreditRepayResponse) UnmarshalJSON ¶
func (c *CreditRepayResponse) UnmarshalJSON(data []byte) error
type CreditSupplyParams ¶
type CreditSupplyParams struct {
// Collateral token to supply.
Token string `json:"token"`
// Amount in token units to supply.
Amount CreditSupplyParamsAmount `json:"amount"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK collateral vault to supply into. Required when protocol=EULER.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: EVC sub-account (0–255) to isolate this position. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// contains filtered or unexported fields
}
CreditSupplyParams - Supply collateral to Aave via Credit Account.
func (*CreditSupplyParams) GetActionType ¶
func (c *CreditSupplyParams) GetActionType() *string
func (*CreditSupplyParams) GetAmount ¶
func (c *CreditSupplyParams) GetAmount() CreditSupplyParamsAmount
func (*CreditSupplyParams) GetCollateralVault ¶ added in v0.1.27
func (c *CreditSupplyParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditSupplyParams) GetMarketID ¶ added in v0.1.34
func (c *CreditSupplyParams) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditSupplyParams) GetProtocol ¶ added in v0.1.27
func (c *CreditSupplyParams) GetProtocol() *CreditProtocol
func (*CreditSupplyParams) GetSubAccountID ¶ added in v0.1.41
func (c *CreditSupplyParams) GetSubAccountID() *int64
func (*CreditSupplyParams) GetToken ¶
func (c *CreditSupplyParams) GetToken() string
func (CreditSupplyParams) MarshalJSON ¶
func (c CreditSupplyParams) MarshalJSON() ([]byte, error)
func (*CreditSupplyParams) UnmarshalJSON ¶
func (c *CreditSupplyParams) UnmarshalJSON(data []byte) error
type CreditSupplyParamsAmount ¶
type CreditSupplyParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditSupplyParamsAmountType
}
CreditSupplyParamsAmount - Amount in token units to supply.
func CreateCreditSupplyParamsAmountNumber ¶
func CreateCreditSupplyParamsAmountNumber(number float64) CreditSupplyParamsAmount
func CreateCreditSupplyParamsAmountStr ¶
func CreateCreditSupplyParamsAmountStr(str string) CreditSupplyParamsAmount
func (CreditSupplyParamsAmount) MarshalJSON ¶
func (u CreditSupplyParamsAmount) MarshalJSON() ([]byte, error)
func (*CreditSupplyParamsAmount) UnmarshalJSON ¶
func (u *CreditSupplyParamsAmount) UnmarshalJSON(data []byte) error
type CreditSupplyParamsAmountType ¶
type CreditSupplyParamsAmountType string
const ( CreditSupplyParamsAmountTypeNumber CreditSupplyParamsAmountType = "number" CreditSupplyParamsAmountTypeStr CreditSupplyParamsAmountType = "str" )
type CreditTransferRequest ¶
type CreditTransferRequest struct {
// The owner's wallet address (EOA).
Owner string `json:"owner"`
// Blockchain network.
Chain CreditTransferRequestChain `json:"chain"`
// The token to transfer.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount CreditTransferRequestAmount `json:"amount"`
// Whether you are depositing to or withdrawing from your credit account.
Action CreditTransferRequestAction `json:"action"`
// Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Credit Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself.
Spender optionalnullable.OptionalNullable[string] `json:"spender,omitzero"`
}
func (*CreditTransferRequest) GetAction ¶
func (c *CreditTransferRequest) GetAction() CreditTransferRequestAction
func (*CreditTransferRequest) GetAmount ¶
func (c *CreditTransferRequest) GetAmount() CreditTransferRequestAmount
func (*CreditTransferRequest) GetChain ¶
func (c *CreditTransferRequest) GetChain() CreditTransferRequestChain
func (*CreditTransferRequest) GetGasSponsorship ¶
func (c *CreditTransferRequest) GetGasSponsorship() *bool
func (*CreditTransferRequest) GetOwner ¶
func (c *CreditTransferRequest) GetOwner() string
func (*CreditTransferRequest) GetSpender ¶
func (c *CreditTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
func (*CreditTransferRequest) GetToken ¶
func (c *CreditTransferRequest) GetToken() string
type CreditTransferRequestAction ¶
type CreditTransferRequestAction string
CreditTransferRequestAction - Whether you are depositing to or withdrawing from your credit account.
const ( CreditTransferRequestActionDeposit CreditTransferRequestAction = "DEPOSIT" CreditTransferRequestActionWithdraw CreditTransferRequestAction = "WITHDRAW" )
func (CreditTransferRequestAction) ToPointer ¶
func (e CreditTransferRequestAction) ToPointer() *CreditTransferRequestAction
func (*CreditTransferRequestAction) UnmarshalJSON ¶
func (e *CreditTransferRequestAction) UnmarshalJSON(data []byte) error
type CreditTransferRequestAmount ¶
type CreditTransferRequestAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditTransferRequestAmountType
}
CreditTransferRequestAmount - The amount of tokens to transfer (in token units, not wei).
func CreateCreditTransferRequestAmountNumber ¶
func CreateCreditTransferRequestAmountNumber(number float64) CreditTransferRequestAmount
func CreateCreditTransferRequestAmountStr ¶
func CreateCreditTransferRequestAmountStr(str string) CreditTransferRequestAmount
func (CreditTransferRequestAmount) MarshalJSON ¶
func (u CreditTransferRequestAmount) MarshalJSON() ([]byte, error)
func (*CreditTransferRequestAmount) UnmarshalJSON ¶
func (u *CreditTransferRequestAmount) UnmarshalJSON(data []byte) error
type CreditTransferRequestAmountType ¶
type CreditTransferRequestAmountType string
const ( CreditTransferRequestAmountTypeNumber CreditTransferRequestAmountType = "number" CreditTransferRequestAmountTypeStr CreditTransferRequestAmountType = "str" )
type CreditTransferRequestChain ¶ added in v0.1.53
type CreditTransferRequestChain string
CreditTransferRequestChain - Blockchain network.
const ( CreditTransferRequestChainArbitrum CreditTransferRequestChain = "arbitrum" CreditTransferRequestChainBase CreditTransferRequestChain = "base" CreditTransferRequestChainBsc CreditTransferRequestChain = "bsc" CreditTransferRequestChainEthereum CreditTransferRequestChain = "ethereum" CreditTransferRequestChainHyperevm CreditTransferRequestChain = "hyperevm" CreditTransferRequestChainTempo CreditTransferRequestChain = "tempo" )
func (CreditTransferRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditTransferRequestChain) ToPointer() *CreditTransferRequestChain
func (*CreditTransferRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditTransferRequestChain) UnmarshalJSON(data []byte) error
type CreditTransferResponse ¶
type CreditTransferResponse struct {
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
Eip712 optionalnullable.OptionalNullable[CreditTransferResponseEip712] `json:"eip_712,omitzero"`
}
func (*CreditTransferResponse) GetEip712 ¶
func (c *CreditTransferResponse) GetEip712() optionalnullable.OptionalNullable[CreditTransferResponseEip712]
func (*CreditTransferResponse) GetTransaction ¶
func (c *CreditTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditTransferResponse) MarshalJSON ¶
func (c CreditTransferResponse) MarshalJSON() ([]byte, error)
func (*CreditTransferResponse) UnmarshalJSON ¶
func (c *CreditTransferResponse) UnmarshalJSON(data []byte) error
type CreditTransferResponseEip712 ¶
type CreditTransferResponseEip712 struct {
BatchedSafeOperationsResponseOutput *BatchedSafeOperationsResponseOutput `queryParam:"inline" union:"member"`
Permit2TypedDataOutput *Permit2TypedDataOutput `queryParam:"inline" union:"member"`
UnknownRaw json.RawMessage `json:"-" union:"unknown"`
Type CreditTransferResponseEip712Type
}
func CreateCreditTransferResponseEip712BatchedSafeOperationsResponseOutput ¶
func CreateCreditTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) CreditTransferResponseEip712
func CreateCreditTransferResponseEip712Permit2TypedDataOutput ¶
func CreateCreditTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) CreditTransferResponseEip712
func CreateCreditTransferResponseEip712Unknown ¶
func CreateCreditTransferResponseEip712Unknown(raw json.RawMessage) CreditTransferResponseEip712
func (CreditTransferResponseEip712) GetUnknownRaw ¶
func (u CreditTransferResponseEip712) GetUnknownRaw() json.RawMessage
func (CreditTransferResponseEip712) IsUnknown ¶
func (u CreditTransferResponseEip712) IsUnknown() bool
func (CreditTransferResponseEip712) MarshalJSON ¶
func (u CreditTransferResponseEip712) MarshalJSON() ([]byte, error)
func (*CreditTransferResponseEip712) UnmarshalJSON ¶
func (u *CreditTransferResponseEip712) UnmarshalJSON(data []byte) error
type CreditTransferResponseEip712Type ¶
type CreditTransferResponseEip712Type string
const ( CreditTransferResponseEip712TypeBatchedSafeOperationsResponseOutput CreditTransferResponseEip712Type = "BatchedSafeOperationsResponse-Output" CreditTransferResponseEip712TypePermit2TypedDataOutput CreditTransferResponseEip712Type = "Permit2TypedData-Output" CreditTransferResponseEip712TypeUnknown CreditTransferResponseEip712Type = "Unknown" )
type CreditTransferToAddressParams ¶
type CreditTransferToAddressParams struct {
// The ERC20 token to transfer from the Credit Account.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount CreditTransferToAddressParamsAmount `json:"amount"`
// The destination address to receive the tokens.
Recipient string `json:"recipient"`
// contains filtered or unexported fields
}
CreditTransferToAddressParams - Transfer tokens from Credit Account to an arbitrary address.
Requires all debt positions to be fully repaid (totalDebtBase == 0) before the transfer is allowed.
func (*CreditTransferToAddressParams) GetActionType ¶
func (c *CreditTransferToAddressParams) GetActionType() *string
func (*CreditTransferToAddressParams) GetAmount ¶
func (c *CreditTransferToAddressParams) GetAmount() CreditTransferToAddressParamsAmount
func (*CreditTransferToAddressParams) GetRecipient ¶
func (c *CreditTransferToAddressParams) GetRecipient() string
func (*CreditTransferToAddressParams) GetToken ¶
func (c *CreditTransferToAddressParams) GetToken() string
func (CreditTransferToAddressParams) MarshalJSON ¶
func (c CreditTransferToAddressParams) MarshalJSON() ([]byte, error)
func (*CreditTransferToAddressParams) UnmarshalJSON ¶
func (c *CreditTransferToAddressParams) UnmarshalJSON(data []byte) error
type CreditTransferToAddressParamsAmount ¶
type CreditTransferToAddressParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditTransferToAddressParamsAmountType
}
CreditTransferToAddressParamsAmount - The amount of tokens to transfer (in token units, not wei).
func CreateCreditTransferToAddressParamsAmountNumber ¶
func CreateCreditTransferToAddressParamsAmountNumber(number float64) CreditTransferToAddressParamsAmount
func CreateCreditTransferToAddressParamsAmountStr ¶
func CreateCreditTransferToAddressParamsAmountStr(str string) CreditTransferToAddressParamsAmount
func (CreditTransferToAddressParamsAmount) MarshalJSON ¶
func (u CreditTransferToAddressParamsAmount) MarshalJSON() ([]byte, error)
func (*CreditTransferToAddressParamsAmount) UnmarshalJSON ¶
func (u *CreditTransferToAddressParamsAmount) UnmarshalJSON(data []byte) error
type CreditTransferToAddressParamsAmountType ¶
type CreditTransferToAddressParamsAmountType string
const ( CreditTransferToAddressParamsAmountTypeNumber CreditTransferToAddressParamsAmountType = "number" CreditTransferToAddressParamsAmountTypeStr CreditTransferToAddressParamsAmountType = "str" )
type CreditUnloopPreview ¶ added in v0.1.35
type CreditUnloopPreview struct {
// Number of swap-bearing unwind iterations bundled (the final collateral sweep leg does not count).
Iterations int64 `json:"iterations"`
// Guaranteed minimum total collateral withdrawn (token units).
TotalCollateralWithdrawn string `json:"total_collateral_withdrawn"`
// Guaranteed minimum total debt repaid (borrow-token units); actual can only be higher (swap fills above the floor repay more).
TotalDebtRepaid string `json:"total_debt_repaid"`
// Pair collateral left supplied after the unwind (token units). On a full close this is 0 when the sweep can take everything; when the final sweep must be an exact amount (non-pair Aave debt needs backing, or a shared reserve caps it) this reports the residual left supplied, including a dust-scale rounding margin.
EndingCollateral string `json:"ending_collateral"`
// Projected remaining debt (borrow-token units); 0 on a full close.
EndingDebt string `json:"ending_debt"`
// Projected leverage after the unwind; 1 when the debt is cleared. Never promises more deleverage than is guaranteed.
EndingMultiplier string `json:"ending_multiplier"`
// Projected end loan-to-value in percent, at the sizing oracle prices; 0 when the debt is cleared.
ProjectedLtv string `json:"projected_ltv"`
// Projected health factor (Aave account-level / Morpho market-level). Never overstated at the 1.0 boundary.
ProjectedHealthFactor string `json:"projected_health_factor"`
// Upper bound of borrow-token surplus the unwind can leave in the Credit Account — the sum of each swap's quote minus its guaranteed floor plus the full-close overshoot. It accumulates in the Credit Account, is recoverable, and is never lost.
EstimatedMaxDust string `json:"estimated_max_dust"`
// True when the requested target was fully reached in this transaction. False on a partial-progress plan (allow_partial=true) — call unloop again to finish.
FullyUnwound bool `json:"fully_unwound"`
// Per-iteration breakdown.
Legs []UnloopLegPreview `json:"legs,omitzero"`
}
CreditUnloopPreview - Projected end state of the unwind, computed on GUARANTEED swap floors.
func (*CreditUnloopPreview) GetEndingCollateral ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetEndingCollateral() string
func (*CreditUnloopPreview) GetEndingDebt ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetEndingDebt() string
func (*CreditUnloopPreview) GetEndingMultiplier ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetEndingMultiplier() string
func (*CreditUnloopPreview) GetEstimatedMaxDust ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetEstimatedMaxDust() string
func (*CreditUnloopPreview) GetFullyUnwound ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetFullyUnwound() bool
func (*CreditUnloopPreview) GetIterations ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetIterations() int64
func (*CreditUnloopPreview) GetLegs ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetLegs() []UnloopLegPreview
func (*CreditUnloopPreview) GetProjectedHealthFactor ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetProjectedHealthFactor() string
func (*CreditUnloopPreview) GetProjectedLtv ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetProjectedLtv() string
func (*CreditUnloopPreview) GetTotalCollateralWithdrawn ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetTotalCollateralWithdrawn() string
func (*CreditUnloopPreview) GetTotalDebtRepaid ¶ added in v0.1.35
func (c *CreditUnloopPreview) GetTotalDebtRepaid() string
func (CreditUnloopPreview) MarshalJSON ¶ added in v0.1.35
func (c CreditUnloopPreview) MarshalJSON() ([]byte, error)
func (*CreditUnloopPreview) UnmarshalJSON ¶ added in v0.1.35
func (c *CreditUnloopPreview) UnmarshalJSON(data []byte) error
type CreditUnloopRequest ¶ added in v0.1.35
type CreditUnloopRequest struct {
// The address that owns the Credit Account.
Owner string `json:"owner"`
// Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
Chain CreditUnloopRequestChain `json:"chain"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Euler only: the EVK vault the loop's collateral is in. Required when protocol=EULER.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: the EVK vault the loop borrowed from (the sub-account's controller). Required when protocol=EULER.
BorrowVault optionalnullable.OptionalNullable[string] `json:"borrow_vault,omitzero"`
// Euler only: the EVC sub-account (0-255) holding the looped position to unwind. 0 is the Credit Account itself.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Token supplied as collateral in the loop being unwound. For MORPHO it must be the market's collateral token.
CollateralToken string `json:"collateral_token"`
// Token borrowed in the loop; withdrawn collateral is swapped back to it and used to repay. For MORPHO it must be the market's loan token.
BorrowToken string `json:"borrow_token"`
// Target leverage after the unwind. Omit (null) for a FULL unwind: the debt is cleared exactly — accrued interest included — and all pair collateral is withdrawn back to the Credit Account. `1` runs the same exact debt close but leaves the collateral supplied (earning). A value greater than 1 delevers the position to that multiplier. Must be below the position's current multiplier.
TargetMultiplier optionalnullable.OptionalNullable[CreditUnloopRequestTargetMultiplier] `json:"target_multiplier,omitzero"`
// Per-swap slippage tolerance in percent. Unwind dust is bounded by this per iteration, so tighter slippage means less dust.
MaxSlippagePercent *CreditUnloopRequestMaxSlippagePercent `json:"max_slippage_percent,omitzero"`
// If the target cannot be reached in one transaction, return the maximum-progress plan (preview.fully_unwound=false) instead of a 400. This can happen because every withdrawal is sized to keep the health factor at or above 1.02 at that step, so a position opened very close to its liquidation threshold runs out of headroom before the target is met. A second unloop call, now from a much lower leverage, finishes the job.
AllowPartial *bool `json:"allow_partial,omitzero"`
// If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// If true, build a display estimate only — no single-use firm quote is ever spent. NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent transaction: on an unwind no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. On a firm-covered unwind (pricing 'auto' or 'firm') the numbers are firm-INDICATIVE, priced off the firm provider's live maker levels; otherwise they are market-priced with slippage-bounded floors. Under pricing='firm' a preview no firm provider can serve returns the advisory alone (preview=null + firm_available). Set it on every parameter-exploration call and omit it only on the build the user is about to sign.
Preview *bool `json:"preview,omitzero"`
// Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews the firm venue cannot serve return the firm_available advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator. max_slippage_percent applies on EVERY policy — unlike the loop, firm unwinds consume it to size the guaranteed withdraw/repay floors (the fills themselves are exact). 'firm' is incompatible with gas_sponsorship (sponsored unwinds force market routing).
Pricing *CreditUnloopRequestPricing `json:"pricing,omitzero"`
}
CreditUnloopRequest - Unwind a leveraged loop: repeatedly withdraw collateral, swap it back to the borrow token at a guaranteed minimum output, and repay — all in ONE atomic transaction from the Credit Account.
func (*CreditUnloopRequest) GetAllowPartial ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetAllowPartial() *bool
func (*CreditUnloopRequest) GetBorrowToken ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetBorrowToken() string
func (*CreditUnloopRequest) GetBorrowVault ¶ added in v0.1.45
func (c *CreditUnloopRequest) GetBorrowVault() optionalnullable.OptionalNullable[string]
func (*CreditUnloopRequest) GetChain ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetChain() CreditUnloopRequestChain
func (*CreditUnloopRequest) GetCollateralToken ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetCollateralToken() string
func (*CreditUnloopRequest) GetCollateralVault ¶ added in v0.1.45
func (c *CreditUnloopRequest) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditUnloopRequest) GetGasSponsorship ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetGasSponsorship() *bool
func (*CreditUnloopRequest) GetMarketID ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditUnloopRequest) GetMaxSlippagePercent ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetMaxSlippagePercent() *CreditUnloopRequestMaxSlippagePercent
func (*CreditUnloopRequest) GetOwner ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetOwner() string
func (*CreditUnloopRequest) GetPreview ¶ added in v0.1.55
func (c *CreditUnloopRequest) GetPreview() *bool
func (*CreditUnloopRequest) GetPricing ¶ added in v0.1.59
func (c *CreditUnloopRequest) GetPricing() *CreditUnloopRequestPricing
func (*CreditUnloopRequest) GetProtocol ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetProtocol() *CreditProtocol
func (*CreditUnloopRequest) GetSubAccountID ¶ added in v0.1.45
func (c *CreditUnloopRequest) GetSubAccountID() *int64
func (*CreditUnloopRequest) GetTargetMultiplier ¶ added in v0.1.35
func (c *CreditUnloopRequest) GetTargetMultiplier() optionalnullable.OptionalNullable[CreditUnloopRequestTargetMultiplier]
type CreditUnloopRequestChain ¶ added in v0.1.53
type CreditUnloopRequestChain string
CreditUnloopRequestChain - Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
const ( CreditUnloopRequestChainArbitrum CreditUnloopRequestChain = "arbitrum" CreditUnloopRequestChainBase CreditUnloopRequestChain = "base" CreditUnloopRequestChainBsc CreditUnloopRequestChain = "bsc" CreditUnloopRequestChainEthereum CreditUnloopRequestChain = "ethereum" CreditUnloopRequestChainHyperevm CreditUnloopRequestChain = "hyperevm" CreditUnloopRequestChainTempo CreditUnloopRequestChain = "tempo" )
func (CreditUnloopRequestChain) ToPointer ¶ added in v0.1.53
func (e CreditUnloopRequestChain) ToPointer() *CreditUnloopRequestChain
func (*CreditUnloopRequestChain) UnmarshalJSON ¶ added in v0.1.53
func (e *CreditUnloopRequestChain) UnmarshalJSON(data []byte) error
type CreditUnloopRequestMaxSlippagePercent ¶ added in v0.1.35
type CreditUnloopRequestMaxSlippagePercent struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditUnloopRequestMaxSlippagePercentType
}
CreditUnloopRequestMaxSlippagePercent - Per-swap slippage tolerance in percent. Unwind dust is bounded by this per iteration, so tighter slippage means less dust.
func CreateCreditUnloopRequestMaxSlippagePercentNumber ¶ added in v0.1.35
func CreateCreditUnloopRequestMaxSlippagePercentNumber(number float64) CreditUnloopRequestMaxSlippagePercent
func CreateCreditUnloopRequestMaxSlippagePercentStr ¶ added in v0.1.35
func CreateCreditUnloopRequestMaxSlippagePercentStr(str string) CreditUnloopRequestMaxSlippagePercent
func (CreditUnloopRequestMaxSlippagePercent) MarshalJSON ¶ added in v0.1.35
func (u CreditUnloopRequestMaxSlippagePercent) MarshalJSON() ([]byte, error)
func (*CreditUnloopRequestMaxSlippagePercent) UnmarshalJSON ¶ added in v0.1.35
func (u *CreditUnloopRequestMaxSlippagePercent) UnmarshalJSON(data []byte) error
type CreditUnloopRequestMaxSlippagePercentType ¶ added in v0.1.35
type CreditUnloopRequestMaxSlippagePercentType string
const ( CreditUnloopRequestMaxSlippagePercentTypeNumber CreditUnloopRequestMaxSlippagePercentType = "number" CreditUnloopRequestMaxSlippagePercentTypeStr CreditUnloopRequestMaxSlippagePercentType = "str" )
type CreditUnloopRequestPricing ¶ added in v0.1.59
type CreditUnloopRequestPricing string
CreditUnloopRequestPricing - Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews the firm venue cannot serve return the firm_available advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator. max_slippage_percent applies on EVERY policy — unlike the loop, firm unwinds consume it to size the guaranteed withdraw/repay floors (the fills themselves are exact). 'firm' is incompatible with gas_sponsorship (sponsored unwinds force market routing).
const ( CreditUnloopRequestPricingAuto CreditUnloopRequestPricing = "auto" CreditUnloopRequestPricingFirm CreditUnloopRequestPricing = "firm" CreditUnloopRequestPricingMarket CreditUnloopRequestPricing = "market" )
func (CreditUnloopRequestPricing) ToPointer ¶ added in v0.1.59
func (e CreditUnloopRequestPricing) ToPointer() *CreditUnloopRequestPricing
func (*CreditUnloopRequestPricing) UnmarshalJSON ¶ added in v0.1.59
func (e *CreditUnloopRequestPricing) UnmarshalJSON(data []byte) error
type CreditUnloopRequestTargetMultiplier ¶ added in v0.1.37
type CreditUnloopRequestTargetMultiplier struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditUnloopRequestTargetMultiplierType
}
CreditUnloopRequestTargetMultiplier - Target leverage after the unwind. Omit (null) for a FULL unwind: the debt is cleared exactly — accrued interest included — and all pair collateral is withdrawn back to the Credit Account. `1` runs the same exact debt close but leaves the collateral supplied (earning). A value greater than 1 delevers the position to that multiplier. Must be below the position's current multiplier.
func CreateCreditUnloopRequestTargetMultiplierNumber ¶ added in v0.1.37
func CreateCreditUnloopRequestTargetMultiplierNumber(number float64) CreditUnloopRequestTargetMultiplier
func CreateCreditUnloopRequestTargetMultiplierStr ¶ added in v0.1.37
func CreateCreditUnloopRequestTargetMultiplierStr(str string) CreditUnloopRequestTargetMultiplier
func (CreditUnloopRequestTargetMultiplier) MarshalJSON ¶ added in v0.1.37
func (u CreditUnloopRequestTargetMultiplier) MarshalJSON() ([]byte, error)
func (*CreditUnloopRequestTargetMultiplier) UnmarshalJSON ¶ added in v0.1.37
func (u *CreditUnloopRequestTargetMultiplier) UnmarshalJSON(data []byte) error
type CreditUnloopRequestTargetMultiplierType ¶ added in v0.1.37
type CreditUnloopRequestTargetMultiplierType string
const ( CreditUnloopRequestTargetMultiplierTypeNumber CreditUnloopRequestTargetMultiplierType = "number" CreditUnloopRequestTargetMultiplierTypeStr CreditUnloopRequestTargetMultiplierType = "str" )
type CreditUnloopResponse ¶ added in v0.1.35
type CreditUnloopResponse struct {
// Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose unwind the firm venue cannot serve: no leg was priced on any venue, and the response carries the firm_available advisory alone.
Preview *CreditUnloopPreview `json:"preview"`
// Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview — so neither substitutes for this field.
SwapProvider *CreditUnloopResponseSwapProvider `json:"swap_provider,omitzero"`
// Deadline of the firm swap quotes (the earliest across the unwind's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview).
QuoteExpiresAt optionalnullable.OptionalNullable[time.Time] `json:"quote_expires_at,omitzero"`
// Preview-only advisory: whether a firm-quote venue can serve this unwind's swap legs (estimated without spending any quote). Present only on preview=true responses; null otherwise. Computed on every policy — including pricing='market', whose preview numbers stay market-priced — so a client that opted out can keep the boundary visible.
FirmAvailable optionalnullable.OptionalNullable[bool] `json:"firm_available,omitzero"`
}
CreditUnloopResponse - The atomic unwind transaction plus its guaranteed-floor preview.
func (*CreditUnloopResponse) GetEip712 ¶ added in v0.1.35
func (c *CreditUnloopResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*CreditUnloopResponse) GetFirmAvailable ¶ added in v0.1.55
func (c *CreditUnloopResponse) GetFirmAvailable() optionalnullable.OptionalNullable[bool]
func (*CreditUnloopResponse) GetPreview ¶ added in v0.1.35
func (c *CreditUnloopResponse) GetPreview() *CreditUnloopPreview
func (*CreditUnloopResponse) GetQuoteExpiresAt ¶ added in v0.1.55
func (c *CreditUnloopResponse) GetQuoteExpiresAt() optionalnullable.OptionalNullable[time.Time]
func (*CreditUnloopResponse) GetSwapProvider ¶ added in v0.1.55
func (c *CreditUnloopResponse) GetSwapProvider() *CreditUnloopResponseSwapProvider
func (*CreditUnloopResponse) GetTransaction ¶ added in v0.1.35
func (c *CreditUnloopResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (CreditUnloopResponse) MarshalJSON ¶ added in v0.1.35
func (c CreditUnloopResponse) MarshalJSON() ([]byte, error)
func (*CreditUnloopResponse) UnmarshalJSON ¶ added in v0.1.35
func (c *CreditUnloopResponse) UnmarshalJSON(data []byte) error
type CreditUnloopResponseSwapProvider ¶ added in v0.1.55
type CreditUnloopResponseSwapProvider string
CreditUnloopResponseSwapProvider - Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview — so neither substitutes for this field.
const ( CreditUnloopResponseSwapProviderOneInch CreditUnloopResponseSwapProvider = "one_inch" CreditUnloopResponseSwapProviderBebop CreditUnloopResponseSwapProvider = "bebop" )
func (*CreditUnloopResponseSwapProvider) IsExact ¶ added in v0.1.55
func (e *CreditUnloopResponseSwapProvider) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (CreditUnloopResponseSwapProvider) ToPointer ¶ added in v0.1.55
func (e CreditUnloopResponseSwapProvider) ToPointer() *CreditUnloopResponseSwapProvider
type CreditUserOperation ¶
type CreditUserOperation struct {
Body CreditUserOperationBody `json:"body"`
}
CreditUserOperation - A single operation in a credit bundle.
func (*CreditUserOperation) GetBody ¶
func (c *CreditUserOperation) GetBody() CreditUserOperationBody
func (*CreditUserOperation) GetBodyCreditBorrow ¶
func (c *CreditUserOperation) GetBodyCreditBorrow() *CreditBorrowParams
func (*CreditUserOperation) GetBodyCreditEnableCollateral ¶
func (c *CreditUserOperation) GetBodyCreditEnableCollateral() *CreditEnableCollateralParams
func (*CreditUserOperation) GetBodyCreditRepay ¶
func (c *CreditUserOperation) GetBodyCreditRepay() *CreditRepayParams
func (*CreditUserOperation) GetBodyCreditSupply ¶
func (c *CreditUserOperation) GetBodyCreditSupply() *CreditSupplyParams
func (*CreditUserOperation) GetBodyCreditTransferToAddress ¶
func (c *CreditUserOperation) GetBodyCreditTransferToAddress() *CreditTransferToAddressParams
func (*CreditUserOperation) GetBodyCreditWithdraw ¶
func (c *CreditUserOperation) GetBodyCreditWithdraw() *CreditWithdrawParams
func (*CreditUserOperation) GetBodyV2Swap ¶
func (c *CreditUserOperation) GetBodyV2Swap() *EarnSwapParams
func (*CreditUserOperation) GetBodyV2TransferFromEoa ¶
func (c *CreditUserOperation) GetBodyV2TransferFromEoa() *EarnTransferFromEOAParams
func (*CreditUserOperation) GetBodyV2TransferToEoa ¶
func (c *CreditUserOperation) GetBodyV2TransferToEoa() *EarnTransferToEOAParams
type CreditUserOperationBody ¶
type CreditUserOperationBody struct {
EarnSwapParams *EarnSwapParams `queryParam:"inline" union:"member"`
EarnTransferFromEOAParams *EarnTransferFromEOAParams `queryParam:"inline" union:"member"`
EarnTransferToEOAParams *EarnTransferToEOAParams `queryParam:"inline" union:"member"`
CreditSupplyParams *CreditSupplyParams `queryParam:"inline" union:"member"`
CreditWithdrawParams *CreditWithdrawParams `queryParam:"inline" union:"member"`
CreditBorrowParams *CreditBorrowParams `queryParam:"inline" union:"member"`
CreditRepayParams *CreditRepayParams `queryParam:"inline" union:"member"`
CreditEnableCollateralParams *CreditEnableCollateralParams `queryParam:"inline" union:"member"`
CreditTransferToAddressParams *CreditTransferToAddressParams `queryParam:"inline" union:"member"`
Type CreditUserOperationBodyType
}
func CreateCreditUserOperationBodyCreditBorrow ¶
func CreateCreditUserOperationBodyCreditBorrow(creditBorrow CreditBorrowParams) CreditUserOperationBody
func CreateCreditUserOperationBodyCreditEnableCollateral ¶
func CreateCreditUserOperationBodyCreditEnableCollateral(creditEnableCollateral CreditEnableCollateralParams) CreditUserOperationBody
func CreateCreditUserOperationBodyCreditRepay ¶
func CreateCreditUserOperationBodyCreditRepay(creditRepay CreditRepayParams) CreditUserOperationBody
func CreateCreditUserOperationBodyCreditSupply ¶
func CreateCreditUserOperationBodyCreditSupply(creditSupply CreditSupplyParams) CreditUserOperationBody
func CreateCreditUserOperationBodyCreditTransferToAddress ¶
func CreateCreditUserOperationBodyCreditTransferToAddress(creditTransferToAddress CreditTransferToAddressParams) CreditUserOperationBody
func CreateCreditUserOperationBodyCreditWithdraw ¶
func CreateCreditUserOperationBodyCreditWithdraw(creditWithdraw CreditWithdrawParams) CreditUserOperationBody
func CreateCreditUserOperationBodyV2Swap ¶
func CreateCreditUserOperationBodyV2Swap(v2Swap EarnSwapParams) CreditUserOperationBody
func CreateCreditUserOperationBodyV2TransferFromEoa ¶
func CreateCreditUserOperationBodyV2TransferFromEoa(v2TransferFromEoa EarnTransferFromEOAParams) CreditUserOperationBody
func CreateCreditUserOperationBodyV2TransferToEoa ¶
func CreateCreditUserOperationBodyV2TransferToEoa(v2TransferToEoa EarnTransferToEOAParams) CreditUserOperationBody
func (CreditUserOperationBody) MarshalJSON ¶
func (u CreditUserOperationBody) MarshalJSON() ([]byte, error)
func (*CreditUserOperationBody) UnmarshalJSON ¶
func (u *CreditUserOperationBody) UnmarshalJSON(data []byte) error
type CreditUserOperationBodyType ¶
type CreditUserOperationBodyType string
const ( CreditUserOperationBodyTypeCreditBorrow CreditUserOperationBodyType = "CREDIT_BORROW" CreditUserOperationBodyTypeCreditEnableCollateral CreditUserOperationBodyType = "CREDIT_ENABLE_COLLATERAL" CreditUserOperationBodyTypeCreditRepay CreditUserOperationBodyType = "CREDIT_REPAY" CreditUserOperationBodyTypeCreditSupply CreditUserOperationBodyType = "CREDIT_SUPPLY" CreditUserOperationBodyTypeCreditTransferToAddress CreditUserOperationBodyType = "CREDIT_TRANSFER_TO_ADDRESS" CreditUserOperationBodyTypeCreditWithdraw CreditUserOperationBodyType = "CREDIT_WITHDRAW" CreditUserOperationBodyTypeV2Swap CreditUserOperationBodyType = "V2_SWAP" CreditUserOperationBodyTypeV2TransferFromEoa CreditUserOperationBodyType = "V2_TRANSFER_FROM_EOA" CreditUserOperationBodyTypeV2TransferToEoa CreditUserOperationBodyType = "V2_TRANSFER_TO_EOA" )
type CreditWithdrawParams ¶
type CreditWithdrawParams struct {
// Collateral token to withdraw.
Token string `json:"token"`
// Amount in token units to withdraw.
Amount CreditWithdrawParamsAmount `json:"amount"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK collateral vault to withdraw from. Required when protocol=EULER.
CollateralVault optionalnullable.OptionalNullable[string] `json:"collateral_vault,omitzero"`
// Euler only: EVC sub-account (0–255) holding the collateral to withdraw. Each sub-account is an independent Euler position with its own collateral, borrow controller, and health. Defaults to 0. Ignored for Aave/Morpho.
SubAccountID *int64 `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// contains filtered or unexported fields
}
CreditWithdrawParams - Withdraw collateral from Aave via Credit Account.
func (*CreditWithdrawParams) GetActionType ¶
func (c *CreditWithdrawParams) GetActionType() *string
func (*CreditWithdrawParams) GetAmount ¶
func (c *CreditWithdrawParams) GetAmount() CreditWithdrawParamsAmount
func (*CreditWithdrawParams) GetCollateralVault ¶ added in v0.1.27
func (c *CreditWithdrawParams) GetCollateralVault() optionalnullable.OptionalNullable[string]
func (*CreditWithdrawParams) GetMarketID ¶ added in v0.1.34
func (c *CreditWithdrawParams) GetMarketID() optionalnullable.OptionalNullable[string]
func (*CreditWithdrawParams) GetProtocol ¶ added in v0.1.27
func (c *CreditWithdrawParams) GetProtocol() *CreditProtocol
func (*CreditWithdrawParams) GetSubAccountID ¶ added in v0.1.41
func (c *CreditWithdrawParams) GetSubAccountID() *int64
func (*CreditWithdrawParams) GetToken ¶
func (c *CreditWithdrawParams) GetToken() string
func (CreditWithdrawParams) MarshalJSON ¶
func (c CreditWithdrawParams) MarshalJSON() ([]byte, error)
func (*CreditWithdrawParams) UnmarshalJSON ¶
func (c *CreditWithdrawParams) UnmarshalJSON(data []byte) error
type CreditWithdrawParamsAmount ¶
type CreditWithdrawParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type CreditWithdrawParamsAmountType
}
CreditWithdrawParamsAmount - Amount in token units to withdraw.
func CreateCreditWithdrawParamsAmountNumber ¶
func CreateCreditWithdrawParamsAmountNumber(number float64) CreditWithdrawParamsAmount
func CreateCreditWithdrawParamsAmountStr ¶
func CreateCreditWithdrawParamsAmountStr(str string) CreditWithdrawParamsAmount
func (CreditWithdrawParamsAmount) MarshalJSON ¶
func (u CreditWithdrawParamsAmount) MarshalJSON() ([]byte, error)
func (*CreditWithdrawParamsAmount) UnmarshalJSON ¶
func (u *CreditWithdrawParamsAmount) UnmarshalJSON(data []byte) error
type CreditWithdrawParamsAmountType ¶
type CreditWithdrawParamsAmountType string
const ( CreditWithdrawParamsAmountTypeNumber CreditWithdrawParamsAmountType = "number" CreditWithdrawParamsAmountTypeStr CreditWithdrawParamsAmountType = "str" )
type DebtPosition ¶
type DebtPosition struct {
// Address of the borrow token.
Token string `json:"token"`
// Symbol of the borrow token (e.g. WETH).
Symbol string `json:"symbol"`
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Euler only: the EVK borrow vault this debt is owed to.
Vault optionalnullable.OptionalNullable[string] `json:"vault,omitzero"`
// Euler only: the EVC sub-account (0–255) this debt belongs to. Each sub-account is an independent Euler position with its own health. Null for Aave/Morpho.
SubAccountID optionalnullable.OptionalNullable[int64] `json:"sub_account_id,omitzero"`
// Morpho only: the bytes32 id of the isolated market this debt is owed to.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Morpho only: this market's health factor (markets are isolated, so health is per market — below 1 the position is liquidatable). Null for other protocols and when the oracle read fails.
HealthFactor optionalnullable.OptionalNullable[string] `json:"health_factor,omitzero"`
// Current on-chain debt balance (the vault's underlying asset for Euler).
AmountBorrowed *string `json:"amount_borrowed"`
// Debt value in USD.
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// Current borrow APY in percentage (e.g. 4.5 means 4.5%).
BorrowApy optionalnullable.OptionalNullable[string] `json:"borrow_apy,omitzero"`
// Total amount borrowed across all borrow events.
TotalBorrowed optionalnullable.OptionalNullable[string] `json:"total_borrowed,omitzero"`
// Total amount repaid across all repay events.
TotalRepaid optionalnullable.OptionalNullable[string] `json:"total_repaid,omitzero"`
// Interest paid on debt: on_chain_balance + total_repaid - total_borrowed.
InterestPaid optionalnullable.OptionalNullable[string] `json:"interest_paid,omitzero"`
// All historical events for this debt reserve.
Events []CreditEvent `json:"events,omitzero"`
}
DebtPosition - A per-reserve debt position.
func (*DebtPosition) GetAmountBorrowed ¶
func (d *DebtPosition) GetAmountBorrowed() *string
func (*DebtPosition) GetBorrowApy ¶
func (d *DebtPosition) GetBorrowApy() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetEvents ¶
func (d *DebtPosition) GetEvents() []CreditEvent
func (*DebtPosition) GetHealthFactor ¶ added in v0.1.34
func (d *DebtPosition) GetHealthFactor() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetInterestPaid ¶
func (d *DebtPosition) GetInterestPaid() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetMarketID ¶ added in v0.1.34
func (d *DebtPosition) GetMarketID() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetProtocol ¶ added in v0.1.27
func (d *DebtPosition) GetProtocol() *CreditProtocol
func (*DebtPosition) GetSubAccountID ¶ added in v0.1.41
func (d *DebtPosition) GetSubAccountID() optionalnullable.OptionalNullable[int64]
func (*DebtPosition) GetSymbol ¶
func (d *DebtPosition) GetSymbol() string
func (*DebtPosition) GetToken ¶
func (d *DebtPosition) GetToken() string
func (*DebtPosition) GetTotalBorrowed ¶
func (d *DebtPosition) GetTotalBorrowed() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetTotalRepaid ¶
func (d *DebtPosition) GetTotalRepaid() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetUsdValue ¶
func (d *DebtPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
func (*DebtPosition) GetVault ¶ added in v0.1.27
func (d *DebtPosition) GetVault() optionalnullable.OptionalNullable[string]
func (DebtPosition) MarshalJSON ¶
func (d DebtPosition) MarshalJSON() ([]byte, error)
func (*DebtPosition) UnmarshalJSON ¶
func (d *DebtPosition) UnmarshalJSON(data []byte) error
type DepositEvent ¶
type DepositEvent struct {
// Block number when deposit occurred
BlockNumber int64 `json:"block_number"`
// Timestamp when deposit occurred
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash of the deposit
TransactionHash string `json:"transaction_hash"`
// Amount deposited (underlying asset or swap token)
InputAmount string `json:"input_amount"`
// Symbol of token deposited
InputSymbol string `json:"input_symbol"`
// Units received (shares, aTokens, or PT)
OutputAmount string `json:"output_amount"`
// Symbol of units received
OutputSymbol string `json:"output_symbol"`
// Cost basis per unit at time of deposit
CostPerUnit string `json:"cost_per_unit"`
}
DepositEvent - Historical deposit event for position transparency.
Uses generic input/output format that works across all protocols: - Vault: input=underlying, output=shares - Aave: input=underlying, output=aTokens - Pendle: input=token (varies), output=PT
func (*DepositEvent) GetBlockNumber ¶
func (d *DepositEvent) GetBlockNumber() int64
func (*DepositEvent) GetBlockTimestamp ¶
func (d *DepositEvent) GetBlockTimestamp() time.Time
func (*DepositEvent) GetCostPerUnit ¶
func (d *DepositEvent) GetCostPerUnit() string
func (*DepositEvent) GetInputAmount ¶
func (d *DepositEvent) GetInputAmount() string
func (*DepositEvent) GetInputSymbol ¶
func (d *DepositEvent) GetInputSymbol() string
func (*DepositEvent) GetOutputAmount ¶
func (d *DepositEvent) GetOutputAmount() string
func (*DepositEvent) GetOutputSymbol ¶
func (d *DepositEvent) GetOutputSymbol() string
func (*DepositEvent) GetTransactionHash ¶
func (d *DepositEvent) GetTransactionHash() string
func (DepositEvent) MarshalJSON ¶
func (d DepositEvent) MarshalJSON() ([]byte, error)
func (*DepositEvent) UnmarshalJSON ¶
func (d *DepositEvent) UnmarshalJSON(data []byte) error
type Direction ¶
type Direction string
Direction relative to the product account: 'in' for received, 'out' for sent.
type EarnBalancesResponse ¶
type EarnBalancesResponse struct {
// The derived earn account address.
EarnAccountAddress string `json:"earn_account_address"`
// Token balances keyed by token symbol. Symbols are not unique on-chain: when two tokens collide, each key becomes 'SYMBOL (0xAddress)' — match on token_address for exactness.
Balances map[string]CompassAPIBackendV2ModelsBalancesTokenBalance `json:"balances,omitzero"`
// Total USD value of all balances (sum of available values).
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
EarnBalancesResponse - Response containing earn account balances and transfer history.
func (*EarnBalancesResponse) GetBalances ¶
func (e *EarnBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
func (*EarnBalancesResponse) GetEarnAccountAddress ¶
func (e *EarnBalancesResponse) GetEarnAccountAddress() string
func (*EarnBalancesResponse) GetTotalUsdValue ¶
func (e *EarnBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
func (EarnBalancesResponse) MarshalJSON ¶
func (e EarnBalancesResponse) MarshalJSON() ([]byte, error)
func (*EarnBalancesResponse) UnmarshalJSON ¶
func (e *EarnBalancesResponse) UnmarshalJSON(data []byte) error
type EarnManageParams ¶
type EarnManageParams struct {
// The earn venue.
Venue EarnManageParamsVenue `json:"venue"`
// Whether you are depositing into or withdrawing from the given Earn `venue`.
Action EarnManageParamsAction `json:"action"`
// Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0.
Amount EarnManageParamsAmount `json:"amount"`
// Optional fee configuration. If provided, a fee will be applied to the transaction amount and sent to the specified recipient address. The fee can be specified as a percentage of the transaction amount, as a fixed token amount, or as a percentage of realized profit (PERFORMANCE).
Fee optionalnullable.OptionalNullable[Fee] `json:"fee,omitzero"`
// contains filtered or unexported fields
}
EarnManageParams - Parameters for earn manage operations (deposit/withdraw to vault/Aave/Pendle PT).
Used by multicall/bundle endpoint to specify manage actions. EarnManageRequest inherits from this class.
func (*EarnManageParams) GetAction ¶
func (e *EarnManageParams) GetAction() EarnManageParamsAction
func (*EarnManageParams) GetActionType ¶
func (e *EarnManageParams) GetActionType() *string
func (*EarnManageParams) GetAmount ¶
func (e *EarnManageParams) GetAmount() EarnManageParamsAmount
func (*EarnManageParams) GetFee ¶
func (e *EarnManageParams) GetFee() optionalnullable.OptionalNullable[Fee]
func (*EarnManageParams) GetVenue ¶
func (e *EarnManageParams) GetVenue() EarnManageParamsVenue
func (*EarnManageParams) GetVenueAave ¶
func (e *EarnManageParams) GetVenueAave() *AaveVenue
func (*EarnManageParams) GetVenuePendlePt ¶
func (e *EarnManageParams) GetVenuePendlePt() *PendlePTVenue
func (*EarnManageParams) GetVenueVault ¶
func (e *EarnManageParams) GetVenueVault() *VaultVenue
func (EarnManageParams) MarshalJSON ¶
func (e EarnManageParams) MarshalJSON() ([]byte, error)
func (*EarnManageParams) UnmarshalJSON ¶
func (e *EarnManageParams) UnmarshalJSON(data []byte) error
type EarnManageParamsAction ¶
type EarnManageParamsAction string
EarnManageParamsAction - Whether you are depositing into or withdrawing from the given Earn `venue`.
const ( EarnManageParamsActionDeposit EarnManageParamsAction = "DEPOSIT" EarnManageParamsActionWithdraw EarnManageParamsAction = "WITHDRAW" )
func (EarnManageParamsAction) ToPointer ¶
func (e EarnManageParamsAction) ToPointer() *EarnManageParamsAction
func (*EarnManageParamsAction) UnmarshalJSON ¶
func (e *EarnManageParamsAction) UnmarshalJSON(data []byte) error
type EarnManageParamsAmount ¶
type EarnManageParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnManageParamsAmountType
}
EarnManageParamsAmount - Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0.
func CreateEarnManageParamsAmountNumber ¶
func CreateEarnManageParamsAmountNumber(number float64) EarnManageParamsAmount
func CreateEarnManageParamsAmountStr ¶
func CreateEarnManageParamsAmountStr(str string) EarnManageParamsAmount
func (EarnManageParamsAmount) MarshalJSON ¶
func (u EarnManageParamsAmount) MarshalJSON() ([]byte, error)
func (*EarnManageParamsAmount) UnmarshalJSON ¶
func (u *EarnManageParamsAmount) UnmarshalJSON(data []byte) error
type EarnManageParamsAmountType ¶
type EarnManageParamsAmountType string
const ( EarnManageParamsAmountTypeNumber EarnManageParamsAmountType = "number" EarnManageParamsAmountTypeStr EarnManageParamsAmountType = "str" )
type EarnManageParamsVenue ¶
type EarnManageParamsVenue struct {
VaultVenue *VaultVenue `queryParam:"inline" union:"member"`
AaveVenue *AaveVenue `queryParam:"inline" union:"member"`
PendlePTVenue *PendlePTVenue `queryParam:"inline" union:"member"`
Type EarnManageParamsVenueType
}
EarnManageParamsVenue - The earn venue.
func CreateEarnManageParamsVenueAave ¶
func CreateEarnManageParamsVenueAave(aave AaveVenue) EarnManageParamsVenue
func CreateEarnManageParamsVenuePendlePt ¶
func CreateEarnManageParamsVenuePendlePt(pendlePt PendlePTVenue) EarnManageParamsVenue
func CreateEarnManageParamsVenueVault ¶
func CreateEarnManageParamsVenueVault(vault VaultVenue) EarnManageParamsVenue
func (EarnManageParamsVenue) MarshalJSON ¶
func (u EarnManageParamsVenue) MarshalJSON() ([]byte, error)
func (*EarnManageParamsVenue) UnmarshalJSON ¶
func (u *EarnManageParamsVenue) UnmarshalJSON(data []byte) error
type EarnManageParamsVenueType ¶
type EarnManageParamsVenueType string
const ( EarnManageParamsVenueTypeAave EarnManageParamsVenueType = "AAVE" EarnManageParamsVenueTypePendlePt EarnManageParamsVenueType = "PENDLE_PT" EarnManageParamsVenueTypeVault EarnManageParamsVenueType = "VAULT" )
type EarnManageRequest ¶
type EarnManageRequest struct {
// The earn venue.
Venue EarnManageRequestVenue `json:"venue"`
// Whether you are depositing into or withdrawing from the given Earn `venue`.
Action EarnManageRequestAction `json:"action"`
// Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0.
Amount EarnManageRequestAmount `json:"amount"`
// Optional fee configuration. If provided, a fee will be applied to the transaction amount and sent to the specified recipient address. The fee can be specified as a percentage of the transaction amount, as a fixed token amount, or as a percentage of realized profit (PERFORMANCE).
Fee optionalnullable.OptionalNullable[Fee] `json:"fee,omitzero"`
// The primary wallet address that owns and controls the Earn Account.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// Optionally request gas sponsorship. If set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// contains filtered or unexported fields
}
EarnManageRequest - Request model for the unified manage endpoint.
Inherits from EarnManageParams and adds context fields (owner, chain, etc).
func (*EarnManageRequest) GetAction ¶
func (e *EarnManageRequest) GetAction() EarnManageRequestAction
func (*EarnManageRequest) GetActionType ¶
func (e *EarnManageRequest) GetActionType() *string
func (*EarnManageRequest) GetAmount ¶
func (e *EarnManageRequest) GetAmount() EarnManageRequestAmount
func (*EarnManageRequest) GetChain ¶
func (e *EarnManageRequest) GetChain() Chain
func (*EarnManageRequest) GetFee ¶
func (e *EarnManageRequest) GetFee() optionalnullable.OptionalNullable[Fee]
func (*EarnManageRequest) GetGasSponsorship ¶
func (e *EarnManageRequest) GetGasSponsorship() *bool
func (*EarnManageRequest) GetOwner ¶
func (e *EarnManageRequest) GetOwner() string
func (*EarnManageRequest) GetVenue ¶
func (e *EarnManageRequest) GetVenue() EarnManageRequestVenue
func (*EarnManageRequest) GetVenueAave ¶
func (e *EarnManageRequest) GetVenueAave() *AaveVenue
func (*EarnManageRequest) GetVenuePendlePt ¶
func (e *EarnManageRequest) GetVenuePendlePt() *PendlePTVenue
func (*EarnManageRequest) GetVenueVault ¶
func (e *EarnManageRequest) GetVenueVault() *VaultVenue
func (EarnManageRequest) MarshalJSON ¶
func (e EarnManageRequest) MarshalJSON() ([]byte, error)
func (*EarnManageRequest) UnmarshalJSON ¶
func (e *EarnManageRequest) UnmarshalJSON(data []byte) error
type EarnManageRequestAction ¶
type EarnManageRequestAction string
EarnManageRequestAction - Whether you are depositing into or withdrawing from the given Earn `venue`.
const ( EarnManageRequestActionDeposit EarnManageRequestAction = "DEPOSIT" EarnManageRequestActionWithdraw EarnManageRequestAction = "WITHDRAW" )
func (EarnManageRequestAction) ToPointer ¶
func (e EarnManageRequestAction) ToPointer() *EarnManageRequestAction
func (*EarnManageRequestAction) UnmarshalJSON ¶
func (e *EarnManageRequestAction) UnmarshalJSON(data []byte) error
type EarnManageRequestAmount ¶
type EarnManageRequestAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnManageRequestAmountType
}
EarnManageRequestAmount - Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0.
func CreateEarnManageRequestAmountNumber ¶
func CreateEarnManageRequestAmountNumber(number float64) EarnManageRequestAmount
func CreateEarnManageRequestAmountStr ¶
func CreateEarnManageRequestAmountStr(str string) EarnManageRequestAmount
func (EarnManageRequestAmount) MarshalJSON ¶
func (u EarnManageRequestAmount) MarshalJSON() ([]byte, error)
func (*EarnManageRequestAmount) UnmarshalJSON ¶
func (u *EarnManageRequestAmount) UnmarshalJSON(data []byte) error
type EarnManageRequestAmountType ¶
type EarnManageRequestAmountType string
const ( EarnManageRequestAmountTypeNumber EarnManageRequestAmountType = "number" EarnManageRequestAmountTypeStr EarnManageRequestAmountType = "str" )
type EarnManageRequestVenue ¶
type EarnManageRequestVenue struct {
VaultVenue *VaultVenue `queryParam:"inline" union:"member"`
AaveVenue *AaveVenue `queryParam:"inline" union:"member"`
PendlePTVenue *PendlePTVenue `queryParam:"inline" union:"member"`
Type EarnManageRequestVenueType
}
EarnManageRequestVenue - The earn venue.
func CreateEarnManageRequestVenueAave ¶
func CreateEarnManageRequestVenueAave(aave AaveVenue) EarnManageRequestVenue
func CreateEarnManageRequestVenuePendlePt ¶
func CreateEarnManageRequestVenuePendlePt(pendlePt PendlePTVenue) EarnManageRequestVenue
func CreateEarnManageRequestVenueVault ¶
func CreateEarnManageRequestVenueVault(vault VaultVenue) EarnManageRequestVenue
func (EarnManageRequestVenue) MarshalJSON ¶
func (u EarnManageRequestVenue) MarshalJSON() ([]byte, error)
func (*EarnManageRequestVenue) UnmarshalJSON ¶
func (u *EarnManageRequestVenue) UnmarshalJSON(data []byte) error
type EarnManageRequestVenueType ¶
type EarnManageRequestVenueType string
const ( EarnManageRequestVenueTypeAave EarnManageRequestVenueType = "AAVE" EarnManageRequestVenueTypePendlePt EarnManageRequestVenueType = "PENDLE_PT" EarnManageRequestVenueTypeVault EarnManageRequestVenueType = "VAULT" )
type EarnManageResponse ¶
type EarnManageResponse struct {
// Unsigned transaction for direct execution. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
}
func (*EarnManageResponse) GetEip712 ¶
func (e *EarnManageResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*EarnManageResponse) GetTransaction ¶
func (e *EarnManageResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (EarnManageResponse) MarshalJSON ¶
func (e EarnManageResponse) MarshalJSON() ([]byte, error)
func (*EarnManageResponse) UnmarshalJSON ¶
func (e *EarnManageResponse) UnmarshalJSON(data []byte) error
type EarnPositionsAllResponse ¶
type EarnPositionsAllResponse struct {
// Positions grouped by chain. Keys: 'ethereum', 'base', 'arbitrum'.
Chains map[string]EarnPositionsResponse `json:"chains"`
// Total USD value of all positions across all chains.
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
EarnPositionsAllResponse - Positions across all chains, grouped by chain name.
Each chain key maps to an EarnPositionsResponse containing that chain's aave, vaults, and pendle_pt positions with per-chain total_usd_value.
func (*EarnPositionsAllResponse) GetChains ¶
func (e *EarnPositionsAllResponse) GetChains() map[string]EarnPositionsResponse
func (*EarnPositionsAllResponse) GetTotalUsdValue ¶
func (e *EarnPositionsAllResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
type EarnPositionsResponse ¶
type EarnPositionsResponse struct {
// Aave V3 lending positions.
Aave []AavePosition `json:"aave,omitzero"`
// ERC-4626 vault positions.
Vaults []CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition `json:"vaults,omitzero"`
// Pendle Principal Token positions.
PendlePt []PendlePTPosition `json:"pendle_pt,omitzero"`
// Total USD value of all positions (sum of available values).
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
EarnPositionsResponse - Grouped positions by protocol.
This new structure groups positions by protocol type for better organization and removes the need for a discriminated union in SDK consumers.
func (*EarnPositionsResponse) GetAave ¶
func (e *EarnPositionsResponse) GetAave() []AavePosition
func (*EarnPositionsResponse) GetPendlePt ¶
func (e *EarnPositionsResponse) GetPendlePt() []PendlePTPosition
func (*EarnPositionsResponse) GetTotalUsdValue ¶
func (e *EarnPositionsResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
func (*EarnPositionsResponse) GetVaults ¶
func (e *EarnPositionsResponse) GetVaults() []CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition
func (EarnPositionsResponse) MarshalJSON ¶
func (e EarnPositionsResponse) MarshalJSON() ([]byte, error)
func (*EarnPositionsResponse) UnmarshalJSON ¶
func (e *EarnPositionsResponse) UnmarshalJSON(data []byte) error
type EarnSwapParams ¶
type EarnSwapParams struct {
// Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address.
TokenIn string `json:"token_in"`
// Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address.
TokenOut string `json:"token_out"`
// Human-readable amount of `token_in` to swap (token units, not wei).
AmountIn EarnSwapParamsAmountIn `json:"amount_in"`
// Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
Slippage *EarnSwapParamsSlippage `json:"slippage,omitzero"`
// contains filtered or unexported fields
}
EarnSwapParams - Parameters for swap operations (without context like owner/chain).
Used by multicall/bundle endpoint to specify swap actions.
func (*EarnSwapParams) GetActionType ¶
func (e *EarnSwapParams) GetActionType() *string
func (*EarnSwapParams) GetAmountIn ¶
func (e *EarnSwapParams) GetAmountIn() EarnSwapParamsAmountIn
func (*EarnSwapParams) GetSlippage ¶
func (e *EarnSwapParams) GetSlippage() *EarnSwapParamsSlippage
func (*EarnSwapParams) GetTokenIn ¶
func (e *EarnSwapParams) GetTokenIn() string
func (*EarnSwapParams) GetTokenOut ¶
func (e *EarnSwapParams) GetTokenOut() string
func (EarnSwapParams) MarshalJSON ¶
func (e EarnSwapParams) MarshalJSON() ([]byte, error)
func (*EarnSwapParams) UnmarshalJSON ¶
func (e *EarnSwapParams) UnmarshalJSON(data []byte) error
type EarnSwapParamsAmountIn ¶
type EarnSwapParamsAmountIn struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnSwapParamsAmountInType
}
EarnSwapParamsAmountIn - Human-readable amount of `token_in` to swap (token units, not wei).
func CreateEarnSwapParamsAmountInNumber ¶
func CreateEarnSwapParamsAmountInNumber(number float64) EarnSwapParamsAmountIn
func CreateEarnSwapParamsAmountInStr ¶
func CreateEarnSwapParamsAmountInStr(str string) EarnSwapParamsAmountIn
func (EarnSwapParamsAmountIn) MarshalJSON ¶
func (u EarnSwapParamsAmountIn) MarshalJSON() ([]byte, error)
func (*EarnSwapParamsAmountIn) UnmarshalJSON ¶
func (u *EarnSwapParamsAmountIn) UnmarshalJSON(data []byte) error
type EarnSwapParamsAmountInType ¶
type EarnSwapParamsAmountInType string
const ( EarnSwapParamsAmountInTypeNumber EarnSwapParamsAmountInType = "number" EarnSwapParamsAmountInTypeStr EarnSwapParamsAmountInType = "str" )
type EarnSwapParamsSlippage ¶
type EarnSwapParamsSlippage struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnSwapParamsSlippageType
}
EarnSwapParamsSlippage - Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
func CreateEarnSwapParamsSlippageNumber ¶
func CreateEarnSwapParamsSlippageNumber(number float64) EarnSwapParamsSlippage
func CreateEarnSwapParamsSlippageStr ¶
func CreateEarnSwapParamsSlippageStr(str string) EarnSwapParamsSlippage
func (EarnSwapParamsSlippage) MarshalJSON ¶
func (u EarnSwapParamsSlippage) MarshalJSON() ([]byte, error)
func (*EarnSwapParamsSlippage) UnmarshalJSON ¶
func (u *EarnSwapParamsSlippage) UnmarshalJSON(data []byte) error
type EarnSwapParamsSlippageType ¶
type EarnSwapParamsSlippageType string
const ( EarnSwapParamsSlippageTypeNumber EarnSwapParamsSlippageType = "number" EarnSwapParamsSlippageTypeStr EarnSwapParamsSlippageType = "str" )
type EarnSwapQuoteResponse ¶ added in v0.1.16
type EarnSwapQuoteResponse struct {
// Estimated amount of `token_out` received, in human-readable units. Zero when no route / insufficient liquidity exists for the pair.
AmountOut string `json:"amount_out"`
// The token address actually quoted as input. Usually the requested `token_in`; for Pendle (when `sy_address` is supplied) it is the resolved redeem token, which callers should use to value the input.
TokenIn string `json:"token_in"`
// The token address quoted as output — what `amount_out` is denominated in (the resolved `token_out` from the request).
TokenOut string `json:"token_out"`
}
EarnSwapQuoteResponse - Estimated output of a read-only swap quote.
func (*EarnSwapQuoteResponse) GetAmountOut ¶ added in v0.1.16
func (e *EarnSwapQuoteResponse) GetAmountOut() string
func (*EarnSwapQuoteResponse) GetTokenIn ¶ added in v0.1.16
func (e *EarnSwapQuoteResponse) GetTokenIn() string
func (*EarnSwapQuoteResponse) GetTokenOut ¶ added in v0.1.16
func (e *EarnSwapQuoteResponse) GetTokenOut() string
type EarnSwapRequest ¶
type EarnSwapRequest struct {
// Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address.
TokenIn string `json:"token_in"`
// Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address.
TokenOut string `json:"token_out"`
// Human-readable amount of `token_in` to swap (token units, not wei).
AmountIn EarnSwapRequestAmountIn `json:"amount_in"`
// Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
Slippage *EarnSwapRequestSlippage `json:"slippage,omitzero"`
// The owner's wallet address.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// Optionally request gas sponsorship. If `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// contains filtered or unexported fields
}
EarnSwapRequest - Request model for swap endpoint.
Inherits swap params and adds context fields (owner, chain, gas_sponsorship).
func (*EarnSwapRequest) GetActionType ¶
func (e *EarnSwapRequest) GetActionType() *string
func (*EarnSwapRequest) GetAmountIn ¶
func (e *EarnSwapRequest) GetAmountIn() EarnSwapRequestAmountIn
func (*EarnSwapRequest) GetChain ¶
func (e *EarnSwapRequest) GetChain() Chain
func (*EarnSwapRequest) GetGasSponsorship ¶
func (e *EarnSwapRequest) GetGasSponsorship() *bool
func (*EarnSwapRequest) GetOwner ¶
func (e *EarnSwapRequest) GetOwner() string
func (*EarnSwapRequest) GetSlippage ¶
func (e *EarnSwapRequest) GetSlippage() *EarnSwapRequestSlippage
func (*EarnSwapRequest) GetTokenIn ¶
func (e *EarnSwapRequest) GetTokenIn() string
func (*EarnSwapRequest) GetTokenOut ¶
func (e *EarnSwapRequest) GetTokenOut() string
func (EarnSwapRequest) MarshalJSON ¶
func (e EarnSwapRequest) MarshalJSON() ([]byte, error)
func (*EarnSwapRequest) UnmarshalJSON ¶
func (e *EarnSwapRequest) UnmarshalJSON(data []byte) error
type EarnSwapRequestAmountIn ¶
type EarnSwapRequestAmountIn struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnSwapRequestAmountInType
}
EarnSwapRequestAmountIn - Human-readable amount of `token_in` to swap (token units, not wei).
func CreateEarnSwapRequestAmountInNumber ¶
func CreateEarnSwapRequestAmountInNumber(number float64) EarnSwapRequestAmountIn
func CreateEarnSwapRequestAmountInStr ¶
func CreateEarnSwapRequestAmountInStr(str string) EarnSwapRequestAmountIn
func (EarnSwapRequestAmountIn) MarshalJSON ¶
func (u EarnSwapRequestAmountIn) MarshalJSON() ([]byte, error)
func (*EarnSwapRequestAmountIn) UnmarshalJSON ¶
func (u *EarnSwapRequestAmountIn) UnmarshalJSON(data []byte) error
type EarnSwapRequestAmountInType ¶
type EarnSwapRequestAmountInType string
const ( EarnSwapRequestAmountInTypeNumber EarnSwapRequestAmountInType = "number" EarnSwapRequestAmountInTypeStr EarnSwapRequestAmountInType = "str" )
type EarnSwapRequestSlippage ¶
type EarnSwapRequestSlippage struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnSwapRequestSlippageType
}
EarnSwapRequestSlippage - Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
func CreateEarnSwapRequestSlippageNumber ¶
func CreateEarnSwapRequestSlippageNumber(number float64) EarnSwapRequestSlippage
func CreateEarnSwapRequestSlippageStr ¶
func CreateEarnSwapRequestSlippageStr(str string) EarnSwapRequestSlippage
func (EarnSwapRequestSlippage) MarshalJSON ¶
func (u EarnSwapRequestSlippage) MarshalJSON() ([]byte, error)
func (*EarnSwapRequestSlippage) UnmarshalJSON ¶
func (u *EarnSwapRequestSlippage) UnmarshalJSON(data []byte) error
type EarnSwapRequestSlippageType ¶
type EarnSwapRequestSlippageType string
const ( EarnSwapRequestSlippageTypeNumber EarnSwapRequestSlippageType = "number" EarnSwapRequestSlippageTypeStr EarnSwapRequestSlippageType = "str" )
type EarnSwapResponse ¶
type EarnSwapResponse struct {
// Unsigned transaction for direct execution. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Estimated amount of output token received from the swap.
EstimatedAmountOut string `json:"estimated_amount_out"`
}
func (*EarnSwapResponse) GetEip712 ¶
func (e *EarnSwapResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*EarnSwapResponse) GetEstimatedAmountOut ¶
func (e *EarnSwapResponse) GetEstimatedAmountOut() string
func (*EarnSwapResponse) GetTransaction ¶
func (e *EarnSwapResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (EarnSwapResponse) MarshalJSON ¶
func (e EarnSwapResponse) MarshalJSON() ([]byte, error)
func (*EarnSwapResponse) UnmarshalJSON ¶
func (e *EarnSwapResponse) UnmarshalJSON(data []byte) error
type EarnTransferFromEOAParams ¶
type EarnTransferFromEOAParams struct {
// The token to transfer from EOA to Earn Account.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount EarnTransferFromEOAParamsAmount `json:"amount"`
// The EOA owner's signature of the Permit2 PermitTransferFrom typed data. Obtain this by calling /v2/earn/transfer with action=DEPOSIT and gas_sponsorship=True, then signing the returned EIP-712 data with the owner's wallet.
Permit2Signature string `json:"permit2_signature"`
// The nonce used in the Permit2 signature (from the signed typed data).
Permit2Nonce int64 `json:"permit2_nonce"`
// The deadline timestamp used in the Permit2 signature (from the signed typed data).
Permit2Deadline int64 `json:"permit2_deadline"`
// contains filtered or unexported fields
}
EarnTransferFromEOAParams - Parameters for transferring tokens from EOA to Earn Account via Permit2.
Used by multicall/bundle endpoint to pull tokens from the owner's EOA into their Earn Account (Safe) as part of an atomic bundle transaction.
The owner must have: 1. Previously approved Permit2 for the token (one-time setup via /gas_sponsorship/approve_transfer) 2. Signed a Permit2 message with spender = Earn Account address
The signature is obtained by first calling /v2/earn/transfer with action=DEPOSIT and gas_sponsorship=True, then signing the returned EIP-712 typed data.
func (*EarnTransferFromEOAParams) GetActionType ¶
func (e *EarnTransferFromEOAParams) GetActionType() *string
func (*EarnTransferFromEOAParams) GetAmount ¶
func (e *EarnTransferFromEOAParams) GetAmount() EarnTransferFromEOAParamsAmount
func (*EarnTransferFromEOAParams) GetPermit2Deadline ¶
func (e *EarnTransferFromEOAParams) GetPermit2Deadline() int64
func (*EarnTransferFromEOAParams) GetPermit2Nonce ¶
func (e *EarnTransferFromEOAParams) GetPermit2Nonce() int64
func (*EarnTransferFromEOAParams) GetPermit2Signature ¶
func (e *EarnTransferFromEOAParams) GetPermit2Signature() string
func (*EarnTransferFromEOAParams) GetToken ¶
func (e *EarnTransferFromEOAParams) GetToken() string
func (EarnTransferFromEOAParams) MarshalJSON ¶
func (e EarnTransferFromEOAParams) MarshalJSON() ([]byte, error)
func (*EarnTransferFromEOAParams) UnmarshalJSON ¶
func (e *EarnTransferFromEOAParams) UnmarshalJSON(data []byte) error
type EarnTransferFromEOAParamsAmount ¶
type EarnTransferFromEOAParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnTransferFromEOAParamsAmountType
}
EarnTransferFromEOAParamsAmount - The amount of tokens to transfer (in token units, not wei).
func CreateEarnTransferFromEOAParamsAmountNumber ¶
func CreateEarnTransferFromEOAParamsAmountNumber(number float64) EarnTransferFromEOAParamsAmount
func CreateEarnTransferFromEOAParamsAmountStr ¶
func CreateEarnTransferFromEOAParamsAmountStr(str string) EarnTransferFromEOAParamsAmount
func (EarnTransferFromEOAParamsAmount) MarshalJSON ¶
func (u EarnTransferFromEOAParamsAmount) MarshalJSON() ([]byte, error)
func (*EarnTransferFromEOAParamsAmount) UnmarshalJSON ¶
func (u *EarnTransferFromEOAParamsAmount) UnmarshalJSON(data []byte) error
type EarnTransferFromEOAParamsAmountType ¶
type EarnTransferFromEOAParamsAmountType string
const ( EarnTransferFromEOAParamsAmountTypeNumber EarnTransferFromEOAParamsAmountType = "number" EarnTransferFromEOAParamsAmountTypeStr EarnTransferFromEOAParamsAmountType = "str" )
type EarnTransferRequest ¶
type EarnTransferRequest struct {
// The owner's wallet address.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// The token you would like to transfer.
Token string `json:"token"`
// The amount of 'token' to transfer.
Amount EarnTransferRequestAmount `json:"amount"`
// Whether you are depositing to or withdrawing from your earn account.
Action EarnTransferRequestAction `json:"action"`
// Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Earn Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself.
Spender optionalnullable.OptionalNullable[string] `json:"spender,omitzero"`
// Optional recipient address for withdrawals. When `action` is 'WITHDRAW': - If provided, tokens will be sent to this address instead of the owner. - If not provided, defaults to the owner's address.
Recipient optionalnullable.OptionalNullable[string] `json:"recipient,omitzero"`
}
func (*EarnTransferRequest) GetAction ¶
func (e *EarnTransferRequest) GetAction() EarnTransferRequestAction
func (*EarnTransferRequest) GetAmount ¶
func (e *EarnTransferRequest) GetAmount() EarnTransferRequestAmount
func (*EarnTransferRequest) GetChain ¶
func (e *EarnTransferRequest) GetChain() Chain
func (*EarnTransferRequest) GetGasSponsorship ¶
func (e *EarnTransferRequest) GetGasSponsorship() *bool
func (*EarnTransferRequest) GetOwner ¶
func (e *EarnTransferRequest) GetOwner() string
func (*EarnTransferRequest) GetRecipient ¶
func (e *EarnTransferRequest) GetRecipient() optionalnullable.OptionalNullable[string]
func (*EarnTransferRequest) GetSpender ¶
func (e *EarnTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
func (*EarnTransferRequest) GetToken ¶
func (e *EarnTransferRequest) GetToken() string
type EarnTransferRequestAction ¶
type EarnTransferRequestAction string
EarnTransferRequestAction - Whether you are depositing to or withdrawing from your earn account.
const ( EarnTransferRequestActionDeposit EarnTransferRequestAction = "DEPOSIT" EarnTransferRequestActionWithdraw EarnTransferRequestAction = "WITHDRAW" )
func (EarnTransferRequestAction) ToPointer ¶
func (e EarnTransferRequestAction) ToPointer() *EarnTransferRequestAction
func (*EarnTransferRequestAction) UnmarshalJSON ¶
func (e *EarnTransferRequestAction) UnmarshalJSON(data []byte) error
type EarnTransferRequestAmount ¶
type EarnTransferRequestAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnTransferRequestAmountType
}
EarnTransferRequestAmount - The amount of 'token' to transfer.
func CreateEarnTransferRequestAmountNumber ¶
func CreateEarnTransferRequestAmountNumber(number float64) EarnTransferRequestAmount
func CreateEarnTransferRequestAmountStr ¶
func CreateEarnTransferRequestAmountStr(str string) EarnTransferRequestAmount
func (EarnTransferRequestAmount) MarshalJSON ¶
func (u EarnTransferRequestAmount) MarshalJSON() ([]byte, error)
func (*EarnTransferRequestAmount) UnmarshalJSON ¶
func (u *EarnTransferRequestAmount) UnmarshalJSON(data []byte) error
type EarnTransferRequestAmountType ¶
type EarnTransferRequestAmountType string
const ( EarnTransferRequestAmountTypeNumber EarnTransferRequestAmountType = "number" EarnTransferRequestAmountTypeStr EarnTransferRequestAmountType = "str" )
type EarnTransferResponse ¶
type EarnTransferResponse struct {
// Unsigned transaction for direct execution. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Eip712 optionalnullable.OptionalNullable[EarnTransferResponseEip712] `json:"eip_712,omitzero"`
}
func (*EarnTransferResponse) GetEip712 ¶
func (e *EarnTransferResponse) GetEip712() optionalnullable.OptionalNullable[EarnTransferResponseEip712]
func (*EarnTransferResponse) GetTransaction ¶
func (e *EarnTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (EarnTransferResponse) MarshalJSON ¶
func (e EarnTransferResponse) MarshalJSON() ([]byte, error)
func (*EarnTransferResponse) UnmarshalJSON ¶
func (e *EarnTransferResponse) UnmarshalJSON(data []byte) error
type EarnTransferResponseEip712 ¶
type EarnTransferResponseEip712 struct {
BatchedSafeOperationsResponseOutput *BatchedSafeOperationsResponseOutput `queryParam:"inline" union:"member"`
Permit2TypedDataOutput *Permit2TypedDataOutput `queryParam:"inline" union:"member"`
UnknownRaw json.RawMessage `json:"-" union:"unknown"`
Type EarnTransferResponseEip712Type
}
EarnTransferResponseEip712 - EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
func CreateEarnTransferResponseEip712BatchedSafeOperationsResponseOutput ¶
func CreateEarnTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) EarnTransferResponseEip712
func CreateEarnTransferResponseEip712Permit2TypedDataOutput ¶
func CreateEarnTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) EarnTransferResponseEip712
func CreateEarnTransferResponseEip712Unknown ¶
func CreateEarnTransferResponseEip712Unknown(raw json.RawMessage) EarnTransferResponseEip712
func (EarnTransferResponseEip712) GetUnknownRaw ¶
func (u EarnTransferResponseEip712) GetUnknownRaw() json.RawMessage
func (EarnTransferResponseEip712) IsUnknown ¶
func (u EarnTransferResponseEip712) IsUnknown() bool
func (EarnTransferResponseEip712) MarshalJSON ¶
func (u EarnTransferResponseEip712) MarshalJSON() ([]byte, error)
func (*EarnTransferResponseEip712) UnmarshalJSON ¶
func (u *EarnTransferResponseEip712) UnmarshalJSON(data []byte) error
type EarnTransferResponseEip712Type ¶
type EarnTransferResponseEip712Type string
const ( EarnTransferResponseEip712TypeBatchedSafeOperationsResponseOutput EarnTransferResponseEip712Type = "BatchedSafeOperationsResponse-Output" EarnTransferResponseEip712TypePermit2TypedDataOutput EarnTransferResponseEip712Type = "Permit2TypedData-Output" EarnTransferResponseEip712TypeUnknown EarnTransferResponseEip712Type = "Unknown" )
type EarnTransferToAddressParams ¶
type EarnTransferToAddressParams struct {
// The ERC20 token to transfer from the product account.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount EarnTransferToAddressParamsAmount `json:"amount"`
// The destination address to receive the tokens.
Recipient string `json:"recipient"`
// contains filtered or unexported fields
}
EarnTransferToAddressParams - Parameters for transferring tokens from product account to an arbitrary address.
Used by multicall/bundle endpoint to send ERC20 tokens from the product account to any specified recipient address as part of an atomic bundle transaction.
No signature is required for this action since the product account already owns the tokens and is executing the transfer as part of its own transaction.
func (*EarnTransferToAddressParams) GetActionType ¶
func (e *EarnTransferToAddressParams) GetActionType() *string
func (*EarnTransferToAddressParams) GetAmount ¶
func (e *EarnTransferToAddressParams) GetAmount() EarnTransferToAddressParamsAmount
func (*EarnTransferToAddressParams) GetRecipient ¶
func (e *EarnTransferToAddressParams) GetRecipient() string
func (*EarnTransferToAddressParams) GetToken ¶
func (e *EarnTransferToAddressParams) GetToken() string
func (EarnTransferToAddressParams) MarshalJSON ¶
func (e EarnTransferToAddressParams) MarshalJSON() ([]byte, error)
func (*EarnTransferToAddressParams) UnmarshalJSON ¶
func (e *EarnTransferToAddressParams) UnmarshalJSON(data []byte) error
type EarnTransferToAddressParamsAmount ¶
type EarnTransferToAddressParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnTransferToAddressParamsAmountType
}
EarnTransferToAddressParamsAmount - The amount of tokens to transfer (in token units, not wei).
func CreateEarnTransferToAddressParamsAmountNumber ¶
func CreateEarnTransferToAddressParamsAmountNumber(number float64) EarnTransferToAddressParamsAmount
func CreateEarnTransferToAddressParamsAmountStr ¶
func CreateEarnTransferToAddressParamsAmountStr(str string) EarnTransferToAddressParamsAmount
func (EarnTransferToAddressParamsAmount) MarshalJSON ¶
func (u EarnTransferToAddressParamsAmount) MarshalJSON() ([]byte, error)
func (*EarnTransferToAddressParamsAmount) UnmarshalJSON ¶
func (u *EarnTransferToAddressParamsAmount) UnmarshalJSON(data []byte) error
type EarnTransferToAddressParamsAmountType ¶
type EarnTransferToAddressParamsAmountType string
const ( EarnTransferToAddressParamsAmountTypeNumber EarnTransferToAddressParamsAmountType = "number" EarnTransferToAddressParamsAmountTypeStr EarnTransferToAddressParamsAmountType = "str" )
type EarnTransferToEOAParams ¶
type EarnTransferToEOAParams struct {
// The token to transfer from Earn Account to EOA.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount EarnTransferToEOAParamsAmount `json:"amount"`
// contains filtered or unexported fields
}
EarnTransferToEOAParams - Parameters for transferring tokens from Earn Account to EOA (withdrawal).
Used by multicall/bundle endpoint to send tokens from the Earn Account (Safe) back to the owner's EOA as part of an atomic bundle transaction.
No signature is required for this action since the Safe already owns the tokens and is executing the transfer as part of its own transaction.
func (*EarnTransferToEOAParams) GetActionType ¶
func (e *EarnTransferToEOAParams) GetActionType() *string
func (*EarnTransferToEOAParams) GetAmount ¶
func (e *EarnTransferToEOAParams) GetAmount() EarnTransferToEOAParamsAmount
func (*EarnTransferToEOAParams) GetToken ¶
func (e *EarnTransferToEOAParams) GetToken() string
func (EarnTransferToEOAParams) MarshalJSON ¶
func (e EarnTransferToEOAParams) MarshalJSON() ([]byte, error)
func (*EarnTransferToEOAParams) UnmarshalJSON ¶
func (e *EarnTransferToEOAParams) UnmarshalJSON(data []byte) error
type EarnTransferToEOAParamsAmount ¶
type EarnTransferToEOAParamsAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type EarnTransferToEOAParamsAmountType
}
EarnTransferToEOAParamsAmount - The amount of tokens to transfer (in token units, not wei).
func CreateEarnTransferToEOAParamsAmountNumber ¶
func CreateEarnTransferToEOAParamsAmountNumber(number float64) EarnTransferToEOAParamsAmount
func CreateEarnTransferToEOAParamsAmountStr ¶
func CreateEarnTransferToEOAParamsAmountStr(str string) EarnTransferToEOAParamsAmount
func (EarnTransferToEOAParamsAmount) MarshalJSON ¶
func (u EarnTransferToEOAParamsAmount) MarshalJSON() ([]byte, error)
func (*EarnTransferToEOAParamsAmount) UnmarshalJSON ¶
func (u *EarnTransferToEOAParamsAmount) UnmarshalJSON(data []byte) error
type EarnTransferToEOAParamsAmountType ¶
type EarnTransferToEOAParamsAmountType string
const ( EarnTransferToEOAParamsAmountTypeNumber EarnTransferToEOAParamsAmountType = "number" EarnTransferToEOAParamsAmountTypeStr EarnTransferToEOAParamsAmountType = "str" )
type Eip712DomainField ¶
Eip712DomainField - A field in the EIP712Domain type definition.
func (*Eip712DomainField) GetName ¶
func (e *Eip712DomainField) GetName() string
func (*Eip712DomainField) GetType ¶
func (e *Eip712DomainField) GetType() string
func (Eip712DomainField) MarshalJSON ¶
func (e Eip712DomainField) MarshalJSON() ([]byte, error)
func (*Eip712DomainField) UnmarshalJSON ¶
func (e *Eip712DomainField) UnmarshalJSON(data []byte) error
type Eip712Field ¶
type Eip712Field struct {
// Field name in the struct
Name string `json:"name"`
// EVM type (e.g., address, uint256, TokenPermissions)
Type string `json:"type"`
}
func (*Eip712Field) GetName ¶
func (e *Eip712Field) GetName() string
func (*Eip712Field) GetType ¶
func (e *Eip712Field) GetType() string
func (Eip712Field) MarshalJSON ¶
func (e Eip712Field) MarshalJSON() ([]byte, error)
func (*Eip712Field) UnmarshalJSON ¶
func (e *Eip712Field) UnmarshalJSON(data []byte) error
type EulerMarket ¶ added in v0.1.28
type EulerMarket struct {
// EVK vault to borrow from (pass as borrow_vault when borrowing).
Vault string `json:"vault"`
// Symbol of the EVK vault (e.g. eUSDT-2).
VaultSymbol string `json:"vault_symbol"`
// Underlying asset this market lends and borrows.
Asset string `json:"asset"`
// Symbol of the borrowable asset (e.g. USDT).
AssetSymbol string `json:"asset_symbol"`
// Decimals of the borrowable asset.
AssetDecimals int64 `json:"asset_decimals"`
// USD price of one whole unit of the borrowable asset. Use it to convert USD borrow capacity into token units. Null if the price feed can't quote it.
AssetPriceUsd optionalnullable.OptionalNullable[string] `json:"asset_price_usd,omitzero"`
// Symbol of the market's native unit of account (usually USD). The market's own risk engine denominates collateral and debt in this unit.
UnitOfAccountSymbol optionalnullable.OptionalNullable[string] `json:"unit_of_account_symbol,omitzero"`
// Current borrow APY for this market (cost to borrow the asset), in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable.
BorrowApy optionalnullable.OptionalNullable[string] `json:"borrow_apy,omitzero"`
// Current supply APY for this market (yield for supplying the asset), in percentage (e.g. 3.45 means 3.45%). Null if the rate is unavailable.
SupplyApy optionalnullable.OptionalNullable[string] `json:"supply_apy,omitzero"`
// Asset available to borrow right now (vault cash), in token units. A borrow larger than this reverts even if the account is healthy.
AvailableLiquidity string `json:"available_liquidity"`
// Total asset supplied to this market, in token units.
TotalSupplyAssets string `json:"total_supply_assets"`
// Total asset borrowed from this market, in token units.
TotalBorrowAssets string `json:"total_borrow_assets"`
// Borrowed share of supplied assets, in percentage 0-100.
Utilization string `json:"utilization"`
// Maximum total supply allowed, in token units. Null when the market is uncapped.
SupplyCap optionalnullable.OptionalNullable[string] `json:"supply_cap,omitzero"`
// Maximum total borrow allowed, in token units. A borrow that would breach this reverts even when cash exists. Null when uncapped.
BorrowCap optionalnullable.OptionalNullable[string] `json:"borrow_cap,omitzero"`
// Collateral vaults this market accepts (those currently borrowable, LTV > 0), each with its LTVs.
Collaterals []EulerMarketCollateral `json:"collaterals,omitzero"`
}
EulerMarket - An Euler V2 borrow market: a vault to borrow from + the collaterals it accepts.
func (*EulerMarket) GetAsset ¶ added in v0.1.28
func (e *EulerMarket) GetAsset() string
func (*EulerMarket) GetAssetDecimals ¶ added in v0.1.28
func (e *EulerMarket) GetAssetDecimals() int64
func (*EulerMarket) GetAssetPriceUsd ¶ added in v0.1.42
func (e *EulerMarket) GetAssetPriceUsd() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetAssetSymbol ¶ added in v0.1.28
func (e *EulerMarket) GetAssetSymbol() string
func (*EulerMarket) GetAvailableLiquidity ¶ added in v0.1.42
func (e *EulerMarket) GetAvailableLiquidity() string
func (*EulerMarket) GetBorrowApy ¶ added in v0.1.29
func (e *EulerMarket) GetBorrowApy() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetBorrowCap ¶ added in v0.1.42
func (e *EulerMarket) GetBorrowCap() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetCollaterals ¶ added in v0.1.28
func (e *EulerMarket) GetCollaterals() []EulerMarketCollateral
func (*EulerMarket) GetSupplyApy ¶ added in v0.1.29
func (e *EulerMarket) GetSupplyApy() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetSupplyCap ¶ added in v0.1.42
func (e *EulerMarket) GetSupplyCap() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetTotalBorrowAssets ¶ added in v0.1.42
func (e *EulerMarket) GetTotalBorrowAssets() string
func (*EulerMarket) GetTotalSupplyAssets ¶ added in v0.1.42
func (e *EulerMarket) GetTotalSupplyAssets() string
func (*EulerMarket) GetUnitOfAccountSymbol ¶ added in v0.1.42
func (e *EulerMarket) GetUnitOfAccountSymbol() optionalnullable.OptionalNullable[string]
func (*EulerMarket) GetUtilization ¶ added in v0.1.42
func (e *EulerMarket) GetUtilization() string
func (*EulerMarket) GetVault ¶ added in v0.1.28
func (e *EulerMarket) GetVault() string
func (*EulerMarket) GetVaultSymbol ¶ added in v0.1.28
func (e *EulerMarket) GetVaultSymbol() string
func (EulerMarket) MarshalJSON ¶ added in v0.1.28
func (e EulerMarket) MarshalJSON() ([]byte, error)
func (*EulerMarket) UnmarshalJSON ¶ added in v0.1.28
func (e *EulerMarket) UnmarshalJSON(data []byte) error
type EulerMarketCollateral ¶ added in v0.1.28
type EulerMarketCollateral struct {
// EVK collateral vault to supply into (pass as collateral_vault when borrowing).
Vault string `json:"vault"`
// Underlying asset of the collateral vault.
Asset string `json:"asset"`
// Symbol of the collateral's underlying asset (e.g. USDC).
AssetSymbol string `json:"asset_symbol"`
// Decimals of the collateral's underlying asset.
AssetDecimals int64 `json:"asset_decimals"`
// USD price of one whole unit of the collateral asset. Null if the price feed can't quote it (size the supply in token units instead).
AssetPriceUsd optionalnullable.OptionalNullable[string] `json:"asset_price_usd,omitzero"`
// Maximum loan-to-value when borrowing against this collateral, in percentage (e.g. 94 means 94%).
BorrowLtv string `json:"borrow_ltv"`
// Loan-to-value at which this collateral is liquidated, in percentage (e.g. 96 means 96%).
LiquidationLtv string `json:"liquidation_ltv"`
// Current supply APY earned on this collateral while it backs a loan, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable.
SupplyApy optionalnullable.OptionalNullable[string] `json:"supply_apy,omitzero"`
}
EulerMarketCollateral - A collateral vault an Euler borrow market accepts, with its loan-to-value.
func (*EulerMarketCollateral) GetAsset ¶ added in v0.1.28
func (e *EulerMarketCollateral) GetAsset() string
func (*EulerMarketCollateral) GetAssetDecimals ¶ added in v0.1.42
func (e *EulerMarketCollateral) GetAssetDecimals() int64
func (*EulerMarketCollateral) GetAssetPriceUsd ¶ added in v0.1.42
func (e *EulerMarketCollateral) GetAssetPriceUsd() optionalnullable.OptionalNullable[string]
func (*EulerMarketCollateral) GetAssetSymbol ¶ added in v0.1.28
func (e *EulerMarketCollateral) GetAssetSymbol() string
func (*EulerMarketCollateral) GetBorrowLtv ¶ added in v0.1.28
func (e *EulerMarketCollateral) GetBorrowLtv() string
func (*EulerMarketCollateral) GetLiquidationLtv ¶ added in v0.1.28
func (e *EulerMarketCollateral) GetLiquidationLtv() string
func (*EulerMarketCollateral) GetSupplyApy ¶ added in v0.1.29
func (e *EulerMarketCollateral) GetSupplyApy() optionalnullable.OptionalNullable[string]
func (*EulerMarketCollateral) GetVault ¶ added in v0.1.28
func (e *EulerMarketCollateral) GetVault() string
type EulerMarketsResponse ¶ added in v0.1.28
type EulerMarketsResponse struct {
// Euler Governed Perspective contract the curated vault set was read from.
Perspective string `json:"perspective"`
// Curated borrow markets, each with its accepted collateral vaults and LTVs.
Markets []EulerMarket `json:"markets,omitzero"`
}
EulerMarketsResponse - Curated Euler V2 borrow markets, read from Euler's Governed Perspective.
func (*EulerMarketsResponse) GetMarkets ¶ added in v0.1.28
func (e *EulerMarketsResponse) GetMarkets() []EulerMarket
func (*EulerMarketsResponse) GetPerspective ¶ added in v0.1.28
func (e *EulerMarketsResponse) GetPerspective() string
func (EulerMarketsResponse) MarshalJSON ¶ added in v0.1.28
func (e EulerMarketsResponse) MarshalJSON() ([]byte, error)
func (*EulerMarketsResponse) UnmarshalJSON ¶ added in v0.1.28
func (e *EulerMarketsResponse) UnmarshalJSON(data []byte) error
type Fee ¶
type Fee struct {
// The wallet address that will receive the fee.
Recipient string `json:"recipient"`
// The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
Amount FeeAmount `json:"amount"`
// The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
Denomination *FeeDenomination `json:"denomination,omitzero"`
}
func (*Fee) GetDenomination ¶
func (f *Fee) GetDenomination() *FeeDenomination
func (*Fee) GetRecipient ¶
func (Fee) MarshalJSON ¶
func (*Fee) UnmarshalJSON ¶
type FeeAmount ¶
type FeeAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type FeeAmountType
}
FeeAmount - The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
func CreateFeeAmountNumber ¶
func CreateFeeAmountStr ¶
func (FeeAmount) MarshalJSON ¶
func (*FeeAmount) UnmarshalJSON ¶
type FeeAmountType ¶
type FeeAmountType string
const ( FeeAmountTypeNumber FeeAmountType = "number" FeeAmountTypeStr FeeAmountType = "str" )
type FeeDenomination ¶
type FeeDenomination string
FeeDenomination - The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
const ( FeeDenominationPercentage FeeDenomination = "PERCENTAGE" FeeDenominationFixed FeeDenomination = "FIXED" FeeDenominationPerformance FeeDenomination = "PERFORMANCE" )
func (FeeDenomination) ToPointer ¶
func (e FeeDenomination) ToPointer() *FeeDenomination
func (*FeeDenomination) UnmarshalJSON ¶
func (e *FeeDenomination) UnmarshalJSON(data []byte) error
type HTTPMetadata ¶
type HTTPMetadata struct {
// Raw HTTP response; suitable for custom response parsing
Response *http.Response `json:"-"`
// Raw HTTP request; suitable for debugging
Request *http.Request `json:"-"`
}
func (*HTTPMetadata) GetRequest ¶
func (h *HTTPMetadata) GetRequest() *http.Request
func (*HTTPMetadata) GetResponse ¶
func (h *HTTPMetadata) GetResponse() *http.Response
type InitialCollateralAmount ¶ added in v0.1.34
type InitialCollateralAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type InitialCollateralAmountType
}
InitialCollateralAmount - Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
func CreateInitialCollateralAmountNumber ¶ added in v0.1.34
func CreateInitialCollateralAmountNumber(number float64) InitialCollateralAmount
func CreateInitialCollateralAmountStr ¶ added in v0.1.34
func CreateInitialCollateralAmountStr(str string) InitialCollateralAmount
func (InitialCollateralAmount) MarshalJSON ¶ added in v0.1.34
func (u InitialCollateralAmount) MarshalJSON() ([]byte, error)
func (*InitialCollateralAmount) UnmarshalJSON ¶ added in v0.1.34
func (u *InitialCollateralAmount) UnmarshalJSON(data []byte) error
type InitialCollateralAmountType ¶ added in v0.1.34
type InitialCollateralAmountType string
const ( InitialCollateralAmountTypeNumber InitialCollateralAmountType = "number" InitialCollateralAmountTypeStr InitialCollateralAmountType = "str" )
type InterestRateMode ¶
type InterestRateMode string
InterestRateMode - On AAVE there are 2 different interest modes.
A stable (but typically higher rate), or a variable rate.
const ( InterestRateModeStable InterestRateMode = "stable" InterestRateModeVariable InterestRateMode = "variable" )
func (InterestRateMode) ToPointer ¶
func (e InterestRateMode) ToPointer() *InterestRateMode
func (*InterestRateMode) UnmarshalJSON ¶
func (e *InterestRateMode) UnmarshalJSON(data []byte) error
type ListAaveMarketsResponse ¶
type ListAaveMarketsResponse struct {
// Market data keyed by token symbol. Each token contains chain-specific data and information about which chain has the highest supply APY.
Markets map[string]TokenMarketData `json:"markets"`
}
ListAaveMarketsResponse - Response containing Aave market rates organized by token symbol.
func (*ListAaveMarketsResponse) GetMarkets ¶
func (l *ListAaveMarketsResponse) GetMarkets() map[string]TokenMarketData
type LoanToValue ¶ added in v0.1.34
type LoanToValue struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type LoanToValueType
}
LoanToValue - Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
func CreateLoanToValueNumber ¶ added in v0.1.34
func CreateLoanToValueNumber(number float64) LoanToValue
func CreateLoanToValueStr ¶ added in v0.1.34
func CreateLoanToValueStr(str string) LoanToValue
func (LoanToValue) MarshalJSON ¶ added in v0.1.34
func (u LoanToValue) MarshalJSON() ([]byte, error)
func (*LoanToValue) UnmarshalJSON ¶ added in v0.1.34
func (u *LoanToValue) UnmarshalJSON(data []byte) error
type LoanToValueType ¶ added in v0.1.34
type LoanToValueType string
const ( LoanToValueTypeNumber LoanToValueType = "number" LoanToValueTypeStr LoanToValueType = "str" )
type Loc ¶
type Loc struct {
Str *string `queryParam:"inline" union:"member"`
Integer *int64 `queryParam:"inline" union:"member"`
UnknownRaw json.RawMessage `json:"-" union:"unknown"`
Type LocType
}
func CreateLocInteger ¶
func CreateLocStr ¶
func CreateLocUnknown ¶
func CreateLocUnknown(raw json.RawMessage) Loc
func (Loc) GetUnknownRaw ¶
func (u Loc) GetUnknownRaw() json.RawMessage
func (Loc) MarshalJSON ¶
func (*Loc) UnmarshalJSON ¶
type LoopLegPreview ¶ added in v0.1.34
type LoopLegPreview struct {
// Collateral supplied this iteration (token units).
SupplyAmount *string `json:"supply_amount"`
// Loan borrowed this iteration; null on the final supply-only iteration.
BorrowAmount optionalnullable.OptionalNullable[string] `json:"borrow_amount,omitzero"`
// Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
MinSwapOut optionalnullable.OptionalNullable[string] `json:"min_swap_out,omitzero"`
// Quoted swap output (collateral units) before the slippage floor is applied. Only min_swap_out is guaranteed on-chain; the gap between the two is the adverse-slippage tolerance, bounded by max_slippage_percent, not a surplus that is certain to arrive. Whatever the fill actually delivers above min_swap_out stays in the account, and estimated_max_dust is the upper bound on that.
ExpectedSwapOut optionalnullable.OptionalNullable[string] `json:"expected_swap_out,omitzero"`
}
LoopLegPreview - One planned loop iteration.
func (*LoopLegPreview) GetBorrowAmount ¶ added in v0.1.34
func (l *LoopLegPreview) GetBorrowAmount() optionalnullable.OptionalNullable[string]
func (*LoopLegPreview) GetExpectedSwapOut ¶ added in v0.1.52
func (l *LoopLegPreview) GetExpectedSwapOut() optionalnullable.OptionalNullable[string]
func (*LoopLegPreview) GetMinSwapOut ¶ added in v0.1.34
func (l *LoopLegPreview) GetMinSwapOut() optionalnullable.OptionalNullable[string]
func (*LoopLegPreview) GetSupplyAmount ¶ added in v0.1.34
func (l *LoopLegPreview) GetSupplyAmount() *string
type LoopedPosition ¶ added in v0.1.34
type LoopedPosition struct {
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol CreditProtocol `json:"protocol"`
// Morpho only: the bytes32 id of the isolated market.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Address of the collateral token.
CollateralToken string `json:"collateral_token"`
// Symbol of the collateral token.
CollateralSymbol string `json:"collateral_symbol"`
// Address of the debt token.
DebtToken string `json:"debt_token"`
// Symbol of the debt token.
DebtSymbol string `json:"debt_symbol"`
// Whether the position is currently open or fully closed.
Status LoopedPositionStatus `json:"status"`
// Timestamp of the position's first transaction.
OpenedAt time.Time `json:"opened_at"`
// Timestamp the position was fully closed; null while open.
ClosedAt optionalnullable.OptionalNullable[time.Time] `json:"closed_at,omitzero"`
// Live on-chain state; null for CLOSED positions.
Current optionalnullable.OptionalNullable[LoopedPositionCurrentState] `json:"current,omitzero"`
// Lifetime totals across all of a looped position's transactions.
Totals LoopedPositionTotals `json:"totals"`
// All transactions for this position, chronological.
History []LoopedPositionHistoryEntry `json:"history,omitzero"`
}
LoopedPosition - A single looped (leveraged) position with its full history.
func (*LoopedPosition) GetClosedAt ¶ added in v0.1.34
func (l *LoopedPosition) GetClosedAt() optionalnullable.OptionalNullable[time.Time]
func (*LoopedPosition) GetCollateralSymbol ¶ added in v0.1.34
func (l *LoopedPosition) GetCollateralSymbol() string
func (*LoopedPosition) GetCollateralToken ¶ added in v0.1.34
func (l *LoopedPosition) GetCollateralToken() string
func (*LoopedPosition) GetCurrent ¶ added in v0.1.34
func (l *LoopedPosition) GetCurrent() optionalnullable.OptionalNullable[LoopedPositionCurrentState]
func (*LoopedPosition) GetDebtSymbol ¶ added in v0.1.34
func (l *LoopedPosition) GetDebtSymbol() string
func (*LoopedPosition) GetDebtToken ¶ added in v0.1.34
func (l *LoopedPosition) GetDebtToken() string
func (*LoopedPosition) GetHistory ¶ added in v0.1.34
func (l *LoopedPosition) GetHistory() []LoopedPositionHistoryEntry
func (*LoopedPosition) GetMarketID ¶ added in v0.1.34
func (l *LoopedPosition) GetMarketID() optionalnullable.OptionalNullable[string]
func (*LoopedPosition) GetOpenedAt ¶ added in v0.1.34
func (l *LoopedPosition) GetOpenedAt() time.Time
func (*LoopedPosition) GetProtocol ¶ added in v0.1.34
func (l *LoopedPosition) GetProtocol() CreditProtocol
func (*LoopedPosition) GetStatus ¶ added in v0.1.34
func (l *LoopedPosition) GetStatus() LoopedPositionStatus
func (*LoopedPosition) GetTotals ¶ added in v0.1.34
func (l *LoopedPosition) GetTotals() LoopedPositionTotals
func (LoopedPosition) MarshalJSON ¶ added in v0.1.34
func (l LoopedPosition) MarshalJSON() ([]byte, error)
func (*LoopedPosition) UnmarshalJSON ¶ added in v0.1.34
func (l *LoopedPosition) UnmarshalJSON(data []byte) error
type LoopedPositionCurrentState ¶ added in v0.1.34
type LoopedPositionCurrentState struct {
// Current on-chain collateral amount for this position. When multiple open Aave positions share one collateral reserve (Aave holds a single pooled aToken balance per reserve), that pooled balance is attributed across them pro-rata by each position's event-ledger contribution — bookkeeping, not protocol truth; liquidation sees the pooled account, not this per-position split.
CollateralAmount *string `json:"collateral_amount"`
// Current on-chain debt amount for this position.
DebtAmount *string `json:"debt_amount"`
// Collateral value in USD (null if unpriced). Derived from the attributed collateral_amount for shared-reserve Aave positions.
CollateralUsd optionalnullable.OptionalNullable[string] `json:"collateral_usd,omitzero"`
// Debt value in USD (null if unpriced).
DebtUsd optionalnullable.OptionalNullable[string] `json:"debt_usd,omitzero"`
// Net position value in USD (collateral - debt); null if unpriced. For shared-reserve Aave positions the collateral side uses the pro-rata attributed balance (bookkeeping, not protocol truth).
NetUsdValue optionalnullable.OptionalNullable[string] `json:"net_usd_value,omitzero"`
// Leverage multiplier: collateral_usd / (collateral_usd - debt_usd). Null when unpriced or net value is non-positive. For shared-reserve Aave positions this is derived from the pro-rata attributed collateral (bookkeeping, not protocol truth).
Leverage optionalnullable.OptionalNullable[string] `json:"leverage,omitzero"`
// Health factor. Above 1 is safe; below 1 risks liquidation. See health_factor_scope for what it covers.
HealthFactor optionalnullable.OptionalNullable[string] `json:"health_factor,omitzero"`
// 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
HealthFactorScope LoopedPositionCurrentStateHealthFactorScope `json:"health_factor_scope"`
// What the collateral leg currently earns, in percentage (e.g. 6.12 = 6.12%) — the sum of collateral_lending_apy and collateral_intrinsic_apy where both apply. Null when the token earns a yield outside the lending pool (a staked or wrapped asset) and no source for that yield is available: the pool's supply APY alone would understate the leg by percentage points and can invert the sign of net_apy, so it is withheld rather than reported as the whole yield.
CollateralApy optionalnullable.OptionalNullable[string] `json:"collateral_apy,omitzero"`
// The supply half of the collateral leg, in percentage: interest paid by borrowers of the collateral asset (Aave supply APY). Near zero for staked assets, which almost nobody borrows. Exactly 0 on Morpho, whose collateral is held rather than lent — which is why a Morpho position's whole collateral leg is its vault yield.
CollateralLendingApy optionalnullable.OptionalNullable[string] `json:"collateral_lending_apy,omitzero"`
// The yield the collateral token earns inside its own price, in percentage, independent of the lending pool — a liquid-staking token's staking rewards (wstHYPE against HYPE) or an ERC-4626 share's vault yield — which of the two follows from the position's protocol. Null when the token has none or none is indexed.
//
// A TRAILING 7-DAY measurement, not a forward rate: a week is a short sample of a staking rate, so consecutive readings move around the longer-run average by a few tenths of a percent.
//
// A null here alongside a null collateral_apy and a NON-null collateral_lending_apy is the meaningful case: the token does earn outside the pool, but no source for that yield is available, so the total is withheld rather than understated.
CollateralIntrinsicApy optionalnullable.OptionalNullable[string] `json:"collateral_intrinsic_apy,omitzero"`
// What the debt leg currently costs, in percentage — the sum of borrow_lending_apy and borrow_intrinsic_apy where both apply. Debt owed in a token that appreciates inside its own price (a staked or wrapped asset) grows by that appreciation on top of the pool's interest, so the pool rate alone would understate the cost and overstate net_apy; for such a token with no yield source available this is null (withheld) rather than the pool rate. For ordinary debt assets it equals the market's spot borrow APY. Null also when the rate read was unavailable.
BorrowApy optionalnullable.OptionalNullable[string] `json:"borrow_apy,omitzero"`
// The pool half of the debt leg, in percentage: the market's spot borrow APY (Morpho IRM rate / Aave variable borrow rate) — interest charged on the debt by the lending market itself.
BorrowLendingApy optionalnullable.OptionalNullable[string] `json:"borrow_lending_apy,omitzero"`
// The yield the DEBT token earns inside its own price, in percentage — which the borrower owes on top of pool interest, since the debt is denominated in an appreciating token. Same source and trailing 7-day window as collateral_intrinsic_apy. Null when the token has none or none is indexed; null alongside a null borrow_apy and a NON-null borrow_lending_apy means the debt token does earn outside the pool but no source is available, so the total cost is withheld rather than understated.
BorrowIntrinsicApy optionalnullable.OptionalNullable[string] `json:"borrow_intrinsic_apy,omitzero"`
// Levered net yield on the position's equity, in percentage: leverage x collateral_apy - (leverage - 1) x borrow_apy. Negative means the carry is upside down (borrowing costs more than the collateral earns). Null when leverage or either leg is unknown. This is a SNAPSHOT at today's rates, not a forecast, and it mixes a trailing collateral measurement with a spot borrow rate. It is also denominated in the debt asset, not USD: a wstHYPE/WHYPE loop earning a positive net_apy still loses USD value if HYPE falls. The borrow leg floats with the debt reserve's utilisation, so this figure can move without the position changing at all.
NetApy optionalnullable.OptionalNullable[string] `json:"net_apy,omitzero"`
}
LoopedPositionCurrentState - Live on-chain state of an OPEN looped position.
func (*LoopedPositionCurrentState) GetBorrowApy ¶ added in v0.1.50
func (l *LoopedPositionCurrentState) GetBorrowApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetBorrowIntrinsicApy ¶ added in v0.1.54
func (l *LoopedPositionCurrentState) GetBorrowIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetBorrowLendingApy ¶ added in v0.1.54
func (l *LoopedPositionCurrentState) GetBorrowLendingApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetCollateralAmount ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetCollateralAmount() *string
func (*LoopedPositionCurrentState) GetCollateralApy ¶ added in v0.1.50
func (l *LoopedPositionCurrentState) GetCollateralApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetCollateralIntrinsicApy ¶ added in v0.1.54
func (l *LoopedPositionCurrentState) GetCollateralIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetCollateralLendingApy ¶ added in v0.1.54
func (l *LoopedPositionCurrentState) GetCollateralLendingApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetCollateralUsd ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetCollateralUsd() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetDebtAmount ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetDebtAmount() *string
func (*LoopedPositionCurrentState) GetDebtUsd ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetDebtUsd() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetHealthFactor ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetHealthFactor() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetHealthFactorScope ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetHealthFactorScope() LoopedPositionCurrentStateHealthFactorScope
func (*LoopedPositionCurrentState) GetLeverage ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetLeverage() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetNetApy ¶ added in v0.1.50
func (l *LoopedPositionCurrentState) GetNetApy() optionalnullable.OptionalNullable[string]
func (*LoopedPositionCurrentState) GetNetUsdValue ¶ added in v0.1.34
func (l *LoopedPositionCurrentState) GetNetUsdValue() optionalnullable.OptionalNullable[string]
type LoopedPositionCurrentStateHealthFactorScope ¶ added in v0.1.37
type LoopedPositionCurrentStateHealthFactorScope string
LoopedPositionCurrentStateHealthFactorScope - 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
const ( LoopedPositionCurrentStateHealthFactorScopeMarket LoopedPositionCurrentStateHealthFactorScope = "market" LoopedPositionCurrentStateHealthFactorScopeAccount LoopedPositionCurrentStateHealthFactorScope = "account" )
func (*LoopedPositionCurrentStateHealthFactorScope) IsExact ¶ added in v0.1.37
func (e *LoopedPositionCurrentStateHealthFactorScope) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (LoopedPositionCurrentStateHealthFactorScope) ToPointer ¶ added in v0.1.37
func (e LoopedPositionCurrentStateHealthFactorScope) ToPointer() *LoopedPositionCurrentStateHealthFactorScope
type LoopedPositionHistoryEntry ¶ added in v0.1.34
type LoopedPositionHistoryEntry struct {
// Transaction hash.
TransactionHash string `json:"transaction_hash"`
// Block number of the transaction.
BlockNumber int64 `json:"block_number"`
// Timestamp of the transaction.
BlockTimestamp time.Time `json:"block_timestamp"`
// What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed.
Classification Classification `json:"classification"`
// Loop transactions only: number of borrow legs in this transaction (one per loop iteration). Null for non-loop transactions.
Iterations optionalnullable.OptionalNullable[int64] `json:"iterations,omitzero"`
// Signed change in collateral in this transaction (positive = added).
CollateralDelta string `json:"collateral_delta"`
// Signed change in debt in this transaction (positive = borrowed).
DebtDelta string `json:"debt_delta"`
// The swap leg detected in this transaction, if any.
Swap optionalnullable.OptionalNullable[SwapInfo] `json:"swap,omitzero"`
// The raw lending events that make up this transaction (Morpho supply_collateral maps to 'supply', withdraw_collateral to 'withdraw').
Events []CreditEvent `json:"events,omitzero"`
}
LoopedPositionHistoryEntry - One transaction in a looped position's lifetime.
func (*LoopedPositionHistoryEntry) GetBlockNumber ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetBlockNumber() int64
func (*LoopedPositionHistoryEntry) GetBlockTimestamp ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetBlockTimestamp() time.Time
func (*LoopedPositionHistoryEntry) GetClassification ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetClassification() Classification
func (*LoopedPositionHistoryEntry) GetCollateralDelta ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetCollateralDelta() string
func (*LoopedPositionHistoryEntry) GetDebtDelta ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetDebtDelta() string
func (*LoopedPositionHistoryEntry) GetEvents ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetEvents() []CreditEvent
func (*LoopedPositionHistoryEntry) GetIterations ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetIterations() optionalnullable.OptionalNullable[int64]
func (*LoopedPositionHistoryEntry) GetSwap ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetSwap() optionalnullable.OptionalNullable[SwapInfo]
func (*LoopedPositionHistoryEntry) GetTransactionHash ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) GetTransactionHash() string
func (LoopedPositionHistoryEntry) MarshalJSON ¶ added in v0.1.34
func (l LoopedPositionHistoryEntry) MarshalJSON() ([]byte, error)
func (*LoopedPositionHistoryEntry) UnmarshalJSON ¶ added in v0.1.34
func (l *LoopedPositionHistoryEntry) UnmarshalJSON(data []byte) error
type LoopedPositionStatus ¶ added in v0.1.34
type LoopedPositionStatus string
LoopedPositionStatus - Whether the position is currently open or fully closed.
const ( LoopedPositionStatusOpen LoopedPositionStatus = "OPEN" LoopedPositionStatusClosed LoopedPositionStatus = "CLOSED" )
func (*LoopedPositionStatus) IsExact ¶ added in v0.1.34
func (e *LoopedPositionStatus) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (LoopedPositionStatus) ToPointer ¶ added in v0.1.34
func (e LoopedPositionStatus) ToPointer() *LoopedPositionStatus
type LoopedPositionTotals ¶ added in v0.1.34
type LoopedPositionTotals struct {
// Total collateral added over the position's lifetime.
TotalCollateralAdded string `json:"total_collateral_added"`
// Total collateral removed over the position's lifetime.
TotalCollateralRemoved string `json:"total_collateral_removed"`
// Total debt borrowed over the position's lifetime.
TotalDebtAdded string `json:"total_debt_added"`
// Total debt repaid over the position's lifetime.
TotalDebtRemoved string `json:"total_debt_removed"`
// Number of loop_open + loop_increase transactions.
LoopTxCount int64 `json:"loop_tx_count"`
// Number of unwind transactions.
UnwindTxCount int64 `json:"unwind_tx_count"`
// Number of liquidation events.
LiquidationCount int64 `json:"liquidation_count"`
}
LoopedPositionTotals - Lifetime totals across all of a looped position's transactions.
func (*LoopedPositionTotals) GetLiquidationCount ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetLiquidationCount() int64
func (*LoopedPositionTotals) GetLoopTxCount ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetLoopTxCount() int64
func (*LoopedPositionTotals) GetTotalCollateralAdded ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetTotalCollateralAdded() string
func (*LoopedPositionTotals) GetTotalCollateralRemoved ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetTotalCollateralRemoved() string
func (*LoopedPositionTotals) GetTotalDebtAdded ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetTotalDebtAdded() string
func (*LoopedPositionTotals) GetTotalDebtRemoved ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetTotalDebtRemoved() string
func (*LoopedPositionTotals) GetUnwindTxCount ¶ added in v0.1.34
func (l *LoopedPositionTotals) GetUnwindTxCount() int64
type MarketAllocation ¶
type MarketAllocation struct {
// Morpho Blue market unique identifier (bytes32 hex string).
MarketID string `json:"market_id"`
// Address of the token being lent in this market.
LoanToken string `json:"loan_token"`
// Symbol of the loan token (e.g., 'USDC').
LoanTokenSymbol optionalnullable.OptionalNullable[string] `json:"loan_token_symbol,omitzero"`
// Address of the collateral token accepted by this market.
CollateralToken string `json:"collateral_token"`
// Symbol of the collateral token (e.g., 'WETH').
CollateralTokenSymbol optionalnullable.OptionalNullable[string] `json:"collateral_token_symbol,omitzero"`
// Liquidation Loan-To-Value ratio as a raw uint256 string. Divide by 1e18 to get the decimal ratio (e.g., '860000000000000000' = 86%).
Lltv string `json:"lltv"`
// Maximum amount the vault is allowed to supply to this market, as a raw uint184 string in the smallest token unit.
SupplyCap optionalnullable.OptionalNullable[string] `json:"supply_cap,omitzero"`
// Amount currently supplied by the vault to this market, in the smallest token unit (converted from shares).
SupplyAssets optionalnullable.OptionalNullable[string] `json:"supply_assets,omitzero"`
// Percentage of the vault's total supplied capital allocated to this market (e.g., 45.5 means 45.5%).
AllocationPct optionalnullable.OptionalNullable[float64] `json:"allocation_pct,omitzero"`
}
MarketAllocation - A Morpho Blue market that a vault allocates capital to.
func (*MarketAllocation) GetAllocationPct ¶
func (m *MarketAllocation) GetAllocationPct() optionalnullable.OptionalNullable[float64]
func (*MarketAllocation) GetCollateralToken ¶
func (m *MarketAllocation) GetCollateralToken() string
func (*MarketAllocation) GetCollateralTokenSymbol ¶
func (m *MarketAllocation) GetCollateralTokenSymbol() optionalnullable.OptionalNullable[string]
func (*MarketAllocation) GetLltv ¶
func (m *MarketAllocation) GetLltv() string
func (*MarketAllocation) GetLoanToken ¶
func (m *MarketAllocation) GetLoanToken() string
func (*MarketAllocation) GetLoanTokenSymbol ¶
func (m *MarketAllocation) GetLoanTokenSymbol() optionalnullable.OptionalNullable[string]
func (*MarketAllocation) GetMarketID ¶
func (m *MarketAllocation) GetMarketID() string
func (*MarketAllocation) GetSupplyAssets ¶
func (m *MarketAllocation) GetSupplyAssets() optionalnullable.OptionalNullable[string]
func (*MarketAllocation) GetSupplyCap ¶
func (m *MarketAllocation) GetSupplyCap() optionalnullable.OptionalNullable[string]
type MarketDetail ¶
type MarketDetail struct {
// On-chain token symbol (e.g. 'TSLAon').
Symbol string `json:"symbol"`
// Underlying equity ticker (e.g. 'TSLA').
UnderlyingTicker string `json:"underlying_ticker"`
// Underlying equity full name (e.g. 'Tesla, Inc. Common Stock').
Name string `json:"name"`
// On-chain ERC-20 address for this token, on the network given by `chain`.
ContractAddress string `json:"contract_address"`
// ERC-20 decimals for this token.
Decimals int64 `json:"decimals"`
// Latest price in USD as a decimal string.
CurrentPriceUsd string `json:"current_price_usd"`
// Absolute USD price change vs 24h ago (decimal string).
Change24hUsd optionalnullable.OptionalNullable[string] `json:"change_24h_usd,omitzero"`
// Percent price change vs 24h ago (decimal string).
Change24hPct optionalnullable.OptionalNullable[string] `json:"change_24h_pct,omitzero"`
// Sector / industry tags from the issuer (e.g. ['Technology']).
Sectors []string `json:"sectors,omitzero"`
// Regional market exposure tags (e.g. ['US']).
RegionExposure []string `json:"region_exposure,omitzero"`
// Issuer/provider of a tokenized asset.
Provider TokenizedAssetProvider `json:"provider"`
// Asset class of a tokenized asset.
//
// `EQUITY` trades via the order endpoints (build/submit/cancel); the RWA
// yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`), `MANAGED_VAULT`, and
// `DERWA` trade via the swap-based `transact/buy` and `transact/sell`
// endpoints. `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell
// is an *asynchronous* redemption request settled off-chain by the vault
// operator. `DERWA` (Centrifuge freely-transferable RWA wrappers) settles
// each buy/sell as a single instant DEX swap.
//
// `MONEY_MARKET` (WisdomTree Connect digital funds) also uses `transact/buy`
// and `transact/sell`, but neither swaps nor mints: a buy transfers the
// settlement stablecoin to the issuer's deposit address and the issuer mints
// fund shares back at the next NAV cycle, so settlement is *asynchronous*.
AssetClass TokenizedAssetClass `json:"asset_class"`
// The chain to use.
Chain Chain `json:"chain"`
// Trailing 7-day annualized NAV growth (decimal fraction string, e.g. '0.0512' = 5.12%). RWA yield assets only; null until enough NAV history exists.
Apy7d optionalnullable.OptionalNullable[string] `json:"apy_7d,omitzero"`
// Trailing 30-day annualized NAV growth (decimal fraction string). RWA yield assets only; null until enough NAV history exists.
Apy30d optionalnullable.OptionalNullable[string] `json:"apy_30d,omitzero"`
// Total value locked in USD (RWA yield assets only).
TvlUsd optionalnullable.OptionalNullable[string] `json:"tvl_usd,omitzero"`
// Live tradability: whether this market can be traded right now, and if not, why (and when it reopens). Equities follow US market sessions (some are 24-7 via an off-hours track); RWA yield / vault assets trade continuously unless the issuer pauses. Null if status is unavailable.
Status optionalnullable.OptionalNullable[TradingStatus] `json:"status,omitzero"`
// ISO country codes where this asset must not be offered (e.g. ['US']). Regulation-S instruments (Centrifuge deRWA) restrict US persons; the API surfaces the restriction for integrators to enforce — it does not itself geo-gate. Empty for unrestricted assets (Ondo/Midas/IXS).
RestrictedJurisdictions []string `json:"restricted_jurisdictions,omitzero"`
// 24h price sparkline as `(timestamp, price)` samples in chronological order.
PriceHistory24h []PricePoint `json:"price_history_24h,omitzero"`
// 52-week high of the underlying equity (USD).
PriceHigh52w optionalnullable.OptionalNullable[string] `json:"price_high_52w,omitzero"`
// 52-week low of the underlying equity (USD).
PriceLow52w optionalnullable.OptionalNullable[string] `json:"price_low_52w,omitzero"`
// 24h trading volume of the underlying equity.
Volume24h optionalnullable.OptionalNullable[string] `json:"volume_24h,omitzero"`
// Average trading volume of the underlying equity.
AverageVolume optionalnullable.OptionalNullable[string] `json:"average_volume,omitzero"`
SharesOutstanding optionalnullable.OptionalNullable[string] `json:"shares_outstanding,omitzero"`
// Market cap of the underlying equity (USD).
MarketCap optionalnullable.OptionalNullable[string] `json:"market_cap,omitzero"`
// On-chain holder count for the tokenized equity.
TotalHolders optionalnullable.OptionalNullable[int64] `json:"total_holders,omitzero"`
// Sessions in which the token can be traded (e.g. 'regular', 'premarket').
TradableSessions []string `json:"tradable_sessions,omitzero"`
SharesMultiplier optionalnullable.OptionalNullable[string] `json:"shares_multiplier,omitzero"`
// OHLC candles. Present only when both `interval` and `range` query params are provided and form a valid pair; omitted otherwise.
Candles optionalnullable.OptionalNullable[[]OhlcCandle] `json:"candles,omitzero"`
}
MarketDetail - Extended market view returned when fetching a single market.
func (*MarketDetail) GetApy7d ¶ added in v0.1.17
func (m *MarketDetail) GetApy7d() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetApy30d ¶ added in v0.1.17
func (m *MarketDetail) GetApy30d() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetAssetClass ¶ added in v0.1.17
func (m *MarketDetail) GetAssetClass() TokenizedAssetClass
func (*MarketDetail) GetAverageVolume ¶
func (m *MarketDetail) GetAverageVolume() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetCandles ¶
func (m *MarketDetail) GetCandles() optionalnullable.OptionalNullable[[]OhlcCandle]
func (*MarketDetail) GetChain ¶
func (m *MarketDetail) GetChain() Chain
func (*MarketDetail) GetChange24hPct ¶
func (m *MarketDetail) GetChange24hPct() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetChange24hUsd ¶
func (m *MarketDetail) GetChange24hUsd() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetContractAddress ¶
func (m *MarketDetail) GetContractAddress() string
func (*MarketDetail) GetCurrentPriceUsd ¶
func (m *MarketDetail) GetCurrentPriceUsd() string
func (*MarketDetail) GetDecimals ¶
func (m *MarketDetail) GetDecimals() int64
func (*MarketDetail) GetMarketCap ¶
func (m *MarketDetail) GetMarketCap() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetName ¶
func (m *MarketDetail) GetName() string
func (*MarketDetail) GetPriceHigh52w ¶
func (m *MarketDetail) GetPriceHigh52w() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetPriceHistory24h ¶
func (m *MarketDetail) GetPriceHistory24h() []PricePoint
func (*MarketDetail) GetPriceLow52w ¶
func (m *MarketDetail) GetPriceLow52w() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetProvider ¶ added in v0.1.17
func (m *MarketDetail) GetProvider() TokenizedAssetProvider
func (*MarketDetail) GetRegionExposure ¶
func (m *MarketDetail) GetRegionExposure() []string
func (*MarketDetail) GetRestrictedJurisdictions ¶ added in v0.1.47
func (m *MarketDetail) GetRestrictedJurisdictions() []string
func (*MarketDetail) GetSectors ¶
func (m *MarketDetail) GetSectors() []string
func (*MarketDetail) GetSharesMultiplier ¶
func (m *MarketDetail) GetSharesMultiplier() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetSharesOutstanding ¶
func (m *MarketDetail) GetSharesOutstanding() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetStatus ¶ added in v0.1.36
func (m *MarketDetail) GetStatus() optionalnullable.OptionalNullable[TradingStatus]
func (*MarketDetail) GetSymbol ¶
func (m *MarketDetail) GetSymbol() string
func (*MarketDetail) GetTotalHolders ¶
func (m *MarketDetail) GetTotalHolders() optionalnullable.OptionalNullable[int64]
func (*MarketDetail) GetTradableSessions ¶
func (m *MarketDetail) GetTradableSessions() []string
func (*MarketDetail) GetTvlUsd ¶ added in v0.1.17
func (m *MarketDetail) GetTvlUsd() optionalnullable.OptionalNullable[string]
func (*MarketDetail) GetUnderlyingTicker ¶
func (m *MarketDetail) GetUnderlyingTicker() string
func (*MarketDetail) GetVolume24h ¶
func (m *MarketDetail) GetVolume24h() optionalnullable.OptionalNullable[string]
func (MarketDetail) MarshalJSON ¶
func (m MarketDetail) MarshalJSON() ([]byte, error)
func (*MarketDetail) UnmarshalJSON ¶
func (m *MarketDetail) UnmarshalJSON(data []byte) error
type MaxSupplyApyInfo ¶
type MaxSupplyApyInfo struct {
// Chain name with the highest supply APY for this token.
Chain string `json:"chain"`
// Token contract address on the chain with highest supply APY.
Address string `json:"address"`
// Aave aToken contract address on the chain with highest supply APY.
ATokenAddress string `json:"a_token_address"`
// The highest supply APY for this token across all chains, in percentage.
SupplyApy string `json:"supply_apy"`
// Borrow APY on the chain with the highest supply APY, in percentage.
BorrowApy string `json:"borrow_apy"`
}
MaxSupplyApyInfo - Information about the chain with the highest supply APY for a token.
func (*MaxSupplyApyInfo) GetATokenAddress ¶
func (m *MaxSupplyApyInfo) GetATokenAddress() string
func (*MaxSupplyApyInfo) GetAddress ¶
func (m *MaxSupplyApyInfo) GetAddress() string
func (*MaxSupplyApyInfo) GetBorrowApy ¶
func (m *MaxSupplyApyInfo) GetBorrowApy() string
func (*MaxSupplyApyInfo) GetChain ¶
func (m *MaxSupplyApyInfo) GetChain() string
func (*MaxSupplyApyInfo) GetSupplyApy ¶
func (m *MaxSupplyApyInfo) GetSupplyApy() string
type MorphoLendingMarket ¶ added in v0.1.34
type MorphoLendingMarket struct {
// Morpho Blue market id — the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market.
MarketID string `json:"market_id"`
// Token that is supplied and borrowed in this market.
LoanToken string `json:"loan_token"`
// Symbol of the loan token (e.g. USDC).
LoanTokenSymbol string `json:"loan_token_symbol"`
// Decimals of the loan token.
LoanTokenDecimals int64 `json:"loan_token_decimals"`
// Token accepted as collateral in this market.
CollateralToken string `json:"collateral_token"`
// Symbol of the collateral token (e.g. wstETH).
CollateralTokenSymbol string `json:"collateral_token_symbol"`
// Decimals of the collateral token.
CollateralTokenDecimals int64 `json:"collateral_token_decimals"`
// Oracle pricing the collateral in loan-token terms for this market.
Oracle string `json:"oracle"`
// Interest rate model contract of this market.
Irm string `json:"irm"`
// Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value).
Lltv string `json:"lltv"`
// Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable.
SupplyApy optionalnullable.OptionalNullable[string] `json:"supply_apy,omitzero"`
// Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable.
BorrowApy optionalnullable.OptionalNullable[string] `json:"borrow_apy,omitzero"`
// What the COLLATERAL token earns inside its own price, in percentage: an ERC-4626 share's vault yield or a staking token's rewards, trailing 7 days. Morpho holds collateral without lending it out, so this is the collateral leg's ENTIRE yield. Null means unmeasured, NOT zero — a plain token (WETH, cbBTC) earns nothing and a yield-bearing one may simply not be indexed yet.
CollateralIntrinsicApy optionalnullable.OptionalNullable[string] `json:"collateral_intrinsic_apy,omitzero"`
// What the LOAN token earns inside its own price, in percentage, trailing 7 days. Debt owed in such a token grows by this on top of borrow_apy — a borrower's true cost is their sum. Null means unmeasured, NOT zero.
LoanIntrinsicApy optionalnullable.OptionalNullable[string] `json:"loan_intrinsic_apy,omitzero"`
// Borrowed share of supplied assets, in percentage 0-100.
Utilization string `json:"utilization"`
// Total loan tokens supplied to the market, in token units.
TotalSupplyAssets string `json:"total_supply_assets"`
// Total loan tokens borrowed from the market, in token units.
TotalBorrowAssets string `json:"total_borrow_assets"`
// Loan tokens available to borrow or withdraw (supplied - borrowed), in token units.
AvailableLiquidity string `json:"available_liquidity"`
// Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee).
Fee string `json:"fee"`
// Total value locked (total supplied assets) in USD, sourced from the indexer. Null if the indexer hasn't priced this market yet.
TvlUsd optionalnullable.OptionalNullable[string] `json:"tvl_usd,omitzero"`
// Available liquidity (supplied - borrowed) in USD, sourced from the indexer. Null if the indexer hasn't priced this market yet.
LiquidityUsd optionalnullable.OptionalNullable[string] `json:"liquidity_usd,omitzero"`
}
MorphoLendingMarket - A Morpho Blue lending market: one isolated (collateral, loan) pair.
func (*MorphoLendingMarket) GetAvailableLiquidity ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetAvailableLiquidity() string
func (*MorphoLendingMarket) GetBorrowApy ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetBorrowApy() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetCollateralIntrinsicApy ¶ added in v0.1.54
func (m *MorphoLendingMarket) GetCollateralIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetCollateralToken ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetCollateralToken() string
func (*MorphoLendingMarket) GetCollateralTokenDecimals ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetCollateralTokenDecimals() int64
func (*MorphoLendingMarket) GetCollateralTokenSymbol ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetCollateralTokenSymbol() string
func (*MorphoLendingMarket) GetFee ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetFee() string
func (*MorphoLendingMarket) GetIrm ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetIrm() string
func (*MorphoLendingMarket) GetLiquidityUsd ¶ added in v0.1.43
func (m *MorphoLendingMarket) GetLiquidityUsd() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetLltv ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetLltv() string
func (*MorphoLendingMarket) GetLoanIntrinsicApy ¶ added in v0.1.54
func (m *MorphoLendingMarket) GetLoanIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetLoanToken ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetLoanToken() string
func (*MorphoLendingMarket) GetLoanTokenDecimals ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetLoanTokenDecimals() int64
func (*MorphoLendingMarket) GetLoanTokenSymbol ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetLoanTokenSymbol() string
func (*MorphoLendingMarket) GetMarketID ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetMarketID() string
func (*MorphoLendingMarket) GetOracle ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetOracle() string
func (*MorphoLendingMarket) GetSupplyApy ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetSupplyApy() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetTotalBorrowAssets ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetTotalBorrowAssets() string
func (*MorphoLendingMarket) GetTotalSupplyAssets ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetTotalSupplyAssets() string
func (*MorphoLendingMarket) GetTvlUsd ¶ added in v0.1.43
func (m *MorphoLendingMarket) GetTvlUsd() optionalnullable.OptionalNullable[string]
func (*MorphoLendingMarket) GetUtilization ¶ added in v0.1.34
func (m *MorphoLendingMarket) GetUtilization() string
type MorphoMarketsResponse ¶ added in v0.1.34
type MorphoMarketsResponse struct {
Total int64 `json:"total"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
// Morpho Blue singleton contract the markets were read from.
Morpho string `json:"morpho"`
// This page of lending markets (already ordered) with live LLTV, APYs, utilization, and liquidity. `total` is the full market count.
Markets []MorphoLendingMarket `json:"markets,omitzero"`
}
MorphoMarketsResponse - A page of Morpho Blue lending markets, ordered + paginated on the DB set; each returned market is enriched with live on-chain LLTV/APY/utilisation.
func (*MorphoMarketsResponse) GetLimit ¶ added in v0.1.44
func (m *MorphoMarketsResponse) GetLimit() int64
func (*MorphoMarketsResponse) GetMarkets ¶ added in v0.1.34
func (m *MorphoMarketsResponse) GetMarkets() []MorphoLendingMarket
func (*MorphoMarketsResponse) GetMorpho ¶ added in v0.1.34
func (m *MorphoMarketsResponse) GetMorpho() string
func (*MorphoMarketsResponse) GetOffset ¶ added in v0.1.44
func (m *MorphoMarketsResponse) GetOffset() int64
func (*MorphoMarketsResponse) GetTotal ¶ added in v0.1.44
func (m *MorphoMarketsResponse) GetTotal() int64
func (MorphoMarketsResponse) MarshalJSON ¶ added in v0.1.34
func (m MorphoMarketsResponse) MarshalJSON() ([]byte, error)
func (*MorphoMarketsResponse) UnmarshalJSON ¶ added in v0.1.34
func (m *MorphoMarketsResponse) UnmarshalJSON(data []byte) error
type Multiplier ¶ added in v0.1.34
type Multiplier struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type MultiplierType
}
Multiplier - Target leverage: total collateral exposure = multiplier × initial_collateral_amount. Must be achievable at the requested loan_to_value (max ≈ 0.9 / (1 − LTV)).
func CreateMultiplierNumber ¶ added in v0.1.34
func CreateMultiplierNumber(number float64) Multiplier
func CreateMultiplierStr ¶ added in v0.1.34
func CreateMultiplierStr(str string) Multiplier
func (Multiplier) MarshalJSON ¶ added in v0.1.34
func (u Multiplier) MarshalJSON() ([]byte, error)
func (*Multiplier) UnmarshalJSON ¶ added in v0.1.34
func (u *Multiplier) UnmarshalJSON(data []byte) error
type MultiplierType ¶ added in v0.1.34
type MultiplierType string
const ( MultiplierTypeNumber MultiplierType = "number" MultiplierTypeStr MultiplierType = "str" )
type OhlcCandle ¶
type OhlcCandle struct {
// ISO 8601 UTC timestamp at candle open.
Timestamp string `json:"timestamp"`
// Open price (decimal string).
Open string `json:"open"`
// High price (decimal string).
High string `json:"high"`
// Low price (decimal string).
Low string `json:"low"`
// Close price (decimal string).
Close string `json:"close"`
}
OhlcCandle - A single OHLC candle. Per-candle volume is not provided.
func (*OhlcCandle) GetClose ¶
func (o *OhlcCandle) GetClose() string
func (*OhlcCandle) GetHigh ¶
func (o *OhlcCandle) GetHigh() string
func (*OhlcCandle) GetLow ¶
func (o *OhlcCandle) GetLow() string
func (*OhlcCandle) GetOpen ¶
func (o *OhlcCandle) GetOpen() string
func (*OhlcCandle) GetTimestamp ¶
func (o *OhlcCandle) GetTimestamp() string
type OnrampCreate ¶ added in v0.1.26
type OnrampCreate struct {
// Halliday's payment id. Use it to poll status.
PaymentID string `json:"payment_id"`
// The one-time-wallet (OTW) deposit address for this payment, owned solely by the user's wallet (non-custodial).
DepositAddress string `json:"deposit_address"`
// Compass-hosted checkout page to open in a browser. It renders the card + identity-verification flow and delivers USDC to the destination wallet.
CheckoutURL string `json:"checkout_url"`
// Short, agent-actionable guidance: open the checkout link, pay, then poll status until delivered.
UserInstructions string `json:"user_instructions"`
// Initial lifecycle state (typically `pending`).
Status OnrampCreateStatus `json:"status"`
// An indicative fiat -> USDC-on-Ethereum quote.
Quote OnrampQuote `json:"quote"`
}
OnrampCreate - A created on-ramp payment, with the browser-handoff affordances.
The caller (CLI / MCP agent / UI) presents “checkout_url“ to the user to pay by card and complete identity verification, then polls “GET /v2/onramp/status“ until “status“ is “delivered“.
func (*OnrampCreate) GetCheckoutURL ¶ added in v0.1.26
func (o *OnrampCreate) GetCheckoutURL() string
func (*OnrampCreate) GetDepositAddress ¶ added in v0.1.26
func (o *OnrampCreate) GetDepositAddress() string
func (*OnrampCreate) GetPaymentID ¶ added in v0.1.26
func (o *OnrampCreate) GetPaymentID() string
func (*OnrampCreate) GetQuote ¶ added in v0.1.26
func (o *OnrampCreate) GetQuote() OnrampQuote
func (*OnrampCreate) GetStatus ¶ added in v0.1.26
func (o *OnrampCreate) GetStatus() OnrampCreateStatus
func (*OnrampCreate) GetUserInstructions ¶ added in v0.1.26
func (o *OnrampCreate) GetUserInstructions() string
type OnrampCreateRequest ¶ added in v0.1.26
type OnrampCreateRequest struct {
// Amount of fiat to spend, as a decimal string (e.g. `100`).
FiatAmount string `json:"fiat_amount"`
// ISO-4217 fiat currency code. Defaults to `USD`.
FiatCurrency *string `json:"fiat_currency,omitzero"`
// The wallet that will receive the USDC on Ethereum. Funds are delivered here directly — Compass never holds them.
DestinationAddress string `json:"destination_address"`
// Optional Halliday quote handle to confirm against. Omit to confirm against a fresh quote derived from the amount and currency.
QuoteID optionalnullable.OptionalNullable[string] `json:"quote_id,omitzero"`
}
OnrampCreateRequest - Create a fiat on-ramp payment delivering USDC on Ethereum.
Carries the same fields as the quote (a quote is implicit — we do not persist a quote handle). “quote_id“ is optional and only echoed upstream if Halliday's “/payments/confirm“ requires a previously-issued quote handle; omit it to confirm against a fresh quote.
func (*OnrampCreateRequest) GetDestinationAddress ¶ added in v0.1.26
func (o *OnrampCreateRequest) GetDestinationAddress() string
func (*OnrampCreateRequest) GetFiatAmount ¶ added in v0.1.26
func (o *OnrampCreateRequest) GetFiatAmount() string
func (*OnrampCreateRequest) GetFiatCurrency ¶ added in v0.1.26
func (o *OnrampCreateRequest) GetFiatCurrency() *string
func (*OnrampCreateRequest) GetQuoteID ¶ added in v0.1.26
func (o *OnrampCreateRequest) GetQuoteID() optionalnullable.OptionalNullable[string]
type OnrampCreateStatus ¶ added in v0.1.26
type OnrampCreateStatus string
OnrampCreateStatus - Initial lifecycle state (typically `pending`).
const ( OnrampCreateStatusPending OnrampCreateStatus = "pending" OnrampCreateStatusProcessing OnrampCreateStatus = "processing" OnrampCreateStatusDelivered OnrampCreateStatus = "delivered" OnrampCreateStatusFailed OnrampCreateStatus = "failed" )
func (*OnrampCreateStatus) IsExact ¶ added in v0.1.26
func (e *OnrampCreateStatus) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (OnrampCreateStatus) ToPointer ¶ added in v0.1.26
func (e OnrampCreateStatus) ToPointer() *OnrampCreateStatus
type OnrampFees ¶ added in v0.1.26
type OnrampFees struct {
// Fee charged by the on-ramp provider, in fiat.
ProviderFee string `json:"provider_fee"`
// Estimated network/gas fee, in fiat.
NetworkFee string `json:"network_fee"`
// Compass business fee, in fiat. Always `0` for now.
BusinessFees *string `json:"business_fees,omitzero"`
}
OnrampFees - Fee breakdown for an on-ramp quote.
“business_fees“ is a fixed “"0"“ for now — monetization is a single future lever and is intentionally not charged.
func (*OnrampFees) GetBusinessFees ¶ added in v0.1.26
func (o *OnrampFees) GetBusinessFees() *string
func (*OnrampFees) GetNetworkFee ¶ added in v0.1.26
func (o *OnrampFees) GetNetworkFee() string
func (*OnrampFees) GetProviderFee ¶ added in v0.1.26
func (o *OnrampFees) GetProviderFee() string
type OnrampQuote ¶ added in v0.1.26
type OnrampQuote struct {
// Fiat amount to spend.
FiatAmount string `json:"fiat_amount"`
// ISO-4217 fiat currency code.
FiatCurrency string `json:"fiat_currency"`
// Estimated USDC delivered, human-readable (6-decimal token).
OutputAmount string `json:"output_amount"`
// USDC received per unit of fiat.
ExchangeRate string `json:"exchange_rate"`
// Fee breakdown for an on-ramp quote.
//
// “business_fees“ is a fixed “"0"“ for now — monetization is a single
// future lever and is intentionally not charged.
Fees OnrampFees `json:"fees"`
// Minimum fiat amount accepted, if advertised by the provider.
MinAmount optionalnullable.OptionalNullable[string] `json:"min_amount,omitzero"`
// Maximum fiat amount accepted, if advertised by the provider.
MaxAmount optionalnullable.OptionalNullable[string] `json:"max_amount,omitzero"`
// ISO-8601 timestamp after which this quote is stale, if any.
ExpiresAt optionalnullable.OptionalNullable[string] `json:"expires_at,omitzero"`
// contains filtered or unexported fields
}
OnrampQuote - An indicative fiat -> USDC-on-Ethereum quote.
func (*OnrampQuote) GetExchangeRate ¶ added in v0.1.26
func (o *OnrampQuote) GetExchangeRate() string
func (*OnrampQuote) GetExpiresAt ¶ added in v0.1.26
func (o *OnrampQuote) GetExpiresAt() optionalnullable.OptionalNullable[string]
func (*OnrampQuote) GetFees ¶ added in v0.1.26
func (o *OnrampQuote) GetFees() OnrampFees
func (*OnrampQuote) GetFiatAmount ¶ added in v0.1.26
func (o *OnrampQuote) GetFiatAmount() string
func (*OnrampQuote) GetFiatCurrency ¶ added in v0.1.26
func (o *OnrampQuote) GetFiatCurrency() string
func (*OnrampQuote) GetMaxAmount ¶ added in v0.1.26
func (o *OnrampQuote) GetMaxAmount() optionalnullable.OptionalNullable[string]
func (*OnrampQuote) GetMinAmount ¶ added in v0.1.26
func (o *OnrampQuote) GetMinAmount() optionalnullable.OptionalNullable[string]
func (*OnrampQuote) GetOutputAmount ¶ added in v0.1.26
func (o *OnrampQuote) GetOutputAmount() string
func (*OnrampQuote) GetOutputAsset ¶ added in v0.1.26
func (o *OnrampQuote) GetOutputAsset() *string
func (*OnrampQuote) GetOutputChain ¶ added in v0.1.26
func (o *OnrampQuote) GetOutputChain() *string
func (OnrampQuote) MarshalJSON ¶ added in v0.1.26
func (o OnrampQuote) MarshalJSON() ([]byte, error)
func (*OnrampQuote) UnmarshalJSON ¶ added in v0.1.26
func (o *OnrampQuote) UnmarshalJSON(data []byte) error
type OnrampQuoteRequest ¶ added in v0.1.26
type OnrampQuoteRequest struct {
// Amount of fiat to spend, as a decimal string (e.g. `100`).
FiatAmount string `json:"fiat_amount"`
// ISO-4217 fiat currency code. Defaults to `USD`.
FiatCurrency *string `json:"fiat_currency,omitzero"`
// The wallet that will receive the USDC on Ethereum. Funds are delivered here directly — Compass never holds them.
DestinationAddress string `json:"destination_address"`
}
OnrampQuoteRequest - An indicative fiat -> USDC-on-Ethereum quote request.
The output asset and chain are fixed to USDC on Ethereum and are not user-supplied — this product group delivers only USDC to the user's own wallet (non-custodial).
func (*OnrampQuoteRequest) GetDestinationAddress ¶ added in v0.1.26
func (o *OnrampQuoteRequest) GetDestinationAddress() string
func (*OnrampQuoteRequest) GetFiatAmount ¶ added in v0.1.26
func (o *OnrampQuoteRequest) GetFiatAmount() string
func (*OnrampQuoteRequest) GetFiatCurrency ¶ added in v0.1.26
func (o *OnrampQuoteRequest) GetFiatCurrency() *string
type OnrampStatus ¶ added in v0.1.26
type OnrampStatus struct {
// Halliday's payment id, echoed straight through.
PaymentID string `json:"payment_id"`
// Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
Status OnrampStatusStatus `json:"status"`
// USDC delivered so far, human-readable. Set once delivered.
OutputAmountDelivered optionalnullable.OptionalNullable[string] `json:"output_amount_delivered,omitzero"`
// Ethereum tx hash of the USDC delivery, once available.
DeliveryTxHash optionalnullable.OptionalNullable[string] `json:"delivery_tx_hash,omitzero"`
// The wallet the USDC is delivered to.
DestinationAddress optionalnullable.OptionalNullable[string] `json:"destination_address,omitzero"`
// ISO-8601 timestamp of the last status change, if provided.
UpdatedAt optionalnullable.OptionalNullable[string] `json:"updated_at,omitzero"`
}
OnrampStatus - Current state of a fiat on-ramp payment.
Re-read on demand from Halliday (the system of record) — Compass holds no state of its own.
func (*OnrampStatus) GetDeliveryTxHash ¶ added in v0.1.26
func (o *OnrampStatus) GetDeliveryTxHash() optionalnullable.OptionalNullable[string]
func (*OnrampStatus) GetDestinationAddress ¶ added in v0.1.26
func (o *OnrampStatus) GetDestinationAddress() optionalnullable.OptionalNullable[string]
func (*OnrampStatus) GetOutputAmountDelivered ¶ added in v0.1.26
func (o *OnrampStatus) GetOutputAmountDelivered() optionalnullable.OptionalNullable[string]
func (*OnrampStatus) GetPaymentID ¶ added in v0.1.26
func (o *OnrampStatus) GetPaymentID() string
func (*OnrampStatus) GetStatus ¶ added in v0.1.26
func (o *OnrampStatus) GetStatus() OnrampStatusStatus
func (*OnrampStatus) GetUpdatedAt ¶ added in v0.1.26
func (o *OnrampStatus) GetUpdatedAt() optionalnullable.OptionalNullable[string]
type OnrampStatusStatus ¶ added in v0.1.26
type OnrampStatusStatus string
OnrampStatusStatus - Lifecycle state: `pending` (awaiting card payment), `processing` (payment received, bridging/swapping to USDC), `delivered` (USDC received in the destination wallet), or `failed`.
const ( OnrampStatusStatusPending OnrampStatusStatus = "pending" OnrampStatusStatusProcessing OnrampStatusStatus = "processing" OnrampStatusStatusDelivered OnrampStatusStatus = "delivered" OnrampStatusStatusFailed OnrampStatusStatus = "failed" )
func (*OnrampStatusStatus) IsExact ¶ added in v0.1.26
func (e *OnrampStatusStatus) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (OnrampStatusStatus) ToPointer ¶ added in v0.1.26
func (e OnrampStatusStatus) ToPointer() *OnrampStatusStatus
type OperationType ¶
type OperationType int64
OperationType - Safe operation types.
const ( OperationTypeZero OperationType = 0 OperationTypeOne OperationType = 1 )
func (*OperationType) IsExact ¶
func (e *OperationType) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (OperationType) ToPointer ¶
func (e OperationType) ToPointer() *OperationType
type OrderStatus ¶
type OrderStatus struct {
// On-chain order hash.
OrderHash string `json:"order_hash"`
// Order lifecycle state. One of `pending`, `filled`, `expired`, or `cancelled`. Upstream protocol states beyond these four (e.g. `partially-filled`, `refunded`) are mapped onto this set.
Status OrderStatusStatus `json:"status"`
// Transaction hash of the most recent fill. Populated for fully filled orders and for partial fills while `status` is still `pending`.
FillTxHash optionalnullable.OptionalNullable[string] `json:"fill_tx_hash,omitzero"`
// Implied USD execution rate per unit of the received token, derived from filled amounts and the input token's USD price. For USDC → equity buys, this is the USD paid per equity unit. Omitted when token decimals or pricing are not available.
FillPriceUsd optionalnullable.OptionalNullable[string] `json:"fill_price_usd,omitzero"`
// Total amount filled so far, expressed as a raw integer in the input token's decimals. Populated for partial fills while `status` is still `pending`, and for fully filled orders.
FilledAmount optionalnullable.OptionalNullable[string] `json:"filled_amount,omitzero"`
// ISO 8601 UTC timestamp at which the order was submitted.
SubmittedAt optionalnullable.OptionalNullable[string] `json:"submitted_at,omitzero"`
// ISO 8601 UTC timestamp at which this status was read.
UpdatedAt string `json:"updated_at"`
}
OrderStatus - Returned from `GET /order/{hash}` — current state of a relayed order.
func (*OrderStatus) GetFillPriceUsd ¶
func (o *OrderStatus) GetFillPriceUsd() optionalnullable.OptionalNullable[string]
func (*OrderStatus) GetFillTxHash ¶
func (o *OrderStatus) GetFillTxHash() optionalnullable.OptionalNullable[string]
func (*OrderStatus) GetFilledAmount ¶
func (o *OrderStatus) GetFilledAmount() optionalnullable.OptionalNullable[string]
func (*OrderStatus) GetOrderHash ¶
func (o *OrderStatus) GetOrderHash() string
func (*OrderStatus) GetStatus ¶
func (o *OrderStatus) GetStatus() OrderStatusStatus
func (*OrderStatus) GetSubmittedAt ¶
func (o *OrderStatus) GetSubmittedAt() optionalnullable.OptionalNullable[string]
func (*OrderStatus) GetUpdatedAt ¶
func (o *OrderStatus) GetUpdatedAt() string
type OrderStatusStatus ¶ added in v0.1.26
type OrderStatusStatus string
OrderStatusStatus - Order lifecycle state. One of `pending`, `filled`, `expired`, or `cancelled`. Upstream protocol states beyond these four (e.g. `partially-filled`, `refunded`) are mapped onto this set.
const ( OrderStatusStatusPending OrderStatusStatus = "pending" OrderStatusStatusFilled OrderStatusStatus = "filled" OrderStatusStatusExpired OrderStatusStatus = "expired" OrderStatusStatusCancelled OrderStatusStatus = "cancelled" )
func (*OrderStatusStatus) IsExact ¶ added in v0.1.26
func (e *OrderStatusStatus) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (OrderStatusStatus) ToPointer ¶ added in v0.1.26
func (e OrderStatusStatus) ToPointer() *OrderStatusStatus
type OrderToSign ¶
type OrderToSign struct {
// The on-chain order hash. Wrapped inside `safe_message_eip712.message.message` for the owner to sign; also passed back to `/order/submit` so the API can return a usable handle even if the upstream submit response omits the hash.
OrderHash string `json:"order_hash"`
// Opaque hex blob from the upstream quote — pass back to `/order/submit` unchanged.
Extension string `json:"extension"`
// Upstream quote identifier — must be echoed back at `/order/submit`.
QuoteID string `json:"quote_id"`
// Order struct (maker, makerAsset, makingAmount, etc.) — pass back to `/order/submit` unchanged. The maker is the Tokenized Equities Account, not the owner's wallet.
OrderMessage map[string]any `json:"order_message"`
// “signTypedData“ payload for “SafeMessage(bytes message)“.
SafeMessageEip712 SafeMessageEip712Response `json:"safe_message_eip712"`
}
OrderToSign - Order metadata plus the EIP-712 payload the owner signs to authorize it.
The owner signs “safe_message_eip712“ off-chain. At submit time the signature is sent back to “/order/submit“ together with “order_message“, “extension“, and “quote_id“; the signature is validated against the Tokenized Assets Account at fill time.
func (*OrderToSign) GetExtension ¶
func (o *OrderToSign) GetExtension() string
func (*OrderToSign) GetOrderHash ¶
func (o *OrderToSign) GetOrderHash() string
func (*OrderToSign) GetOrderMessage ¶
func (o *OrderToSign) GetOrderMessage() map[string]any
func (*OrderToSign) GetQuoteID ¶
func (o *OrderToSign) GetQuoteID() string
func (*OrderToSign) GetSafeMessageEip712 ¶
func (o *OrderToSign) GetSafeMessageEip712() SafeMessageEip712Response
type PendleDepositEvent ¶
type PendleDepositEvent struct {
// Block number when deposit occurred
BlockNumber int64 `json:"block_number"`
// Timestamp when deposit occurred
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash of the deposit
TransactionHash string `json:"transaction_hash"`
// Amount deposited (token spent)
InputAmount string `json:"input_amount"`
// Symbol of token deposited
InputSymbol string `json:"input_symbol"`
// PT tokens received
OutputAmount string `json:"output_amount"`
// Symbol (PT)
OutputSymbol string `json:"output_symbol"`
// Cost basis per PT at deposit (SY spent per PT acquired)
CostPerUnit string `json:"cost_per_unit"`
}
PendleDepositEvent - Pendle PT deposit event with cost basis at time of deposit.
func (*PendleDepositEvent) GetBlockNumber ¶
func (p *PendleDepositEvent) GetBlockNumber() int64
func (*PendleDepositEvent) GetBlockTimestamp ¶
func (p *PendleDepositEvent) GetBlockTimestamp() time.Time
func (*PendleDepositEvent) GetCostPerUnit ¶
func (p *PendleDepositEvent) GetCostPerUnit() string
func (*PendleDepositEvent) GetInputAmount ¶
func (p *PendleDepositEvent) GetInputAmount() string
func (*PendleDepositEvent) GetInputSymbol ¶
func (p *PendleDepositEvent) GetInputSymbol() string
func (*PendleDepositEvent) GetOutputAmount ¶
func (p *PendleDepositEvent) GetOutputAmount() string
func (*PendleDepositEvent) GetOutputSymbol ¶
func (p *PendleDepositEvent) GetOutputSymbol() string
func (*PendleDepositEvent) GetTransactionHash ¶
func (p *PendleDepositEvent) GetTransactionHash() string
func (PendleDepositEvent) MarshalJSON ¶
func (p PendleDepositEvent) MarshalJSON() ([]byte, error)
func (*PendleDepositEvent) UnmarshalJSON ¶
func (p *PendleDepositEvent) UnmarshalJSON(data []byte) error
type PendleMarketInfo ¶
type PendleMarketInfo struct {
// The Pendle market contract address.
MarketAddress string `json:"market_address"`
// Blockchain name (e.g., 'ethereum', 'arbitrum').
Chain string `json:"chain"`
// The Principal Token (PT) address.
PtAddress string `json:"pt_address"`
// The Standardized Yield (SY) token address.
SyAddress optionalnullable.OptionalNullable[string] `json:"sy_address,omitzero"`
// The Yield Token (YT) address.
YtAddress optionalnullable.OptionalNullable[string] `json:"yt_address,omitzero"`
// The market maturity timestamp (Unix epoch seconds).
Expiry optionalnullable.OptionalNullable[int64] `json:"expiry,omitzero"`
// The underlying asset contract address.
UnderlyingAsset optionalnullable.OptionalNullable[string] `json:"underlying_asset,omitzero"`
// The name of the underlying asset.
UnderlyingName optionalnullable.OptionalNullable[string] `json:"underlying_name,omitzero"`
// The symbol of the underlying asset (e.g., 'USDC').
UnderlyingSymbol optionalnullable.OptionalNullable[string] `json:"underlying_symbol,omitzero"`
// The name of the Principal Token.
PtName optionalnullable.OptionalNullable[string] `json:"pt_name,omitzero"`
// The symbol of the Principal Token.
PtSymbol optionalnullable.OptionalNullable[string] `json:"pt_symbol,omitzero"`
// Total Value Locked in USD.
TvlUsd optionalnullable.OptionalNullable[string] `json:"tvl_usd,omitzero"`
// Implied APY as a percentage (e.g., 5.25 = 5.25%).
ImpliedApy optionalnullable.OptionalNullable[string] `json:"implied_apy,omitzero"`
}
PendleMarketInfo - Information about a single Pendle market from the database.
func (*PendleMarketInfo) GetChain ¶
func (p *PendleMarketInfo) GetChain() string
func (*PendleMarketInfo) GetExpiry ¶
func (p *PendleMarketInfo) GetExpiry() optionalnullable.OptionalNullable[int64]
func (*PendleMarketInfo) GetImpliedApy ¶
func (p *PendleMarketInfo) GetImpliedApy() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetMarketAddress ¶
func (p *PendleMarketInfo) GetMarketAddress() string
func (*PendleMarketInfo) GetPtAddress ¶
func (p *PendleMarketInfo) GetPtAddress() string
func (*PendleMarketInfo) GetPtName ¶
func (p *PendleMarketInfo) GetPtName() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetPtSymbol ¶
func (p *PendleMarketInfo) GetPtSymbol() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetSyAddress ¶
func (p *PendleMarketInfo) GetSyAddress() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetTvlUsd ¶
func (p *PendleMarketInfo) GetTvlUsd() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetUnderlyingAsset ¶
func (p *PendleMarketInfo) GetUnderlyingAsset() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetUnderlyingName ¶
func (p *PendleMarketInfo) GetUnderlyingName() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetUnderlyingSymbol ¶
func (p *PendleMarketInfo) GetUnderlyingSymbol() optionalnullable.OptionalNullable[string]
func (*PendleMarketInfo) GetYtAddress ¶
func (p *PendleMarketInfo) GetYtAddress() optionalnullable.OptionalNullable[string]
type PendleMarketsResponse ¶
type PendleMarketsResponse struct {
Total int64 `json:"total"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
// A list of Pendle market information objects.
Markets []PendleMarketInfo `json:"markets"`
}
PendleMarketsResponse - Response model for a paginated list of Pendle markets.
func (*PendleMarketsResponse) GetLimit ¶
func (p *PendleMarketsResponse) GetLimit() int64
func (*PendleMarketsResponse) GetMarkets ¶
func (p *PendleMarketsResponse) GetMarkets() []PendleMarketInfo
func (*PendleMarketsResponse) GetOffset ¶
func (p *PendleMarketsResponse) GetOffset() int64
func (*PendleMarketsResponse) GetTotal ¶
func (p *PendleMarketsResponse) GetTotal() int64
type PendlePTPosition ¶
type PendlePTPosition struct {
// The Pendle market address.
MarketAddress string `json:"market_address"`
// The PT (Principal Token) contract address.
PtAddress string `json:"pt_address"`
// Symbol of the underlying asset (e.g., rsETH, weETH).
UnderlyingSymbol string `json:"underlying_symbol"`
// Address of the underlying asset (base asset from SY).
UnderlyingAddress string `json:"underlying_address"`
// Address of the yield token (e.g., weETH) used for USD pricing.
YieldTokenAddress string `json:"yield_token_address"`
// The user's PT token balance.
PtBalance *string `json:"pt_balance"`
// Market expiry timestamp (Unix seconds).
Expiry int64 `json:"expiry"`
// Current PT-to-SY exchange rate (SY received per PT if sold now).
CurrentPtToSyRate *string `json:"current_pt_to_sy_rate"`
// Position value in USD (null if price unavailable).
UsdValue optionalnullable.OptionalNullable[string] `json:"usd_value,omitzero"`
// PnL metrics (in SY terms) for this position.
Pnl optionalnullable.OptionalNullable[PositionPnL] `json:"pnl,omitzero"`
// All buy PT events for this position.
Deposits []PendleDepositEvent `json:"deposits,omitzero"`
// All sell/redeem PT events for this position.
Withdrawals []PendleWithdrawalEvent `json:"withdrawals,omitzero"`
// Implied APY (percentage).
ImpliedApy optionalnullable.OptionalNullable[string] `json:"implied_apy,omitzero"`
// contains filtered or unexported fields
}
PendlePTPosition - Pendle Principal Token position.
func (*PendlePTPosition) GetCurrentPtToSyRate ¶
func (p *PendlePTPosition) GetCurrentPtToSyRate() *string
func (*PendlePTPosition) GetDeposits ¶
func (p *PendlePTPosition) GetDeposits() []PendleDepositEvent
func (*PendlePTPosition) GetExpiry ¶
func (p *PendlePTPosition) GetExpiry() int64
func (*PendlePTPosition) GetImpliedApy ¶
func (p *PendlePTPosition) GetImpliedApy() optionalnullable.OptionalNullable[string]
func (*PendlePTPosition) GetMarketAddress ¶
func (p *PendlePTPosition) GetMarketAddress() string
func (*PendlePTPosition) GetPnl ¶
func (p *PendlePTPosition) GetPnl() optionalnullable.OptionalNullable[PositionPnL]
func (*PendlePTPosition) GetPtAddress ¶
func (p *PendlePTPosition) GetPtAddress() string
func (*PendlePTPosition) GetPtBalance ¶
func (p *PendlePTPosition) GetPtBalance() *string
func (*PendlePTPosition) GetType ¶
func (p *PendlePTPosition) GetType() string
func (*PendlePTPosition) GetUnderlyingAddress ¶
func (p *PendlePTPosition) GetUnderlyingAddress() string
func (*PendlePTPosition) GetUnderlyingSymbol ¶
func (p *PendlePTPosition) GetUnderlyingSymbol() string
func (*PendlePTPosition) GetUsdValue ¶
func (p *PendlePTPosition) GetUsdValue() optionalnullable.OptionalNullable[string]
func (*PendlePTPosition) GetWithdrawals ¶
func (p *PendlePTPosition) GetWithdrawals() []PendleWithdrawalEvent
func (*PendlePTPosition) GetYieldTokenAddress ¶
func (p *PendlePTPosition) GetYieldTokenAddress() string
func (PendlePTPosition) MarshalJSON ¶
func (p PendlePTPosition) MarshalJSON() ([]byte, error)
func (*PendlePTPosition) UnmarshalJSON ¶
func (p *PendlePTPosition) UnmarshalJSON(data []byte) error
type PendlePTVenue ¶
type PendlePTVenue struct {
// The Pendle market address identifying which PT to trade.
MarketAddress string `json:"market_address"`
// The token to exchange for PT (only used for DEPOSIT/buy). For WITHDRAW/sell, this field must not be provided - withdrawals always return the underlying asset to ensure accurate yield fee calculation.
Token optionalnullable.OptionalNullable[string] `json:"token,omitzero"`
// Maximum slippage allowed in percent (e.g., 1 means 1% slippage).
MaxSlippagePercent *float64 `json:"max_slippage_percent,omitzero"`
// contains filtered or unexported fields
}
PendlePTVenue - Venue for Pendle Principal Token (PT) positions.
func (*PendlePTVenue) GetMarketAddress ¶
func (p *PendlePTVenue) GetMarketAddress() string
func (*PendlePTVenue) GetMaxSlippagePercent ¶
func (p *PendlePTVenue) GetMaxSlippagePercent() *float64
func (*PendlePTVenue) GetToken ¶
func (p *PendlePTVenue) GetToken() optionalnullable.OptionalNullable[string]
func (*PendlePTVenue) GetType ¶
func (p *PendlePTVenue) GetType() string
func (PendlePTVenue) MarshalJSON ¶
func (p PendlePTVenue) MarshalJSON() ([]byte, error)
func (*PendlePTVenue) UnmarshalJSON ¶
func (p *PendlePTVenue) UnmarshalJSON(data []byte) error
type PendleWithdrawalEvent ¶
type PendleWithdrawalEvent struct {
// Block number when withdrawal occurred
BlockNumber int64 `json:"block_number"`
// Timestamp when withdrawal occurred
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash of the withdrawal
TransactionHash string `json:"transaction_hash"`
// PT tokens sold/redeemed
InputAmount string `json:"input_amount"`
// Symbol (PT)
InputSymbol string `json:"input_symbol"`
// Amount received (SY or token)
OutputAmount string `json:"output_amount"`
// Symbol of token received
OutputSymbol string `json:"output_symbol"`
// Profit/loss: output value - cost basis consumed
RealizedPnl string `json:"realized_pnl"`
// Cost basis per PT at withdrawal (SY received per PT sold)
CostPerUnit string `json:"cost_per_unit"`
}
PendleWithdrawalEvent - Pendle PT withdrawal event with cost basis at time of withdrawal.
func (*PendleWithdrawalEvent) GetBlockNumber ¶
func (p *PendleWithdrawalEvent) GetBlockNumber() int64
func (*PendleWithdrawalEvent) GetBlockTimestamp ¶
func (p *PendleWithdrawalEvent) GetBlockTimestamp() time.Time
func (*PendleWithdrawalEvent) GetCostPerUnit ¶
func (p *PendleWithdrawalEvent) GetCostPerUnit() string
func (*PendleWithdrawalEvent) GetInputAmount ¶
func (p *PendleWithdrawalEvent) GetInputAmount() string
func (*PendleWithdrawalEvent) GetInputSymbol ¶
func (p *PendleWithdrawalEvent) GetInputSymbol() string
func (*PendleWithdrawalEvent) GetOutputAmount ¶
func (p *PendleWithdrawalEvent) GetOutputAmount() string
func (*PendleWithdrawalEvent) GetOutputSymbol ¶
func (p *PendleWithdrawalEvent) GetOutputSymbol() string
func (*PendleWithdrawalEvent) GetRealizedPnl ¶
func (p *PendleWithdrawalEvent) GetRealizedPnl() string
func (*PendleWithdrawalEvent) GetTransactionHash ¶
func (p *PendleWithdrawalEvent) GetTransactionHash() string
func (PendleWithdrawalEvent) MarshalJSON ¶
func (p PendleWithdrawalEvent) MarshalJSON() ([]byte, error)
func (*PendleWithdrawalEvent) UnmarshalJSON ¶
func (p *PendleWithdrawalEvent) UnmarshalJSON(data []byte) error
type Permit2TypedDataInput ¶
type Permit2TypedDataInput struct {
Types CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types `json:"types"`
Domain CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain `json:"domain"`
Message PermitTransferFromMessage `json:"message"`
// contains filtered or unexported fields
}
func (*Permit2TypedDataInput) GetDomain ¶
func (p *Permit2TypedDataInput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain
func (*Permit2TypedDataInput) GetMessage ¶
func (p *Permit2TypedDataInput) GetMessage() PermitTransferFromMessage
func (*Permit2TypedDataInput) GetPrimaryType ¶
func (p *Permit2TypedDataInput) GetPrimaryType() *string
func (*Permit2TypedDataInput) GetTypes ¶
func (p *Permit2TypedDataInput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types
func (Permit2TypedDataInput) MarshalJSON ¶
func (p Permit2TypedDataInput) MarshalJSON() ([]byte, error)
func (*Permit2TypedDataInput) UnmarshalJSON ¶
func (p *Permit2TypedDataInput) UnmarshalJSON(data []byte) error
type Permit2TypedDataOutput ¶
type Permit2TypedDataOutput struct {
Types CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types `json:"types"`
Domain CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain `json:"domain"`
Message PermitTransferFromMessage `json:"message"`
// contains filtered or unexported fields
}
func (*Permit2TypedDataOutput) GetDomain ¶
func (p *Permit2TypedDataOutput) GetDomain() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Domain
func (*Permit2TypedDataOutput) GetMessage ¶
func (p *Permit2TypedDataOutput) GetMessage() PermitTransferFromMessage
func (*Permit2TypedDataOutput) GetPrimaryType ¶
func (p *Permit2TypedDataOutput) GetPrimaryType() *string
func (*Permit2TypedDataOutput) GetTypes ¶
func (p *Permit2TypedDataOutput) GetTypes() CompassAPIBackendV2ModelsGasSponsorshipPermit2TypedDataEip712Types
func (Permit2TypedDataOutput) MarshalJSON ¶
func (p Permit2TypedDataOutput) MarshalJSON() ([]byte, error)
func (*Permit2TypedDataOutput) UnmarshalJSON ¶
func (p *Permit2TypedDataOutput) UnmarshalJSON(data []byte) error
type PermitField ¶
PermitField - A field in the Permit type definition.
func (*PermitField) GetName ¶
func (p *PermitField) GetName() string
func (*PermitField) GetType ¶
func (p *PermitField) GetType() string
func (PermitField) MarshalJSON ¶
func (p PermitField) MarshalJSON() ([]byte, error)
func (*PermitField) UnmarshalJSON ¶
func (p *PermitField) UnmarshalJSON(data []byte) error
type PermitMessage ¶
type PermitMessage struct {
// Token owner address
Owner string `json:"owner"`
// Address authorized to spend tokens
Spender string `json:"spender"`
// Amount to approve (as string)
Value string `json:"value"`
// Current permit nonce for the owner
Nonce string `json:"nonce"`
// Permit expiry timestamp
Deadline string `json:"deadline"`
}
PermitMessage - The message data for an ERC-20 Permit.
func (*PermitMessage) GetDeadline ¶
func (p *PermitMessage) GetDeadline() string
func (*PermitMessage) GetNonce ¶
func (p *PermitMessage) GetNonce() string
func (*PermitMessage) GetOwner ¶
func (p *PermitMessage) GetOwner() string
func (*PermitMessage) GetSpender ¶
func (p *PermitMessage) GetSpender() string
func (*PermitMessage) GetValue ¶
func (p *PermitMessage) GetValue() string
func (PermitMessage) MarshalJSON ¶
func (p PermitMessage) MarshalJSON() ([]byte, error)
func (*PermitMessage) UnmarshalJSON ¶
func (p *PermitMessage) UnmarshalJSON(data []byte) error
type PermitTransferFromMessage ¶
type PermitTransferFromMessage struct {
Permitted TokenPermissions `json:"permitted"`
// Address allowed to transfer (caller of permitTransferFrom)
Spender string `json:"spender"`
// Unique nonce to prevent replay
Nonce int64 `json:"nonce"`
// Unix timestamp after which signature expires
Deadline int64 `json:"deadline"`
}
func (*PermitTransferFromMessage) GetDeadline ¶
func (p *PermitTransferFromMessage) GetDeadline() int64
func (*PermitTransferFromMessage) GetNonce ¶
func (p *PermitTransferFromMessage) GetNonce() int64
func (*PermitTransferFromMessage) GetPermitted ¶
func (p *PermitTransferFromMessage) GetPermitted() TokenPermissions
func (*PermitTransferFromMessage) GetSpender ¶
func (p *PermitTransferFromMessage) GetSpender() string
func (PermitTransferFromMessage) MarshalJSON ¶
func (p PermitTransferFromMessage) MarshalJSON() ([]byte, error)
func (*PermitTransferFromMessage) UnmarshalJSON ¶
func (p *PermitTransferFromMessage) UnmarshalJSON(data []byte) error
type PermitTypedDataResponseInput ¶
type PermitTypedDataResponseInput struct {
// The EIP-712 domain separator for ERC-20 Permit.
Domain CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain `json:"domain"`
// The type definitions for EIP-712 structured data (ERC-20 Permit).
Types CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types `json:"types"`
// The message data for an ERC-20 Permit.
Message PermitMessage `json:"message"`
// contains filtered or unexported fields
}
PermitTypedDataResponseInput - Response containing EIP-712 typed data for ERC-20 Permit signing.
func (*PermitTypedDataResponseInput) GetMessage ¶
func (p *PermitTypedDataResponseInput) GetMessage() PermitMessage
func (*PermitTypedDataResponseInput) GetPrimaryType ¶
func (p *PermitTypedDataResponseInput) GetPrimaryType() string
func (PermitTypedDataResponseInput) MarshalJSON ¶
func (p PermitTypedDataResponseInput) MarshalJSON() ([]byte, error)
func (*PermitTypedDataResponseInput) UnmarshalJSON ¶
func (p *PermitTypedDataResponseInput) UnmarshalJSON(data []byte) error
type PermitTypedDataResponseOutput ¶
type PermitTypedDataResponseOutput struct {
// The EIP-712 domain separator for ERC-20 Permit.
Domain CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Domain `json:"domain"`
// The type definitions for EIP-712 structured data (ERC-20 Permit).
Types CompassAPIBackendV2ModelsGasSponsorshipPermitTypedDataEip712Types `json:"types"`
// The message data for an ERC-20 Permit.
Message PermitMessage `json:"message"`
// contains filtered or unexported fields
}
PermitTypedDataResponseOutput - Response containing EIP-712 typed data for ERC-20 Permit signing.
func (*PermitTypedDataResponseOutput) GetMessage ¶
func (p *PermitTypedDataResponseOutput) GetMessage() PermitMessage
func (*PermitTypedDataResponseOutput) GetPrimaryType ¶
func (p *PermitTypedDataResponseOutput) GetPrimaryType() string
func (PermitTypedDataResponseOutput) MarshalJSON ¶
func (p PermitTypedDataResponseOutput) MarshalJSON() ([]byte, error)
func (*PermitTypedDataResponseOutput) UnmarshalJSON ¶
func (p *PermitTypedDataResponseOutput) UnmarshalJSON(data []byte) error
type PerpetualTradingActivityPartialError ¶ added in v0.1.51
type PerpetualTradingActivityPartialError struct {
Section Section `json:"section"`
Message string `json:"message"`
}
PerpetualTradingActivityPartialError - One section of /activity failed to load.
func (*PerpetualTradingActivityPartialError) GetMessage ¶ added in v0.1.51
func (p *PerpetualTradingActivityPartialError) GetMessage() string
func (*PerpetualTradingActivityPartialError) GetSection ¶ added in v0.1.51
func (p *PerpetualTradingActivityPartialError) GetSection() Section
type PerpetualTradingActivityResponse ¶ added in v0.1.51
type PerpetualTradingActivityResponse struct {
// Owner address that was queried (checksummed)
Owner string `json:"owner"`
// Open positions (null if the upstream call failed)
Positions []PerpetualTradingPosition `json:"positions"`
// Total account value in USDC (null if positions failed)
AccountValue *string `json:"account_value"`
// Withdrawable USDC balance (null if positions failed)
Withdrawable *string `json:"withdrawable"`
// Recent fills (null if the upstream call failed)
Fills []PerpetualTradingFill `json:"fills"`
// Resting orders (null if the upstream call failed)
OpenOrders []PerpetualTradingOpenOrder `json:"open_orders"`
// Builder approval state — only present when the `builder` query parameter was supplied (null on upstream failure).
BuilderApproval optionalnullable.OptionalNullable[PerpetualTradingBuilderApproval] `json:"builder_approval,omitzero"`
// One entry per section that failed to load.
PartialErrors []PerpetualTradingActivityPartialError `json:"partial_errors,omitzero"`
}
PerpetualTradingActivityResponse - Aggregated HL activity for a single end-user.
Any section may be “null“ if its upstream HL call failed — see “partial_errors“ for details. “positions“/“fills“/“open_orders“ are always either a populated list or “null“; an empty list means the user has no activity of that type, not a failure.
func (*PerpetualTradingActivityResponse) GetAccountValue ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetAccountValue() *string
func (*PerpetualTradingActivityResponse) GetBuilderApproval ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetBuilderApproval() optionalnullable.OptionalNullable[PerpetualTradingBuilderApproval]
func (*PerpetualTradingActivityResponse) GetFills ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetFills() []PerpetualTradingFill
func (*PerpetualTradingActivityResponse) GetOpenOrders ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetOpenOrders() []PerpetualTradingOpenOrder
func (*PerpetualTradingActivityResponse) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetOwner() string
func (*PerpetualTradingActivityResponse) GetPartialErrors ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetPartialErrors() []PerpetualTradingActivityPartialError
func (*PerpetualTradingActivityResponse) GetPositions ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetPositions() []PerpetualTradingPosition
func (*PerpetualTradingActivityResponse) GetWithdrawable ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) GetWithdrawable() *string
func (PerpetualTradingActivityResponse) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingActivityResponse) MarshalJSON() ([]byte, error)
func (*PerpetualTradingActivityResponse) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingActivityResponse) UnmarshalJSON(data []byte) error
type PerpetualTradingApproveBuilderFeeRequest ¶ added in v0.1.51
type PerpetualTradingApproveBuilderFeeRequest struct {
// User's EOA address
Owner string `json:"owner"`
// Builder address + max fee rate the end-user authorizes.
Builder Builder `json:"builder"`
}
PerpetualTradingApproveBuilderFeeRequest - Request to approve builder fees before trading on the perpetual trading DEX.
func (*PerpetualTradingApproveBuilderFeeRequest) GetBuilder ¶ added in v0.1.51
func (p *PerpetualTradingApproveBuilderFeeRequest) GetBuilder() Builder
func (*PerpetualTradingApproveBuilderFeeRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingApproveBuilderFeeRequest) GetOwner() string
type PerpetualTradingBuilderApproval ¶ added in v0.1.51
type PerpetualTradingBuilderApproval struct {
// Builder address that was queried
Builder string `json:"builder"`
// Maximum fee rate the user has approved for this builder, in tenths of basis points (10 = 1bp = 0.01%). Zero means the user has not approved.
MaxFeeTenthBps int64 `json:"max_fee_tenth_bps"`
// Convenience flag — true when max_fee_tenth_bps > 0
Approved bool `json:"approved"`
}
PerpetualTradingBuilderApproval - Current builder-fee approval state for a (user, builder) pair.
func (*PerpetualTradingBuilderApproval) GetApproved ¶ added in v0.1.51
func (p *PerpetualTradingBuilderApproval) GetApproved() bool
func (*PerpetualTradingBuilderApproval) GetBuilder ¶ added in v0.1.51
func (p *PerpetualTradingBuilderApproval) GetBuilder() string
func (*PerpetualTradingBuilderApproval) GetMaxFeeTenthBps ¶ added in v0.1.51
func (p *PerpetualTradingBuilderApproval) GetMaxFeeTenthBps() int64
type PerpetualTradingCancelOrderRequest ¶ added in v0.1.51
type PerpetualTradingCancelOrderRequest struct {
// Owner of the perpetual trading product account
Owner string `json:"owner"`
// Asset ticker symbol (e.g. AAPL, GOLD, EUR)
Asset string `json:"asset"`
// Hyperliquid order ID to cancel
OrderID optionalnullable.OptionalNullable[int64] `json:"order_id,omitzero"`
// Client order ID to cancel (alternative to order_id)
ClientOrderID optionalnullable.OptionalNullable[int64] `json:"client_order_id,omitzero"`
}
PerpetualTradingCancelOrderRequest - Request to cancel an open order on a perpetual trading market.
func (*PerpetualTradingCancelOrderRequest) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingCancelOrderRequest) GetAsset() string
func (*PerpetualTradingCancelOrderRequest) GetClientOrderID ¶ added in v0.1.51
func (p *PerpetualTradingCancelOrderRequest) GetClientOrderID() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingCancelOrderRequest) GetOrderID ¶ added in v0.1.51
func (p *PerpetualTradingCancelOrderRequest) GetOrderID() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingCancelOrderRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingCancelOrderRequest) GetOwner() string
type PerpetualTradingCandlesResponse ¶ added in v0.1.51
type PerpetualTradingCandlesResponse struct {
// Asset ticker the candles are for (without DEX prefix)
Symbol string `json:"symbol"`
// Candle interval that was requested
Interval string `json:"interval"`
// Candles ordered oldest → newest
Candles []Candle `json:"candles"`
}
PerpetualTradingCandlesResponse - OHLCV candle series for a single asset/interval.
func (*PerpetualTradingCandlesResponse) GetCandles ¶ added in v0.1.51
func (p *PerpetualTradingCandlesResponse) GetCandles() []Candle
func (*PerpetualTradingCandlesResponse) GetInterval ¶ added in v0.1.51
func (p *PerpetualTradingCandlesResponse) GetInterval() string
func (*PerpetualTradingCandlesResponse) GetSymbol ¶ added in v0.1.51
func (p *PerpetualTradingCandlesResponse) GetSymbol() string
type PerpetualTradingCategory ¶ added in v0.1.51
type PerpetualTradingCategory string
const ( PerpetualTradingCategoryStock PerpetualTradingCategory = "stock" PerpetualTradingCategoryCommodity PerpetualTradingCategory = "commodity" PerpetualTradingCategoryForex PerpetualTradingCategory = "forex" )
func (PerpetualTradingCategory) ToPointer ¶ added in v0.1.51
func (e PerpetualTradingCategory) ToPointer() *PerpetualTradingCategory
func (*PerpetualTradingCategory) UnmarshalJSON ¶ added in v0.1.51
func (e *PerpetualTradingCategory) UnmarshalJSON(data []byte) error
type PerpetualTradingDepositRequest ¶ added in v0.1.51
type PerpetualTradingDepositRequest struct {
// The user's EOA address on Arbitrum
Owner string `json:"owner"`
// USDC amount to deposit (human-readable, e.g. '1000.0')
Amount string `json:"amount"`
}
PerpetualTradingDepositRequest - Request to deposit USDC from Arbitrum into the user's perpetual trading account.
func (*PerpetualTradingDepositRequest) GetAmount ¶ added in v0.1.51
func (p *PerpetualTradingDepositRequest) GetAmount() string
func (*PerpetualTradingDepositRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingDepositRequest) GetOwner() string
type PerpetualTradingDepositResponse ¶ added in v0.1.51
type PerpetualTradingDepositResponse struct {
// Response containing EIP-712 typed data for ERC-20 Permit signing.
Permit PermitTypedDataResponseOutput `json:"permit"`
// USDC amount in raw 6-decimal units. Pass this and the signature to /deposit/sponsor_prepare.
AmountRaw int64 `json:"amount_raw"`
// Address that will be credited on Hyperliquid (equals the deposit owner EOA — HL keys accounts by EVM address).
Destination string `json:"destination"`
}
PerpetualTradingDepositResponse - EIP-2612 permit data the user signs to authorize a USDC bridge deposit.
After signing, submit the signature to /v2/perpetual_trading/deposit/sponsor_prepare to get a ready-to-broadcast Arbitrum tx that calls Bridge2.batchedDepositWithPermit. The integrator's sponsor wallet broadcasts that tx — Compass does not broadcast.
func (*PerpetualTradingDepositResponse) GetAmountRaw ¶ added in v0.1.51
func (p *PerpetualTradingDepositResponse) GetAmountRaw() int64
func (*PerpetualTradingDepositResponse) GetDestination ¶ added in v0.1.51
func (p *PerpetualTradingDepositResponse) GetDestination() string
func (*PerpetualTradingDepositResponse) GetPermit ¶ added in v0.1.51
func (p *PerpetualTradingDepositResponse) GetPermit() PermitTypedDataResponseOutput
type PerpetualTradingDepositSponsorPrepareRequest ¶ added in v0.1.51
type PerpetualTradingDepositSponsorPrepareRequest struct {
// The user's EOA address on Arbitrum (the permit signer).
Owner string `json:"owner"`
// USDC amount in raw 6-decimal units, as returned by /deposit.
AmountRaw int64 `json:"amount_raw"`
// Permit deadline (unix seconds), as returned in the permit.message from /deposit.
Deadline int64 `json:"deadline"`
// The user's EIP-2612 permit signature (65-byte hex, 0x-prefixed or raw).
Signature string `json:"signature"`
// Sponsor wallet address that will broadcast the returned tx (used for `from` and nonce).
Sender string `json:"sender"`
}
PerpetualTradingDepositSponsorPrepareRequest - Take a user's signed EIP-2612 USDC permit and build an Arbitrum tx that calls Bridge2.batchedDepositWithPermit.
The customer broadcasts the returned tx from their own sponsor wallet — Compass does not hold gas keys (non-custodial).
func (*PerpetualTradingDepositSponsorPrepareRequest) GetAmountRaw ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareRequest) GetAmountRaw() int64
func (*PerpetualTradingDepositSponsorPrepareRequest) GetDeadline ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareRequest) GetDeadline() int64
func (*PerpetualTradingDepositSponsorPrepareRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareRequest) GetOwner() string
func (*PerpetualTradingDepositSponsorPrepareRequest) GetSender ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareRequest) GetSender() string
func (*PerpetualTradingDepositSponsorPrepareRequest) GetSignature ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareRequest) GetSignature() string
type PerpetualTradingDepositSponsorPrepareResponse ¶ added in v0.1.51
type PerpetualTradingDepositSponsorPrepareResponse struct {
Transaction UnsignedTransaction `json:"transaction"`
}
PerpetualTradingDepositSponsorPrepareResponse - Fully-encoded Arbitrum tx that completes a HL Bridge2 deposit.
Broadcast `transaction` from the `sender` wallet supplied in the request. After the receipt confirms, verify a USDC `Transfer` event was emitted — Bridge2 can silently no-op without reverting.
func (*PerpetualTradingDepositSponsorPrepareResponse) GetTransaction ¶ added in v0.1.51
func (p *PerpetualTradingDepositSponsorPrepareResponse) GetTransaction() UnsignedTransaction
type PerpetualTradingEnableUnifiedAccountRequest ¶ added in v0.1.51
type PerpetualTradingEnableUnifiedAccountRequest struct {
// User's EOA address
Owner string `json:"owner"`
}
PerpetualTradingEnableUnifiedAccountRequest - Request to enable unified account mode on Hyperliquid.
func (*PerpetualTradingEnableUnifiedAccountRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountRequest) GetOwner() string
type PerpetualTradingEnableUnifiedAccountResponse ¶ added in v0.1.51
type PerpetualTradingEnableUnifiedAccountResponse struct {
// Current account abstraction mode (e.g. 'default', 'unifiedAccount')
Mode string `json:"mode"`
// EIP-712 typed data for wallet signing, or null if already unified
TypedData optionalnullable.OptionalNullable[map[string]any] `json:"typed_data,omitzero"`
// Raw Hyperliquid action (passed back to the execute endpoint), or null
Action optionalnullable.OptionalNullable[map[string]any] `json:"action,omitzero"`
// Timestamp-based nonce, or null if no action needed
Nonce optionalnullable.OptionalNullable[int64] `json:"nonce,omitzero"`
}
PerpetualTradingEnableUnifiedAccountResponse - Returned by the enable_unified_account endpoint.
If the account is already in unified mode, typed_data/action/nonce are null. If not, they contain the EIP-712 payload the user must sign.
func (*PerpetualTradingEnableUnifiedAccountResponse) GetAction ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
func (*PerpetualTradingEnableUnifiedAccountResponse) GetMode ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountResponse) GetMode() string
func (*PerpetualTradingEnableUnifiedAccountResponse) GetNonce ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountResponse) GetNonce() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingEnableUnifiedAccountResponse) GetTypedData ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
func (PerpetualTradingEnableUnifiedAccountResponse) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingEnableUnifiedAccountResponse) MarshalJSON() ([]byte, error)
func (*PerpetualTradingEnableUnifiedAccountResponse) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingEnableUnifiedAccountResponse) UnmarshalJSON(data []byte) error
type PerpetualTradingEnsureLeverageRequest ¶ added in v0.1.51
type PerpetualTradingEnsureLeverageRequest struct {
// User's EOA address
Owner string `json:"owner"`
// Asset ticker (e.g. 'AAPL', 'CL')
Asset string `json:"asset"`
}
PerpetualTradingEnsureLeverageRequest - Request to check and set leverage to 1x cross on a perpetual trading asset.
func (*PerpetualTradingEnsureLeverageRequest) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageRequest) GetAsset() string
func (*PerpetualTradingEnsureLeverageRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageRequest) GetOwner() string
type PerpetualTradingEnsureLeverageResponse ¶ added in v0.1.51
type PerpetualTradingEnsureLeverageResponse struct {
// True if leverage is already 1x cross, false if update needed
LeverageOk bool `json:"leverage_ok"`
// EIP-712 typed data for wallet signing, or null if already 1x cross
TypedData optionalnullable.OptionalNullable[map[string]any] `json:"typed_data,omitzero"`
// Raw Hyperliquid action (passed back to the execute endpoint), or null
Action optionalnullable.OptionalNullable[map[string]any] `json:"action,omitzero"`
// Timestamp-based nonce, or null if no action needed
Nonce optionalnullable.OptionalNullable[int64] `json:"nonce,omitzero"`
}
PerpetualTradingEnsureLeverageResponse - Returned by the ensure_leverage endpoint.
If the asset is already at 1x cross leverage, typed_data/action/nonce are null. If not (or no position exists), they contain the EIP-712 payload the user must sign.
func (*PerpetualTradingEnsureLeverageResponse) GetAction ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
func (*PerpetualTradingEnsureLeverageResponse) GetLeverageOk ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageResponse) GetLeverageOk() bool
func (*PerpetualTradingEnsureLeverageResponse) GetNonce ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageResponse) GetNonce() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingEnsureLeverageResponse) GetTypedData ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
func (PerpetualTradingEnsureLeverageResponse) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingEnsureLeverageResponse) MarshalJSON() ([]byte, error)
func (*PerpetualTradingEnsureLeverageResponse) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingEnsureLeverageResponse) UnmarshalJSON(data []byte) error
type PerpetualTradingExecuteRequest ¶ added in v0.1.51
type PerpetualTradingExecuteRequest struct {
// Raw Hyperliquid action from the prepare step
Action map[string]any `json:"action"`
// Nonce from the prepare step
Nonce int64 `json:"nonce"`
// User's EIP-712 signature (hex, 65 bytes)
Signature string `json:"signature"`
// Optional vault address
VaultAddress optionalnullable.OptionalNullable[string] `json:"vault_address,omitzero"`
}
PerpetualTradingExecuteRequest - Submit a signed Hyperliquid action for execution.
func (*PerpetualTradingExecuteRequest) GetAction ¶ added in v0.1.51
func (p *PerpetualTradingExecuteRequest) GetAction() map[string]any
func (*PerpetualTradingExecuteRequest) GetNonce ¶ added in v0.1.51
func (p *PerpetualTradingExecuteRequest) GetNonce() int64
func (*PerpetualTradingExecuteRequest) GetSignature ¶ added in v0.1.51
func (p *PerpetualTradingExecuteRequest) GetSignature() string
func (*PerpetualTradingExecuteRequest) GetVaultAddress ¶ added in v0.1.51
func (p *PerpetualTradingExecuteRequest) GetVaultAddress() optionalnullable.OptionalNullable[string]
type PerpetualTradingExecuteResponse ¶ added in v0.1.51
type PerpetualTradingExecuteResponse struct {
// 'ok' or 'error'
Status string `json:"status"`
// Hyperliquid response data (order statuses, etc.)
Response map[string]any `json:"response,omitzero"`
}
PerpetualTradingExecuteResponse - Returned after submitting a signed action to the Hyperliquid exchange.
func (*PerpetualTradingExecuteResponse) GetResponse ¶ added in v0.1.51
func (p *PerpetualTradingExecuteResponse) GetResponse() map[string]any
func (*PerpetualTradingExecuteResponse) GetStatus ¶ added in v0.1.51
func (p *PerpetualTradingExecuteResponse) GetStatus() string
func (PerpetualTradingExecuteResponse) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingExecuteResponse) MarshalJSON() ([]byte, error)
func (*PerpetualTradingExecuteResponse) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingExecuteResponse) UnmarshalJSON(data []byte) error
type PerpetualTradingFill ¶ added in v0.1.51
type PerpetualTradingFill struct {
// Asset ticker symbol (xyz prefix stripped)
Asset string `json:"asset"`
// Order side
Side PerpetualTradingFillSide `json:"side"`
// Fill price
Price string `json:"price"`
// Fill size in contracts
Size string `json:"size"`
// Total fee paid (USDC)
Fee string `json:"fee"`
// Portion of fee routed to the builder address (USDC)
BuilderFee optionalnullable.OptionalNullable[string] `json:"builder_fee,omitzero"`
// Realized PnL closed by this fill (USDC)
ClosedPnl optionalnullable.OptionalNullable[string] `json:"closed_pnl,omitzero"`
// HL order id (oid) this fill belongs to
OrderID int64 `json:"order_id"`
// Fill timestamp (ms since epoch)
TimeMs int64 `json:"time_ms"`
}
PerpetualTradingFill - A single fill (executed trade) from HL `userFills`.
func (*PerpetualTradingFill) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetAsset() string
func (*PerpetualTradingFill) GetBuilderFee ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetBuilderFee() optionalnullable.OptionalNullable[string]
func (*PerpetualTradingFill) GetClosedPnl ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetClosedPnl() optionalnullable.OptionalNullable[string]
func (*PerpetualTradingFill) GetFee ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetFee() string
func (*PerpetualTradingFill) GetOrderID ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetOrderID() int64
func (*PerpetualTradingFill) GetPrice ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetPrice() string
func (*PerpetualTradingFill) GetSide ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetSide() PerpetualTradingFillSide
func (*PerpetualTradingFill) GetSize ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetSize() string
func (*PerpetualTradingFill) GetTimeMs ¶ added in v0.1.51
func (p *PerpetualTradingFill) GetTimeMs() int64
type PerpetualTradingFillSide ¶ added in v0.1.51
type PerpetualTradingFillSide string
PerpetualTradingFillSide - Order side
const ( PerpetualTradingFillSideBuy PerpetualTradingFillSide = "buy" PerpetualTradingFillSideSell PerpetualTradingFillSide = "sell" )
func (*PerpetualTradingFillSide) IsExact ¶ added in v0.1.51
func (e *PerpetualTradingFillSide) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (PerpetualTradingFillSide) ToPointer ¶ added in v0.1.51
func (e PerpetualTradingFillSide) ToPointer() *PerpetualTradingFillSide
type PerpetualTradingLimitOrderRequest ¶ added in v0.1.51
type PerpetualTradingLimitOrderRequest struct {
// Owner of the perpetual trading product account
Owner string `json:"owner"`
// Asset ticker symbol (e.g. AAPL, GOLD, EUR)
Asset string `json:"asset"`
// Order side: 'buy' or 'sell'
Side string `json:"side"`
// Number of contracts (human-readable)
Size string `json:"size"`
// Limit price (human-readable)
Price string `json:"price"`
// Time-in-force: 'gtc' (good til cancel) or 'alo' (add liquidity only)
TimeInForce *string `json:"time_in_force,omitzero"`
// If true, order can only reduce an existing position
ReduceOnly *bool `json:"reduce_only,omitzero"`
// Optional client order ID for idempotency (uint128)
ClientOrderID optionalnullable.OptionalNullable[int64] `json:"client_order_id,omitzero"`
// Optional builder fee. When provided, the order action carries the builder address and fee — the end-user must have already approved this builder via /approve_builder_fee up to at least this rate. Omit (or pass null) to place the order with no builder fee.
Builder optionalnullable.OptionalNullable[Builder] `json:"builder,omitzero"`
}
PerpetualTradingLimitOrderRequest - Request to place a limit order on a perpetual trading market.
func (*PerpetualTradingLimitOrderRequest) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetAsset() string
func (*PerpetualTradingLimitOrderRequest) GetBuilder ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetBuilder() optionalnullable.OptionalNullable[Builder]
func (*PerpetualTradingLimitOrderRequest) GetClientOrderID ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetClientOrderID() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingLimitOrderRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetOwner() string
func (*PerpetualTradingLimitOrderRequest) GetPrice ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetPrice() string
func (*PerpetualTradingLimitOrderRequest) GetReduceOnly ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetReduceOnly() *bool
func (*PerpetualTradingLimitOrderRequest) GetSide ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetSide() string
func (*PerpetualTradingLimitOrderRequest) GetSize ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetSize() string
func (*PerpetualTradingLimitOrderRequest) GetTimeInForce ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) GetTimeInForce() *string
func (PerpetualTradingLimitOrderRequest) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingLimitOrderRequest) MarshalJSON() ([]byte, error)
func (*PerpetualTradingLimitOrderRequest) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingLimitOrderRequest) UnmarshalJSON(data []byte) error
type PerpetualTradingMarketOrderRequest ¶ added in v0.1.51
type PerpetualTradingMarketOrderRequest struct {
// Owner of the perpetual trading product account
Owner string `json:"owner"`
// Asset ticker symbol (e.g. AAPL, GOLD, EUR)
Asset string `json:"asset"`
// Order side: 'buy' or 'sell'
Side string `json:"side"`
// Number of contracts (human-readable)
Size string `json:"size"`
// Max slippage percentage for price protection
SlippagePercent *float64 `json:"slippage_percent,omitzero"`
// If true, order can only reduce an existing position
ReduceOnly *bool `json:"reduce_only,omitzero"`
// Optional builder fee. When provided, the order action carries the builder address and fee — the end-user must have already approved this builder via /approve_builder_fee up to at least this rate. Omit (or pass null) to place the order with no builder fee.
Builder optionalnullable.OptionalNullable[Builder] `json:"builder,omitzero"`
}
PerpetualTradingMarketOrderRequest - Request to place a market order on a perpetual trading market.
func (*PerpetualTradingMarketOrderRequest) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetAsset() string
func (*PerpetualTradingMarketOrderRequest) GetBuilder ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetBuilder() optionalnullable.OptionalNullable[Builder]
func (*PerpetualTradingMarketOrderRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetOwner() string
func (*PerpetualTradingMarketOrderRequest) GetReduceOnly ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetReduceOnly() *bool
func (*PerpetualTradingMarketOrderRequest) GetSide ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetSide() string
func (*PerpetualTradingMarketOrderRequest) GetSize ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetSize() string
func (*PerpetualTradingMarketOrderRequest) GetSlippagePercent ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) GetSlippagePercent() *float64
func (PerpetualTradingMarketOrderRequest) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingMarketOrderRequest) MarshalJSON() ([]byte, error)
func (*PerpetualTradingMarketOrderRequest) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingMarketOrderRequest) UnmarshalJSON(data []byte) error
type PerpetualTradingOpenOrder ¶ added in v0.1.51
type PerpetualTradingOpenOrder struct {
// Asset ticker symbol (xyz prefix stripped)
Asset string `json:"asset"`
// Order side
Side PerpetualTradingOpenOrderSide `json:"side"`
// Limit price
LimitPrice string `json:"limit_price"`
// Order size in contracts
Size string `json:"size"`
// HL order id (oid)
OrderID int64 `json:"order_id"`
// Order timestamp (ms since epoch)
TimeMs int64 `json:"time_ms"`
// True if order can only reduce position
ReduceOnly bool `json:"reduce_only"`
}
PerpetualTradingOpenOrder - A single resting order from HL `openOrders`.
func (*PerpetualTradingOpenOrder) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetAsset() string
func (*PerpetualTradingOpenOrder) GetLimitPrice ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetLimitPrice() string
func (*PerpetualTradingOpenOrder) GetOrderID ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetOrderID() int64
func (*PerpetualTradingOpenOrder) GetReduceOnly ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetReduceOnly() bool
func (*PerpetualTradingOpenOrder) GetSide ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetSide() PerpetualTradingOpenOrderSide
func (*PerpetualTradingOpenOrder) GetSize ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetSize() string
func (*PerpetualTradingOpenOrder) GetTimeMs ¶ added in v0.1.51
func (p *PerpetualTradingOpenOrder) GetTimeMs() int64
type PerpetualTradingOpenOrderSide ¶ added in v0.1.51
type PerpetualTradingOpenOrderSide string
PerpetualTradingOpenOrderSide - Order side
const ( PerpetualTradingOpenOrderSideBuy PerpetualTradingOpenOrderSide = "buy" PerpetualTradingOpenOrderSideSell PerpetualTradingOpenOrderSide = "sell" )
func (*PerpetualTradingOpenOrderSide) IsExact ¶ added in v0.1.51
func (e *PerpetualTradingOpenOrderSide) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (PerpetualTradingOpenOrderSide) ToPointer ¶ added in v0.1.51
func (e PerpetualTradingOpenOrderSide) ToPointer() *PerpetualTradingOpenOrderSide
type PerpetualTradingOpportunitiesResponse ¶ added in v0.1.51
type PerpetualTradingOpportunitiesResponse struct {
// Available perpetual trading markets
Opportunities []PerpetualTradingOpportunity `json:"opportunities"`
}
PerpetualTradingOpportunitiesResponse - List of available perpetual trading markets.
func (*PerpetualTradingOpportunitiesResponse) GetOpportunities ¶ added in v0.1.51
func (p *PerpetualTradingOpportunitiesResponse) GetOpportunities() []PerpetualTradingOpportunity
type PerpetualTradingOpportunity ¶ added in v0.1.51
type PerpetualTradingOpportunity struct {
// Asset ticker symbol (e.g. AAPL, GOLD, EUR)
Asset string `json:"asset"`
// Hyperliquid asset index
AssetID int64 `json:"asset_id"`
// Asset category: stock, commodity, forex
Category string `json:"category"`
// Current mark price
MarkPrice string `json:"mark_price"`
// Oracle reference price
OraclePrice string `json:"oracle_price"`
// Open interest in USD
OpenInterest string `json:"open_interest"`
// 24-hour trading volume in USD
Volume24h string `json:"volume_24h"`
// Current hourly funding rate
FundingRate string `json:"funding_rate"`
// Maximum allowed leverage
MaxLeverage int64 `json:"max_leverage"`
// Size decimal places for order quantities
SzDecimals int64 `json:"sz_decimals"`
}
PerpetualTradingOpportunity - A single perpetual trading market.
func (*PerpetualTradingOpportunity) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetAsset() string
func (*PerpetualTradingOpportunity) GetAssetID ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetAssetID() int64
func (*PerpetualTradingOpportunity) GetCategory ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetCategory() string
func (*PerpetualTradingOpportunity) GetFundingRate ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetFundingRate() string
func (*PerpetualTradingOpportunity) GetMarkPrice ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetMarkPrice() string
func (*PerpetualTradingOpportunity) GetMaxLeverage ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetMaxLeverage() int64
func (*PerpetualTradingOpportunity) GetOpenInterest ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetOpenInterest() string
func (*PerpetualTradingOpportunity) GetOraclePrice ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetOraclePrice() string
func (*PerpetualTradingOpportunity) GetSzDecimals ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetSzDecimals() int64
func (*PerpetualTradingOpportunity) GetVolume24h ¶ added in v0.1.51
func (p *PerpetualTradingOpportunity) GetVolume24h() string
type PerpetualTradingPosition ¶ added in v0.1.51
type PerpetualTradingPosition struct {
// Asset ticker symbol
Asset string `json:"asset"`
// Hyperliquid asset index
AssetID int64 `json:"asset_id"`
// Position side: 'long' or 'short'
Side PerpetualTradingPositionSide `json:"side"`
// Position size in contracts
Size string `json:"size"`
// Average entry price
EntryPrice string `json:"entry_price"`
// Current mark price
MarkPrice string `json:"mark_price"`
// Estimated liquidation price
LiquidationPrice optionalnullable.OptionalNullable[string] `json:"liquidation_price,omitzero"`
// Unrealized PnL in USD
UnrealizedPnl string `json:"unrealized_pnl"`
// Current leverage
Leverage string `json:"leverage"`
// Margin used for this position in USD
MarginUsed string `json:"margin_used"`
// Cumulative funding payments (negative = paid)
FundingAccrued string `json:"funding_accrued"`
}
PerpetualTradingPosition - A single open perpetual futures position.
func (*PerpetualTradingPosition) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetAsset() string
func (*PerpetualTradingPosition) GetAssetID ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetAssetID() int64
func (*PerpetualTradingPosition) GetEntryPrice ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetEntryPrice() string
func (*PerpetualTradingPosition) GetFundingAccrued ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetFundingAccrued() string
func (*PerpetualTradingPosition) GetLeverage ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetLeverage() string
func (*PerpetualTradingPosition) GetLiquidationPrice ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetLiquidationPrice() optionalnullable.OptionalNullable[string]
func (*PerpetualTradingPosition) GetMarginUsed ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetMarginUsed() string
func (*PerpetualTradingPosition) GetMarkPrice ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetMarkPrice() string
func (*PerpetualTradingPosition) GetSide ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetSide() PerpetualTradingPositionSide
func (*PerpetualTradingPosition) GetSize ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetSize() string
func (*PerpetualTradingPosition) GetUnrealizedPnl ¶ added in v0.1.51
func (p *PerpetualTradingPosition) GetUnrealizedPnl() string
type PerpetualTradingPositionSide ¶ added in v0.1.51
type PerpetualTradingPositionSide string
PerpetualTradingPositionSide - Position side: 'long' or 'short'
const ( PerpetualTradingPositionSideLong PerpetualTradingPositionSide = "long" PerpetualTradingPositionSideShort PerpetualTradingPositionSide = "short" )
func (*PerpetualTradingPositionSide) IsExact ¶ added in v0.1.51
func (e *PerpetualTradingPositionSide) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (PerpetualTradingPositionSide) ToPointer ¶ added in v0.1.51
func (e PerpetualTradingPositionSide) ToPointer() *PerpetualTradingPositionSide
type PerpetualTradingPositionsResponse ¶ added in v0.1.51
type PerpetualTradingPositionsResponse struct {
// Open perpetual futures positions
Positions []PerpetualTradingPosition `json:"positions"`
// Total account value in USD (margin + unrealized PnL)
AccountValue *string `json:"account_value,omitzero"`
// Available USDC balance (withdrawable margin)
Withdrawable *string `json:"withdrawable,omitzero"`
}
PerpetualTradingPositionsResponse - List of open perpetual trading positions with account balance.
func (*PerpetualTradingPositionsResponse) GetAccountValue ¶ added in v0.1.51
func (p *PerpetualTradingPositionsResponse) GetAccountValue() *string
func (*PerpetualTradingPositionsResponse) GetPositions ¶ added in v0.1.51
func (p *PerpetualTradingPositionsResponse) GetPositions() []PerpetualTradingPosition
func (*PerpetualTradingPositionsResponse) GetWithdrawable ¶ added in v0.1.51
func (p *PerpetualTradingPositionsResponse) GetWithdrawable() *string
type PerpetualTradingSetLeverageRequest ¶ added in v0.1.51
type PerpetualTradingSetLeverageRequest struct {
// User's EOA address
Owner string `json:"owner"`
// Asset ticker (e.g. 'AAPL', 'CL')
Asset string `json:"asset"`
// Target leverage as a whole-number multiplier. Omit (or pass null) to use the asset's maximum leverage. Must be between 1 and the asset's max leverage, which is available from the /opportunities endpoint.
Leverage optionalnullable.OptionalNullable[int64] `json:"leverage,omitzero"`
}
PerpetualTradingSetLeverageRequest - Request to set leverage on a perpetual trading asset.
Omit “leverage“ (or pass null) to target the asset's maximum leverage.
func (*PerpetualTradingSetLeverageRequest) GetAsset ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageRequest) GetAsset() string
func (*PerpetualTradingSetLeverageRequest) GetLeverage ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageRequest) GetLeverage() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingSetLeverageRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageRequest) GetOwner() string
type PerpetualTradingSetLeverageResponse ¶ added in v0.1.51
type PerpetualTradingSetLeverageResponse struct {
// True if leverage already matches the requested value, false if an update is needed
LeverageOk bool `json:"leverage_ok"`
// EIP-712 typed data for wallet signing, or null if no change is needed
TypedData optionalnullable.OptionalNullable[map[string]any] `json:"typed_data,omitzero"`
// Raw Hyperliquid action (passed back to the execute endpoint), or null
Action optionalnullable.OptionalNullable[map[string]any] `json:"action,omitzero"`
// Timestamp-based nonce, or null if no action needed
Nonce optionalnullable.OptionalNullable[int64] `json:"nonce,omitzero"`
}
PerpetualTradingSetLeverageResponse - Returned by the set_leverage endpoint.
If the asset is already at the requested leverage, typed_data/action/nonce are null. If not, they contain the EIP-712 payload the user must sign.
func (*PerpetualTradingSetLeverageResponse) GetAction ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageResponse) GetAction() optionalnullable.OptionalNullable[map[string]any]
func (*PerpetualTradingSetLeverageResponse) GetLeverageOk ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageResponse) GetLeverageOk() bool
func (*PerpetualTradingSetLeverageResponse) GetNonce ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageResponse) GetNonce() optionalnullable.OptionalNullable[int64]
func (*PerpetualTradingSetLeverageResponse) GetTypedData ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageResponse) GetTypedData() optionalnullable.OptionalNullable[map[string]any]
func (PerpetualTradingSetLeverageResponse) MarshalJSON ¶ added in v0.1.51
func (p PerpetualTradingSetLeverageResponse) MarshalJSON() ([]byte, error)
func (*PerpetualTradingSetLeverageResponse) UnmarshalJSON ¶ added in v0.1.51
func (p *PerpetualTradingSetLeverageResponse) UnmarshalJSON(data []byte) error
type PerpetualTradingSignableActionResponse ¶ added in v0.1.51
type PerpetualTradingSignableActionResponse struct {
// EIP-712 typed data for wallet signing (domain, types, primaryType, message)
TypedData map[string]any `json:"typed_data"`
// Raw Hyperliquid action (passed back to the execute endpoint)
Action map[string]any `json:"action"`
// Timestamp-based nonce used during signing
Nonce int64 `json:"nonce"`
}
PerpetualTradingSignableActionResponse - Returned by prepare endpoints — contains EIP-712 typed data for the user to sign.
func (*PerpetualTradingSignableActionResponse) GetAction ¶ added in v0.1.51
func (p *PerpetualTradingSignableActionResponse) GetAction() map[string]any
func (*PerpetualTradingSignableActionResponse) GetNonce ¶ added in v0.1.51
func (p *PerpetualTradingSignableActionResponse) GetNonce() int64
func (*PerpetualTradingSignableActionResponse) GetTypedData ¶ added in v0.1.51
func (p *PerpetualTradingSignableActionResponse) GetTypedData() map[string]any
type PerpetualTradingWithdrawRequest ¶ added in v0.1.51
type PerpetualTradingWithdrawRequest struct {
// The user's EOA address (owner of the perpetual trading account)
Owner string `json:"owner"`
// USDC amount to withdraw (human-readable, e.g. '500.0')
Amount string `json:"amount"`
// Arbitrum destination address (defaults to owner if not specified)
Destination optionalnullable.OptionalNullable[string] `json:"destination,omitzero"`
}
PerpetualTradingWithdrawRequest - Request to withdraw USDC from HyperEVM perpetual trading account to Arbitrum.
func (*PerpetualTradingWithdrawRequest) GetAmount ¶ added in v0.1.51
func (p *PerpetualTradingWithdrawRequest) GetAmount() string
func (*PerpetualTradingWithdrawRequest) GetDestination ¶ added in v0.1.51
func (p *PerpetualTradingWithdrawRequest) GetDestination() optionalnullable.OptionalNullable[string]
func (*PerpetualTradingWithdrawRequest) GetOwner ¶ added in v0.1.51
func (p *PerpetualTradingWithdrawRequest) GetOwner() string
type PositionPnL ¶
type PositionPnL struct {
// Total assets deposited over all time
TotalDeposited string `json:"total_deposited"`
// Current position value in underlying
CurrentValue string `json:"current_value"`
// current_value - cost_basis_remaining
UnrealizedPnl string `json:"unrealized_pnl"`
// Sum of profits/losses from all withdrawals
RealizedPnl string `json:"realized_pnl"`
// unrealized_pnl + realized_pnl
TotalPnl string `json:"total_pnl"`
// (total_pnl / total_deposited) * 100
TotalPnlPercent string `json:"total_pnl_percent"`
}
PositionPnL - Simplified PnL metrics for API response.
Historical events (deposits/withdrawals) are now at the position level, not inside PnL.
func (*PositionPnL) GetCurrentValue ¶
func (p *PositionPnL) GetCurrentValue() string
func (*PositionPnL) GetRealizedPnl ¶
func (p *PositionPnL) GetRealizedPnl() string
func (*PositionPnL) GetTotalDeposited ¶
func (p *PositionPnL) GetTotalDeposited() string
func (*PositionPnL) GetTotalPnl ¶
func (p *PositionPnL) GetTotalPnl() string
func (*PositionPnL) GetTotalPnlPercent ¶
func (p *PositionPnL) GetTotalPnlPercent() string
func (*PositionPnL) GetUnrealizedPnl ¶
func (p *PositionPnL) GetUnrealizedPnl() string
type PricePoint ¶
type PricePoint struct {
// ISO 8601 UTC timestamp.
Timestamp string `json:"timestamp"`
// Price in USD as a decimal string.
Price string `json:"price"`
}
PricePoint - A single (timestamp, price) sample from a 24h price-history sparkline.
func (*PricePoint) GetPrice ¶
func (p *PricePoint) GetPrice() string
func (*PricePoint) GetTimestamp ¶
func (p *PricePoint) GetTimestamp() string
type Product ¶
type Product string
Product - Which product the gas sponsorship is for. Determines which Product Account (Safe) address to use.
func (*Product) UnmarshalJSON ¶
type Protocol ¶ added in v0.1.31
type Protocol string
Protocol - Lending protocol backing this vault. 'MORPHO' for Morpho vaults, 'EULER' for Euler V2 (EVK) vaults. Both are ERC-4626 and are deposited into / withdrawn from the same way (by `vault_address`, via the Earn `VAULT` venue).
type Quote ¶
type Quote struct {
// A token + amount pair for one leg of the quote.
Input TokenAmount `json:"input"`
// A token + amount pair for one leg of the quote.
Output TokenAmount `json:"output"`
// Aggregate fee charged for the order.
Fee QuoteFee `json:"fee"`
// Estimated upper bound on time-to-fill, in seconds.
EstFillSeconds int64 `json:"est_fill_seconds"`
}
Quote preview returned alongside an order.
func (*Quote) GetEstFillSeconds ¶
func (*Quote) GetInput ¶
func (q *Quote) GetInput() TokenAmount
func (*Quote) GetOutput ¶
func (q *Quote) GetOutput() TokenAmount
type QuoteFee ¶
type QuoteFee struct {
// Total fee in USD as a decimal string.
AmountUsd optionalnullable.OptionalNullable[string] `json:"amount_usd,omitzero"`
// Fee as basis points of the input amount.
Bps optionalnullable.OptionalNullable[int64] `json:"bps,omitzero"`
}
QuoteFee - Aggregate fee charged for the order.
func (*QuoteFee) GetAmountUsd ¶
func (q *QuoteFee) GetAmountUsd() optionalnullable.OptionalNullable[string]
func (*QuoteFee) GetBps ¶
func (q *QuoteFee) GetBps() optionalnullable.OptionalNullable[int64]
type RebalanceDirection ¶ added in v0.1.37
type RebalanceDirection string
RebalanceDirection - What the plan does to one named target.
const ( RebalanceDirectionOpen RebalanceDirection = "open" RebalanceDirectionClose RebalanceDirection = "close" RebalanceDirectionGrow RebalanceDirection = "grow" RebalanceDirectionShrink RebalanceDirection = "shrink" RebalanceDirectionLeverUp RebalanceDirection = "lever_up" RebalanceDirectionLeverDown RebalanceDirection = "lever_down" RebalanceDirectionNoop RebalanceDirection = "noop" )
func (*RebalanceDirection) IsExact ¶ added in v0.1.37
func (e *RebalanceDirection) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (RebalanceDirection) ToPointer ¶ added in v0.1.37
func (e RebalanceDirection) ToPointer() *RebalanceDirection
type RebalanceTarget ¶ added in v0.1.37
type RebalanceTarget struct {
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol *CreditProtocol `json:"protocol,omitzero"`
// Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Token supplied as collateral for this position. For MORPHO it must be the market's collateral token.
CollateralToken string `json:"collateral_token"`
// Token borrowed against the collateral for this position. For MORPHO it must be the market's loan token.
BorrowToken string `json:"borrow_token"`
// SIZE knob: the net value (collateral − debt, in USD) to commit to this position; total collateral ≈ target_equity_usd × target_multiplier. To remove a position use close=true, never target_equity_usd=0.
TargetEquityUsd optionalnullable.OptionalNullable[TargetEquityUsd] `json:"target_equity_usd,omitzero"`
// LEVERAGE knob: total collateral exposure ÷ equity. 1 means unlevered supplied collateral. The protocol maximum is enforced when the plan is built.
TargetMultiplier optionalnullable.OptionalNullable[RebalanceTargetTargetMultiplier] `json:"target_multiplier,omitzero"`
// If true, fully unwind this position: the debt is cleared exactly (accrued interest included) and the pair collateral is returned to the Credit Account.
Close *bool `json:"close,omitzero"`
// Per-target override of the request-level per-swap slippage tolerance in percent.
MaxSlippagePercent optionalnullable.OptionalNullable[RebalanceTargetMaxSlippagePercent] `json:"max_slippage_percent,omitzero"`
}
RebalanceTarget - The desired end-state of ONE position in the Credit Account.
Scoped-declarative: only positions named in “targets“ are touched; anything unlisted is left as-is. Set “close=true“ to fully unwind a position — never “target_equity_usd=0“.
func (*RebalanceTarget) GetBorrowToken ¶ added in v0.1.37
func (r *RebalanceTarget) GetBorrowToken() string
func (*RebalanceTarget) GetClose ¶ added in v0.1.37
func (r *RebalanceTarget) GetClose() *bool
func (*RebalanceTarget) GetCollateralToken ¶ added in v0.1.37
func (r *RebalanceTarget) GetCollateralToken() string
func (*RebalanceTarget) GetMarketID ¶ added in v0.1.37
func (r *RebalanceTarget) GetMarketID() optionalnullable.OptionalNullable[string]
func (*RebalanceTarget) GetMaxSlippagePercent ¶ added in v0.1.37
func (r *RebalanceTarget) GetMaxSlippagePercent() optionalnullable.OptionalNullable[RebalanceTargetMaxSlippagePercent]
func (*RebalanceTarget) GetProtocol ¶ added in v0.1.37
func (r *RebalanceTarget) GetProtocol() *CreditProtocol
func (*RebalanceTarget) GetTargetEquityUsd ¶ added in v0.1.37
func (r *RebalanceTarget) GetTargetEquityUsd() optionalnullable.OptionalNullable[TargetEquityUsd]
func (*RebalanceTarget) GetTargetMultiplier ¶ added in v0.1.37
func (r *RebalanceTarget) GetTargetMultiplier() optionalnullable.OptionalNullable[RebalanceTargetTargetMultiplier]
type RebalanceTargetMaxSlippagePercent ¶ added in v0.1.37
type RebalanceTargetMaxSlippagePercent struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type RebalanceTargetMaxSlippagePercentType
}
RebalanceTargetMaxSlippagePercent - Per-target override of the request-level per-swap slippage tolerance in percent.
func CreateRebalanceTargetMaxSlippagePercentNumber ¶ added in v0.1.37
func CreateRebalanceTargetMaxSlippagePercentNumber(number float64) RebalanceTargetMaxSlippagePercent
func CreateRebalanceTargetMaxSlippagePercentStr ¶ added in v0.1.37
func CreateRebalanceTargetMaxSlippagePercentStr(str string) RebalanceTargetMaxSlippagePercent
func (RebalanceTargetMaxSlippagePercent) MarshalJSON ¶ added in v0.1.37
func (u RebalanceTargetMaxSlippagePercent) MarshalJSON() ([]byte, error)
func (*RebalanceTargetMaxSlippagePercent) UnmarshalJSON ¶ added in v0.1.37
func (u *RebalanceTargetMaxSlippagePercent) UnmarshalJSON(data []byte) error
type RebalanceTargetMaxSlippagePercentType ¶ added in v0.1.37
type RebalanceTargetMaxSlippagePercentType string
const ( RebalanceTargetMaxSlippagePercentTypeNumber RebalanceTargetMaxSlippagePercentType = "number" RebalanceTargetMaxSlippagePercentTypeStr RebalanceTargetMaxSlippagePercentType = "str" )
type RebalanceTargetPreview ¶ added in v0.1.37
type RebalanceTargetPreview struct {
// Which lending protocol a credit action targets.
//
// “AAVE“ is the default so existing callers (which never send a “protocol“
// field) keep hitting the unchanged Aave code path; markets are named by token
// symbol. “MORPHO“ identifies Morpho Blue lending markets by their bytes32
// “market_id“. “EULER“ identifies Euler V2 markets by their EVK
// “collateral_vault“ + “borrow_vault“ addresses and supports isolated
// per-sub-account positions (“sub_account_id“).
//
// Deployment is per chain, so a valid protocol can still 422 on a given chain:
// AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
// chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
// (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
//
// All three support “/v2/credit/loop“ and “/v2/credit/unloop“. EULER does
// NOT: “/v2/credit/rebalance“ rejects it with a 422, and
// “/v2/credit/looped_positions“ covers only AAVE and MORPHO — an Euler loop is
// silently absent there rather than an error, so read it from
// “/v2/credit/positions“ instead. (EULER still appears in the
// “looped_positions“ response enum because this enum is shared; it is never
// emitted.)
Protocol CreditProtocol `json:"protocol"`
// Morpho only: the bytes32 market id of this position.
MarketID optionalnullable.OptionalNullable[string] `json:"market_id,omitzero"`
// Collateral token address (echoes the request target; joins against /v2/credit/looped_positions).
CollateralToken string `json:"collateral_token"`
// Borrow token address (echoes the request target).
BorrowToken string `json:"borrow_token"`
// What the plan does to one named target.
Direction RebalanceDirection `json:"direction"`
// On-chain legs planned for this target (loop + unloop iterations); 0 for a noop.
Legs int64 `json:"legs"`
// Per-iteration unwind breakdown — populated for releasers (close / shrink / lever_down).
UnloopLegs []UnloopLegPreview `json:"unloop_legs,omitzero"`
// Per-iteration loop breakdown — populated for consumers (open / grow / lever_up).
LoopLegs []LoopLegPreview `json:"loop_legs,omitzero"`
// Guaranteed minimum collateral supplied to this position after the rebalance (token units).
ResultingCollateral string `json:"resulting_collateral"`
// Projected debt owed by this position after the rebalance (borrow-token units); 0 on a close.
ResultingDebt string `json:"resulting_debt"`
// Projected leverage of this position after the rebalance; 1 when the debt is cleared. Never promises more leverage (or, when deleveraging, more deleverage) than is guaranteed.
ResultingMultiplier string `json:"resulting_multiplier"`
// Projected health factor of this position after the rebalance. Never overstated at the 1.0 boundary — a liquidatable position is never presented as safe. See health_factor_scope for what it covers.
ResultingHealthFactor string `json:"resulting_health_factor"`
// 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account.
HealthFactorScope RebalanceTargetPreviewHealthFactorScope `json:"health_factor_scope"`
// Upper bound of surplus this target's own swaps can leave in the Credit Account (sum of each swap's quote minus its guaranteed floor). Routing swaps are counted book-level, not here. It accumulates in the Credit Account, is recoverable, and is never lost.
EstimatedMaxDust string `json:"estimated_max_dust"`
}
RebalanceTargetPreview - Projected end state of ONE named target, computed on guaranteed swap floors.
func (*RebalanceTargetPreview) GetBorrowToken ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetBorrowToken() string
func (*RebalanceTargetPreview) GetCollateralToken ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetCollateralToken() string
func (*RebalanceTargetPreview) GetDirection ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetDirection() RebalanceDirection
func (*RebalanceTargetPreview) GetEstimatedMaxDust ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetEstimatedMaxDust() string
func (*RebalanceTargetPreview) GetHealthFactorScope ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetHealthFactorScope() RebalanceTargetPreviewHealthFactorScope
func (*RebalanceTargetPreview) GetLegs ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetLegs() int64
func (*RebalanceTargetPreview) GetLoopLegs ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetLoopLegs() []LoopLegPreview
func (*RebalanceTargetPreview) GetMarketID ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetMarketID() optionalnullable.OptionalNullable[string]
func (*RebalanceTargetPreview) GetProtocol ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetProtocol() CreditProtocol
func (*RebalanceTargetPreview) GetResultingCollateral ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetResultingCollateral() string
func (*RebalanceTargetPreview) GetResultingDebt ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetResultingDebt() string
func (*RebalanceTargetPreview) GetResultingHealthFactor ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetResultingHealthFactor() string
func (*RebalanceTargetPreview) GetResultingMultiplier ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetResultingMultiplier() string
func (*RebalanceTargetPreview) GetUnloopLegs ¶ added in v0.1.37
func (r *RebalanceTargetPreview) GetUnloopLegs() []UnloopLegPreview
func (RebalanceTargetPreview) MarshalJSON ¶ added in v0.1.37
func (r RebalanceTargetPreview) MarshalJSON() ([]byte, error)
func (*RebalanceTargetPreview) UnmarshalJSON ¶ added in v0.1.37
func (r *RebalanceTargetPreview) UnmarshalJSON(data []byte) error
type RebalanceTargetPreviewHealthFactorScope ¶ added in v0.1.37
type RebalanceTargetPreviewHealthFactorScope string
RebalanceTargetPreviewHealthFactorScope - 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account.
const ( RebalanceTargetPreviewHealthFactorScopeMarket RebalanceTargetPreviewHealthFactorScope = "market" RebalanceTargetPreviewHealthFactorScopeAccount RebalanceTargetPreviewHealthFactorScope = "account" )
func (*RebalanceTargetPreviewHealthFactorScope) IsExact ¶ added in v0.1.37
func (e *RebalanceTargetPreviewHealthFactorScope) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (RebalanceTargetPreviewHealthFactorScope) ToPointer ¶ added in v0.1.37
func (e RebalanceTargetPreviewHealthFactorScope) ToPointer() *RebalanceTargetPreviewHealthFactorScope
type RebalanceTargetTargetMultiplier ¶ added in v0.1.37
type RebalanceTargetTargetMultiplier struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type RebalanceTargetTargetMultiplierType
}
RebalanceTargetTargetMultiplier - LEVERAGE knob: total collateral exposure ÷ equity. 1 means unlevered supplied collateral. The protocol maximum is enforced when the plan is built.
func CreateRebalanceTargetTargetMultiplierNumber ¶ added in v0.1.37
func CreateRebalanceTargetTargetMultiplierNumber(number float64) RebalanceTargetTargetMultiplier
func CreateRebalanceTargetTargetMultiplierStr ¶ added in v0.1.37
func CreateRebalanceTargetTargetMultiplierStr(str string) RebalanceTargetTargetMultiplier
func (RebalanceTargetTargetMultiplier) MarshalJSON ¶ added in v0.1.37
func (u RebalanceTargetTargetMultiplier) MarshalJSON() ([]byte, error)
func (*RebalanceTargetTargetMultiplier) UnmarshalJSON ¶ added in v0.1.37
func (u *RebalanceTargetTargetMultiplier) UnmarshalJSON(data []byte) error
type RebalanceTargetTargetMultiplierType ¶ added in v0.1.37
type RebalanceTargetTargetMultiplierType string
const ( RebalanceTargetTargetMultiplierTypeNumber RebalanceTargetTargetMultiplierType = "number" RebalanceTargetTargetMultiplierTypeStr RebalanceTargetTargetMultiplierType = "str" )
type Redemption ¶ added in v0.1.33
type Redemption struct {
// On-chain redemption request id.
ID int64 `json:"id"`
// Lifecycle state: `pending` (awaiting operator settlement), `finalized` (settled — assets paid to the product account), `rejected` (operator declined; shares returned to the account), or `unknown` (an unrecognized on-chain status code — should not occur for the current contract, surfaced defensively instead of erroring).
Status RedemptionStatus `json:"status"`
Shares string `json:"shares"`
// For a `pending` request, the estimated net assets (after the exit fee) it would settle for at the current NAV — a preview, not a guarantee (settlement depends on the operator and the vault's available assets). Null once finalized or rejected.
ExpectedNetAssets optionalnullable.OptionalNullable[string] `json:"expected_net_assets,omitzero"`
// Unix timestamp when the redemption was requested.
RequestedAt int64 `json:"requested_at"`
// Unix timestamp when finalized/rejected; null while pending.
ProcessedAt optionalnullable.OptionalNullable[int64] `json:"processed_at,omitzero"`
}
Redemption - One IXS vault redemption request, reconstructed on-chain.
func (*Redemption) GetExpectedNetAssets ¶ added in v0.1.33
func (r *Redemption) GetExpectedNetAssets() optionalnullable.OptionalNullable[string]
func (*Redemption) GetID ¶ added in v0.1.33
func (r *Redemption) GetID() int64
func (*Redemption) GetProcessedAt ¶ added in v0.1.33
func (r *Redemption) GetProcessedAt() optionalnullable.OptionalNullable[int64]
func (*Redemption) GetRequestedAt ¶ added in v0.1.33
func (r *Redemption) GetRequestedAt() int64
func (*Redemption) GetShares ¶ added in v0.1.33
func (r *Redemption) GetShares() string
func (*Redemption) GetStatus ¶ added in v0.1.33
func (r *Redemption) GetStatus() RedemptionStatus
type RedemptionStatus ¶ added in v0.1.33
type RedemptionStatus string
RedemptionStatus - Lifecycle state: `pending` (awaiting operator settlement), `finalized` (settled — assets paid to the product account), `rejected` (operator declined; shares returned to the account), or `unknown` (an unrecognized on-chain status code — should not occur for the current contract, surfaced defensively instead of erroring).
const ( RedemptionStatusPending RedemptionStatus = "pending" RedemptionStatusFinalized RedemptionStatus = "finalized" RedemptionStatusRejected RedemptionStatus = "rejected" RedemptionStatusUnknown RedemptionStatus = "unknown" )
func (*RedemptionStatus) IsExact ¶ added in v0.1.33
func (e *RedemptionStatus) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (RedemptionStatus) ToPointer ¶ added in v0.1.33
func (e RedemptionStatus) ToPointer() *RedemptionStatus
type RedemptionsResponse ¶ added in v0.1.33
type RedemptionsResponse struct {
// The owner's non-empty redemption requests for the vault, in ascending id order. Empty when the owner has never requested one.
Redemptions []Redemption `json:"redemptions,omitzero"`
}
RedemptionsResponse - An owner's IXS redemption requests for one vault.
func (*RedemptionsResponse) GetRedemptions ¶ added in v0.1.33
func (r *RedemptionsResponse) GetRedemptions() []Redemption
func (RedemptionsResponse) MarshalJSON ¶ added in v0.1.33
func (r RedemptionsResponse) MarshalJSON() ([]byte, error)
func (*RedemptionsResponse) UnmarshalJSON ¶ added in v0.1.33
func (r *RedemptionsResponse) UnmarshalJSON(data []byte) error
type RepayAmount ¶
type RepayAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type RepayAmountType
}
RepayAmount - Amount of repay_token to repay (in token units, not wei).
func CreateRepayAmountNumber ¶
func CreateRepayAmountNumber(number float64) RepayAmount
func CreateRepayAmountStr ¶
func CreateRepayAmountStr(str string) RepayAmount
func (RepayAmount) MarshalJSON ¶
func (u RepayAmount) MarshalJSON() ([]byte, error)
func (*RepayAmount) UnmarshalJSON ¶
func (u *RepayAmount) UnmarshalJSON(data []byte) error
type RepayAmountType ¶
type RepayAmountType string
const ( RepayAmountTypeNumber RepayAmountType = "number" RepayAmountTypeStr RepayAmountType = "str" )
type ReserveInfo ¶ added in v0.1.16
type ReserveInfo struct {
// Underlying token (reserve) contract address on this chain. This is Aave's canonical per-reserve identifier.
Address string `json:"address"`
// Aave aToken contract address on this chain. This is the interest-bearing token that represents the supply position.
ATokenAddress string `json:"a_token_address"`
// Variable rate APY for deposits, in percentage (e.g., 4.5 means 4.5%). This is LENDING interest only — what borrowers pay. For a staked or wrapped asset it is not the whole yield; add `intrinsic_apy`.
SupplyApy string `json:"supply_apy"`
// What holding this asset earns OUTSIDE the lending pool, in percentage: staking rewards or vault yield accruing inside the token's own exchange rate, which the pool neither pays nor observes. A trailing 7-day measurement. ABSENT when no measurement is available (the route omits null fields) — absent does not mean zero. For an asset that plainly earns beyond lending (wstETH, sUSDe, wstHYPE) `supply_apy` alone understates what it earns by percentage points, since almost nobody borrows these and their supply rate rounds to nothing: Hyperlend's wstHYPE reserve pays 0.00006% against a ~2.5% staking yield. Treat an absent value as unknown rather than as the asset earning nothing beyond `supply_apy`.
IntrinsicApy optionalnullable.OptionalNullable[string] `json:"intrinsic_apy,omitzero"`
// Variable rate APY for loans, in percentage (e.g., 6.2 means 6.2%).
BorrowApy string `json:"borrow_apy"`
// Variable rate APY for deposits averaged over the `days` window in the request (default 30 days), in percentage. Computed the same way as the v1 `/v1/aave/avg_rate` endpoint.
SupplyApyAvg string `json:"supply_apy_avg"`
// Variable rate APY for loans averaged over the `days` window in the request (default 30 days), in percentage. Computed the same way as the v1 `/v1/aave/avg_rate` endpoint.
BorrowApyAvg string `json:"borrow_apy_avg"`
// Total amount currently borrowed from this market, in token units (e.g., 1234567.89 USDC).
TotalBorrowed string `json:"total_borrowed"`
// Amount of tokens available to borrow, in token units. Equals total supplied minus total borrowed.
AvailableLiquidity string `json:"available_liquidity"`
// Percentage of supplied tokens that are currently borrowed (e.g., 85.0 means 85%).
UtilizationRate string `json:"utilization_rate"`
// Maximum loan-to-value when this reserve is used as collateral, in percentage (e.g., 80.0 means 80%). This is the highest LTV you can borrow at against this asset; 0 means it cannot be used as collateral.
Ltv string `json:"ltv"`
// Liquidation threshold when this reserve is used as collateral, in percentage (e.g., 82.5 means 82.5%). A position whose LTV crosses this can be liquidated; 0 means the asset cannot be used as collateral.
LiquidationThreshold string `json:"liquidation_threshold"`
}
ReserveInfo - Rate and liquidity information for a single Aave reserve on a chain.
A reserve is identified by its underlying token `address` — Aave's canonical reserve identifier. The same token symbol can map to more than one reserve on a chain (e.g. native USDC and bridged USDC.e on Arbitrum), each with its own rates and liquidity.
func (*ReserveInfo) GetATokenAddress ¶ added in v0.1.16
func (r *ReserveInfo) GetATokenAddress() string
func (*ReserveInfo) GetAddress ¶ added in v0.1.16
func (r *ReserveInfo) GetAddress() string
func (*ReserveInfo) GetAvailableLiquidity ¶ added in v0.1.16
func (r *ReserveInfo) GetAvailableLiquidity() string
func (*ReserveInfo) GetBorrowApy ¶ added in v0.1.16
func (r *ReserveInfo) GetBorrowApy() string
func (*ReserveInfo) GetBorrowApyAvg ¶ added in v0.1.16
func (r *ReserveInfo) GetBorrowApyAvg() string
func (*ReserveInfo) GetIntrinsicApy ¶ added in v0.1.54
func (r *ReserveInfo) GetIntrinsicApy() optionalnullable.OptionalNullable[string]
func (*ReserveInfo) GetLiquidationThreshold ¶ added in v0.1.43
func (r *ReserveInfo) GetLiquidationThreshold() string
func (*ReserveInfo) GetLtv ¶ added in v0.1.43
func (r *ReserveInfo) GetLtv() string
func (*ReserveInfo) GetSupplyApy ¶ added in v0.1.16
func (r *ReserveInfo) GetSupplyApy() string
func (*ReserveInfo) GetSupplyApyAvg ¶ added in v0.1.16
func (r *ReserveInfo) GetSupplyApyAvg() string
func (*ReserveInfo) GetTotalBorrowed ¶ added in v0.1.16
func (r *ReserveInfo) GetTotalBorrowed() string
func (*ReserveInfo) GetUtilizationRate ¶ added in v0.1.16
func (r *ReserveInfo) GetUtilizationRate() string
type RoutingSwapPreview ¶ added in v0.1.37
type RoutingSwapPreview struct {
// Token sold by the Credit Account into this routing swap.
TokenIn string `json:"token_in"`
// Token bought and delivered to fund a consuming position.
TokenOut string `json:"token_out"`
// Token-in amount the Credit Account gives up to this swap.
AmountIn string `json:"amount_in"`
// Guaranteed minimum output (token-out units), enforced on-chain by the swap's minimum-return. Any fill above it stays in the Credit Account as recoverable dust.
MinAmountOut string `json:"min_amount_out"`
}
RoutingSwapPreview - One Phase-B capital-routing swap that moves freed tokens between positions.
Book-level: it is not attributable to a single target.
func (*RoutingSwapPreview) GetAmountIn ¶ added in v0.1.37
func (r *RoutingSwapPreview) GetAmountIn() string
func (*RoutingSwapPreview) GetMinAmountOut ¶ added in v0.1.37
func (r *RoutingSwapPreview) GetMinAmountOut() string
func (*RoutingSwapPreview) GetTokenIn ¶ added in v0.1.37
func (r *RoutingSwapPreview) GetTokenIn() string
func (*RoutingSwapPreview) GetTokenOut ¶ added in v0.1.37
func (r *RoutingSwapPreview) GetTokenOut() string
type SafeMessageEip712Response ¶
type SafeMessageEip712Response struct {
// The EIP-712 domain separator.
Domain CompassAPIBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain `json:"domain"`
// Type definitions for the “SafeMessage“ EIP-712 payload.
Types SafeMessageEip712Types `json:"types"`
// Body of the “SafeMessage“ typed-data — a single “bytes message“.
Message SafeMessageMessage `json:"message"`
// contains filtered or unexported fields
}
SafeMessageEip712Response - “signTypedData“ payload for “SafeMessage(bytes message)“.
func (*SafeMessageEip712Response) GetMessage ¶
func (s *SafeMessageEip712Response) GetMessage() SafeMessageMessage
func (*SafeMessageEip712Response) GetPrimaryType ¶
func (s *SafeMessageEip712Response) GetPrimaryType() string
func (*SafeMessageEip712Response) GetTypes ¶
func (s *SafeMessageEip712Response) GetTypes() SafeMessageEip712Types
func (SafeMessageEip712Response) MarshalJSON ¶
func (s SafeMessageEip712Response) MarshalJSON() ([]byte, error)
func (*SafeMessageEip712Response) UnmarshalJSON ¶
func (s *SafeMessageEip712Response) UnmarshalJSON(data []byte) error
type SafeMessageEip712Types ¶
type SafeMessageEip712Types struct {
// EIP712Domain type definition
Eip712Domain []Eip712DomainField `json:"EIP712Domain"`
// SafeMessage type definition
SafeMessage []SafeMessageField `json:"SafeMessage"`
}
SafeMessageEip712Types - Type definitions for the “SafeMessage“ EIP-712 payload.
func (*SafeMessageEip712Types) GetEip712Domain ¶
func (s *SafeMessageEip712Types) GetEip712Domain() []Eip712DomainField
func (*SafeMessageEip712Types) GetSafeMessage ¶
func (s *SafeMessageEip712Types) GetSafeMessage() []SafeMessageField
type SafeMessageField ¶
SafeMessageField - A field in the “SafeMessage“ type definition.
func (*SafeMessageField) GetName ¶
func (s *SafeMessageField) GetName() string
func (*SafeMessageField) GetType ¶
func (s *SafeMessageField) GetType() string
type SafeMessageMessage ¶
type SafeMessageMessage struct {
// Raw bytes the product account is signing under ERC-1271. For a tokenized-asset order this is the 32-byte order hash.
Message string `json:"message"`
}
SafeMessageMessage - Body of the “SafeMessage“ typed-data — a single “bytes message“.
func (*SafeMessageMessage) GetMessage ¶
func (s *SafeMessageMessage) GetMessage() string
type SafeTxField ¶
SafeTxField - A field in the SafeTx type definition.
func (*SafeTxField) GetName ¶
func (s *SafeTxField) GetName() string
func (*SafeTxField) GetType ¶
func (s *SafeTxField) GetType() string
func (SafeTxField) MarshalJSON ¶
func (s SafeTxField) MarshalJSON() ([]byte, error)
func (*SafeTxField) UnmarshalJSON ¶
func (s *SafeTxField) UnmarshalJSON(data []byte) error
type SafeTxMessage ¶
type SafeTxMessage struct {
// Destination address
To string `json:"to"`
// Value in wei as a string
Value string `json:"value"`
// Transaction data as hex string
Data string `json:"data"`
// Safe operation types.
Operation OperationType `json:"operation"`
// Gas for the transaction
SafeTxGas string `json:"safeTxGas"`
// Base gas costs
BaseGas string `json:"baseGas"`
// Gas price
GasPrice string `json:"gasPrice"`
// Token address for gas payment
GasToken string `json:"gasToken"`
// Address to receive gas refund
RefundReceiver string `json:"refundReceiver"`
// Transaction nonce
Nonce string `json:"nonce"`
}
SafeTxMessage - The message data for the transaction.
func (*SafeTxMessage) GetBaseGas ¶
func (s *SafeTxMessage) GetBaseGas() string
func (*SafeTxMessage) GetData ¶
func (s *SafeTxMessage) GetData() string
func (*SafeTxMessage) GetGasPrice ¶
func (s *SafeTxMessage) GetGasPrice() string
func (*SafeTxMessage) GetGasToken ¶
func (s *SafeTxMessage) GetGasToken() string
func (*SafeTxMessage) GetNonce ¶
func (s *SafeTxMessage) GetNonce() string
func (*SafeTxMessage) GetOperation ¶
func (s *SafeTxMessage) GetOperation() OperationType
func (*SafeTxMessage) GetRefundReceiver ¶
func (s *SafeTxMessage) GetRefundReceiver() string
func (*SafeTxMessage) GetSafeTxGas ¶
func (s *SafeTxMessage) GetSafeTxGas() string
func (*SafeTxMessage) GetTo ¶
func (s *SafeTxMessage) GetTo() string
func (*SafeTxMessage) GetValue ¶
func (s *SafeTxMessage) GetValue() string
func (SafeTxMessage) MarshalJSON ¶
func (s SafeTxMessage) MarshalJSON() ([]byte, error)
func (*SafeTxMessage) UnmarshalJSON ¶
func (s *SafeTxMessage) UnmarshalJSON(data []byte) error
type Section ¶ added in v0.1.3
type Section string
type Security ¶
type Security struct {
APIKeyAuth string `security:"scheme,type=apiKey,subtype=header,name=x-api-key"`
}
func (*Security) GetAPIKeyAuth ¶
type Settlement ¶ added in v0.1.33
type Settlement string
Settlement - How the trade settles. `instant`: the signed transaction completes the trade (Midas/Ondo swaps and IXS deposits). `async`: the transaction only *requests* an IXS redemption, which the vault operator settles off-chain later — poll `poll_endpoint` for status.
const ( SettlementInstant Settlement = "instant" SettlementAsync Settlement = "async" )
func (*Settlement) IsExact ¶ added in v0.1.33
func (e *Settlement) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (Settlement) ToPointer ¶ added in v0.1.33
func (e Settlement) ToPointer() *Settlement
type SponsorGasRequest ¶
type SponsorGasRequest struct {
// The wallet address that owns the Product Account.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// Which product the gas sponsorship is for. Determines which Product Account (Safe) address to use.
Product *Product `json:"product,omitzero"`
// The EIP-712 typed data that was signed.
Eip712 SponsorGasRequestEip712 `json:"eip_712"`
// The EIP-712 signed typed data signature.
Signature string `json:"signature"`
// The address of the wallet which will send the transaction.
Sender string `json:"sender"`
}
func (*SponsorGasRequest) GetChain ¶
func (s *SponsorGasRequest) GetChain() Chain
func (*SponsorGasRequest) GetEip712 ¶
func (s *SponsorGasRequest) GetEip712() SponsorGasRequestEip712
func (*SponsorGasRequest) GetOwner ¶
func (s *SponsorGasRequest) GetOwner() string
func (*SponsorGasRequest) GetProduct ¶
func (s *SponsorGasRequest) GetProduct() *Product
func (*SponsorGasRequest) GetSender ¶
func (s *SponsorGasRequest) GetSender() string
func (*SponsorGasRequest) GetSignature ¶
func (s *SponsorGasRequest) GetSignature() string
type SponsorGasRequestEip712 ¶
type SponsorGasRequestEip712 struct {
BatchedSafeOperationsResponseInput *BatchedSafeOperationsResponseInput `queryParam:"inline" union:"member"`
PermitTypedDataResponseInput *PermitTypedDataResponseInput `queryParam:"inline" union:"member"`
Permit2TypedDataInput *Permit2TypedDataInput `queryParam:"inline" union:"member"`
Type SponsorGasRequestEip712Type
}
SponsorGasRequestEip712 - The EIP-712 typed data that was signed.
func CreateSponsorGasRequestEip712BatchedSafeOperationsResponseInput ¶
func CreateSponsorGasRequestEip712BatchedSafeOperationsResponseInput(batchedSafeOperationsResponseInput BatchedSafeOperationsResponseInput) SponsorGasRequestEip712
func CreateSponsorGasRequestEip712Permit2TypedDataInput ¶
func CreateSponsorGasRequestEip712Permit2TypedDataInput(permit2TypedDataInput Permit2TypedDataInput) SponsorGasRequestEip712
func CreateSponsorGasRequestEip712PermitTypedDataResponseInput ¶
func CreateSponsorGasRequestEip712PermitTypedDataResponseInput(permitTypedDataResponseInput PermitTypedDataResponseInput) SponsorGasRequestEip712
func (SponsorGasRequestEip712) MarshalJSON ¶
func (u SponsorGasRequestEip712) MarshalJSON() ([]byte, error)
func (*SponsorGasRequestEip712) UnmarshalJSON ¶
func (u *SponsorGasRequestEip712) UnmarshalJSON(data []byte) error
type SponsorGasRequestEip712Type ¶
type SponsorGasRequestEip712Type string
const ( SponsorGasRequestEip712TypeBatchedSafeOperationsResponseInput SponsorGasRequestEip712Type = "BatchedSafeOperationsResponse-Input" SponsorGasRequestEip712TypePermitTypedDataResponseInput SponsorGasRequestEip712Type = "PermitTypedDataResponse-Input" SponsorGasRequestEip712TypePermit2TypedDataInput SponsorGasRequestEip712Type = "Permit2TypedData-Input" )
type SponsorGasResponse ¶
type SponsorGasResponse struct {
Transaction UnsignedTransaction `json:"transaction"`
}
func (*SponsorGasResponse) GetTransaction ¶
func (s *SponsorGasResponse) GetTransaction() UnsignedTransaction
type SwapInfo ¶ added in v0.1.34
type SwapInfo struct {
// Token sold in the swap (the borrowed/debt token).
SoldToken string `json:"sold_token"`
// Symbol of the sold token.
SoldSymbol string `json:"sold_symbol"`
// Amount of the sold token.
SoldAmount string `json:"sold_amount"`
// Token bought in the swap (the collateral token).
BoughtToken string `json:"bought_token"`
// Symbol of the bought token.
BoughtSymbol string `json:"bought_symbol"`
// Amount of the bought token.
BoughtAmount string `json:"bought_amount"`
// The outbound counterparty when it is the swap router itself. Null when the swap settled from an executor contract (informational only — never required to detect the swap).
Router optionalnullable.OptionalNullable[string] `json:"router,omitzero"`
}
SwapInfo - The DEX swap leg detected inside a loop transaction.
Evidence is token-filtered and executor-proof: the sold (debt) token left the account to a non-protocol counterparty and the bought (collateral) token arrived from a non-protocol counterparty. Aggregator fills often settle from an executor contract, so the router is recorded only when it happens to be the outbound counterparty — it is never required for detection.
func (*SwapInfo) GetBoughtAmount ¶ added in v0.1.34
func (*SwapInfo) GetBoughtSymbol ¶ added in v0.1.34
func (*SwapInfo) GetBoughtToken ¶ added in v0.1.34
func (*SwapInfo) GetRouter ¶ added in v0.1.34
func (s *SwapInfo) GetRouter() optionalnullable.OptionalNullable[string]
func (*SwapInfo) GetSoldAmount ¶ added in v0.1.34
func (*SwapInfo) GetSoldSymbol ¶ added in v0.1.34
func (*SwapInfo) GetSoldToken ¶ added in v0.1.34
type TargetEquityUsd ¶ added in v0.1.37
type TargetEquityUsd struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type TargetEquityUsdType
}
TargetEquityUsd - SIZE knob: the net value (collateral − debt, in USD) to commit to this position; total collateral ≈ target_equity_usd × target_multiplier. To remove a position use close=true, never target_equity_usd=0.
func CreateTargetEquityUsdNumber ¶ added in v0.1.37
func CreateTargetEquityUsdNumber(number float64) TargetEquityUsd
func CreateTargetEquityUsdStr ¶ added in v0.1.37
func CreateTargetEquityUsdStr(str string) TargetEquityUsd
func (TargetEquityUsd) MarshalJSON ¶ added in v0.1.37
func (u TargetEquityUsd) MarshalJSON() ([]byte, error)
func (*TargetEquityUsd) UnmarshalJSON ¶ added in v0.1.37
func (u *TargetEquityUsd) UnmarshalJSON(data []byte) error
type TargetEquityUsdType ¶ added in v0.1.37
type TargetEquityUsdType string
const ( TargetEquityUsdTypeNumber TargetEquityUsdType = "number" TargetEquityUsdTypeStr TargetEquityUsdType = "str" )
type TokenAmount ¶
type TokenAmount struct {
// On-chain token symbol (e.g. `USDC`, `TSLAon`).
Symbol string `json:"symbol"`
// Ethereum mainnet ERC-20 address.
ContractAddress string `json:"contract_address"`
// Human-readable amount as a decimal string.
Amount string `json:"amount"`
// USD value of `amount`.
AmountUsd optionalnullable.OptionalNullable[string] `json:"amount_usd,omitzero"`
}
TokenAmount - A token + amount pair for one leg of the quote.
func (*TokenAmount) GetAmount ¶
func (t *TokenAmount) GetAmount() string
func (*TokenAmount) GetAmountUsd ¶
func (t *TokenAmount) GetAmountUsd() optionalnullable.OptionalNullable[string]
func (*TokenAmount) GetContractAddress ¶
func (t *TokenAmount) GetContractAddress() string
func (*TokenAmount) GetSymbol ¶
func (t *TokenAmount) GetSymbol() string
type TokenMarketData ¶
type TokenMarketData struct {
// Market data per chain. Keys are chain names (ethereum, base, arbitrum).
Chains map[string]ChainMarketInfo `json:"chains"`
// Information about the chain with the highest supply APY for a token.
MaxSupplyApy MaxSupplyApyInfo `json:"max_supply_apy"`
}
TokenMarketData - Market data for a single token across all chains.
func (*TokenMarketData) GetChains ¶
func (t *TokenMarketData) GetChains() map[string]ChainMarketInfo
func (*TokenMarketData) GetMaxSupplyApy ¶
func (t *TokenMarketData) GetMaxSupplyApy() MaxSupplyApyInfo
type TokenPermissions ¶
type TokenPermissions struct {
// ERC-20 token address
Token string `json:"token"`
// Maximum amount allowed to transfer
Amount int64 `json:"amount"`
}
func (*TokenPermissions) GetAmount ¶
func (t *TokenPermissions) GetAmount() int64
func (*TokenPermissions) GetToken ¶
func (t *TokenPermissions) GetToken() string
func (TokenPermissions) MarshalJSON ¶
func (t TokenPermissions) MarshalJSON() ([]byte, error)
func (*TokenPermissions) UnmarshalJSON ¶
func (t *TokenPermissions) UnmarshalJSON(data []byte) error
type TokenTransfer ¶
type TokenTransfer struct {
// The address tokens were sent from.
FromAddress string `json:"from_address"`
// The address tokens were sent to.
ToAddress string `json:"to_address"`
// The raw transfer amount (in token's smallest unit).
Amount string `json:"amount"`
// The human-readable transfer amount.
AmountFormatted string `json:"amount_formatted"`
// The block number of the transfer.
BlockNumber int64 `json:"block_number"`
// The timestamp of the transfer.
BlockTimestamp time.Time `json:"block_timestamp"`
// The transaction hash of the transfer.
TransactionHash string `json:"transaction_hash"`
// Direction relative to the product account: 'in' for received, 'out' for sent.
Direction Direction `json:"direction"`
}
TokenTransfer - A single ERC20 token transfer event.
func (*TokenTransfer) GetAmount ¶
func (t *TokenTransfer) GetAmount() string
func (*TokenTransfer) GetAmountFormatted ¶
func (t *TokenTransfer) GetAmountFormatted() string
func (*TokenTransfer) GetBlockNumber ¶
func (t *TokenTransfer) GetBlockNumber() int64
func (*TokenTransfer) GetBlockTimestamp ¶
func (t *TokenTransfer) GetBlockTimestamp() time.Time
func (*TokenTransfer) GetDirection ¶
func (t *TokenTransfer) GetDirection() Direction
func (*TokenTransfer) GetFromAddress ¶
func (t *TokenTransfer) GetFromAddress() string
func (*TokenTransfer) GetToAddress ¶
func (t *TokenTransfer) GetToAddress() string
func (*TokenTransfer) GetTransactionHash ¶
func (t *TokenTransfer) GetTransactionHash() string
func (TokenTransfer) MarshalJSON ¶
func (t TokenTransfer) MarshalJSON() ([]byte, error)
func (*TokenTransfer) UnmarshalJSON ¶
func (t *TokenTransfer) UnmarshalJSON(data []byte) error
type TokenizedAssetClass ¶ added in v0.1.17
type TokenizedAssetClass string
TokenizedAssetClass - Asset class of a tokenized asset.
`EQUITY` trades via the order endpoints (build/submit/cancel); the RWA yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`), `MANAGED_VAULT`, and `DERWA` trade via the swap-based `transact/buy` and `transact/sell` endpoints. `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell is an *asynchronous* redemption request settled off-chain by the vault operator. `DERWA` (Centrifuge freely-transferable RWA wrappers) settles each buy/sell as a single instant DEX swap.
`MONEY_MARKET` (WisdomTree Connect digital funds) also uses `transact/buy` and `transact/sell`, but neither swaps nor mints: a buy transfers the settlement stablecoin to the issuer's deposit address and the issuer mints fund shares back at the next NAV cycle, so settlement is *asynchronous*.
const ( TokenizedAssetClassEquity TokenizedAssetClass = "EQUITY" TokenizedAssetClassTBills TokenizedAssetClass = "T_BILLS" TokenizedAssetClassBasisTrade TokenizedAssetClass = "BASIS_TRADE" TokenizedAssetClassBtcYield TokenizedAssetClass = "BTC_YIELD" TokenizedAssetClassManagedVault TokenizedAssetClass = "MANAGED_VAULT" TokenizedAssetClassDerwa TokenizedAssetClass = "DERWA" TokenizedAssetClassMoneyMarket TokenizedAssetClass = "MONEY_MARKET" )
func (*TokenizedAssetClass) IsExact ¶ added in v0.1.17
func (e *TokenizedAssetClass) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (TokenizedAssetClass) ToPointer ¶ added in v0.1.17
func (e TokenizedAssetClass) ToPointer() *TokenizedAssetClass
type TokenizedAssetProvider ¶ added in v0.1.17
type TokenizedAssetProvider string
TokenizedAssetProvider - Issuer/provider of a tokenized asset.
const ( TokenizedAssetProviderOndo TokenizedAssetProvider = "ondo" TokenizedAssetProviderMidas TokenizedAssetProvider = "midas" TokenizedAssetProviderIxs TokenizedAssetProvider = "ixs" TokenizedAssetProviderCentrifuge TokenizedAssetProvider = "centrifuge" TokenizedAssetProviderWisdomtree TokenizedAssetProvider = "wisdomtree" )
func (*TokenizedAssetProvider) IsExact ¶ added in v0.1.17
func (e *TokenizedAssetProvider) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (TokenizedAssetProvider) ToPointer ¶ added in v0.1.17
func (e TokenizedAssetProvider) ToPointer() *TokenizedAssetProvider
type TokenizedAssetsActivityEvent ¶ added in v0.1.23
type TokenizedAssetsActivityEvent struct {
// Kind of activity for this transaction.
EventType TokenizedAssetsActivityEventEventType `json:"event_type"`
// Block the transaction was mined in.
BlockNumber int64 `json:"block_number"`
// Time the transaction was mined.
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash.
TransactionHash string `json:"transaction_hash"`
// Amount sent: USDC for a buy, tokens for a sell/transfer_out.
InputAmount optionalnullable.OptionalNullable[string] `json:"input_amount,omitzero"`
// Symbol of the sent leg, or `null` for a transfer_in.
InputSymbol optionalnullable.OptionalNullable[string] `json:"input_symbol,omitzero"`
// Amount received: tokens for a buy/transfer_in, USDC for a sell.
OutputAmount optionalnullable.OptionalNullable[string] `json:"output_amount,omitzero"`
// Symbol of the received leg, or `null` for a transfer_out.
OutputSymbol optionalnullable.OptionalNullable[string] `json:"output_symbol,omitzero"`
// Cost basis per token at buy time; `null` for non-buys.
CostPerUnit optionalnullable.OptionalNullable[string] `json:"cost_per_unit,omitzero"`
// Realized profit/loss on a sell; `null` for non-sells.
RealizedPnl optionalnullable.OptionalNullable[string] `json:"realized_pnl,omitzero"`
}
TokenizedAssetsActivityEvent - One classified activity event on a tokenized-asset position.
Mirrors Earn's deposit/withdrawal event shape (generic “input“/“output“ legs) with an “event_type“ discriminator, so buys, sells and transfers share one chronological feed. A “buy“ has “input“ = USDC paid and “output“ = tokens received (“cost_per_unit“ = USDC/token); a “sell“ is the reverse and carries “realized_pnl“; a “transfer_in“/“transfer_out“ carries only the token leg, so the opposite side is “null“. All amounts are decimal strings. Pure-USDC funding movements are not position activity — they appear on the balances endpoint.
func (*TokenizedAssetsActivityEvent) GetBlockNumber ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetBlockNumber() int64
func (*TokenizedAssetsActivityEvent) GetBlockTimestamp ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetBlockTimestamp() time.Time
func (*TokenizedAssetsActivityEvent) GetCostPerUnit ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetCostPerUnit() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetEventType ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetEventType() TokenizedAssetsActivityEventEventType
func (*TokenizedAssetsActivityEvent) GetInputAmount ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetInputAmount() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetInputSymbol ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetInputSymbol() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetOutputAmount ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetOutputAmount() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetOutputSymbol ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetOutputSymbol() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetRealizedPnl ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetRealizedPnl() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsActivityEvent) GetTransactionHash ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) GetTransactionHash() string
func (TokenizedAssetsActivityEvent) MarshalJSON ¶ added in v0.1.23
func (t TokenizedAssetsActivityEvent) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsActivityEvent) UnmarshalJSON ¶ added in v0.1.23
func (t *TokenizedAssetsActivityEvent) UnmarshalJSON(data []byte) error
type TokenizedAssetsActivityEventEventType ¶ added in v0.1.23
type TokenizedAssetsActivityEventEventType string
TokenizedAssetsActivityEventEventType - Kind of activity for this transaction.
const ( TokenizedAssetsActivityEventEventTypeBuy TokenizedAssetsActivityEventEventType = "buy" TokenizedAssetsActivityEventEventTypeSell TokenizedAssetsActivityEventEventType = "sell" TokenizedAssetsActivityEventEventTypeTransferIn TokenizedAssetsActivityEventEventType = "transfer_in" TokenizedAssetsActivityEventEventTypeTransferOut TokenizedAssetsActivityEventEventType = "transfer_out" )
func (*TokenizedAssetsActivityEventEventType) IsExact ¶ added in v0.1.23
func (e *TokenizedAssetsActivityEventEventType) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (TokenizedAssetsActivityEventEventType) ToPointer ¶ added in v0.1.23
func (e TokenizedAssetsActivityEventEventType) ToPointer() *TokenizedAssetsActivityEventEventType
type TokenizedAssetsBalancesResponse ¶ added in v0.1.23
type TokenizedAssetsBalancesResponse struct {
// The derived Tokenized Assets Account address.
TokenizedAssetsAccountAddress string `json:"tokenized_assets_account_address"`
// Token balances keyed by symbol. Each entry includes the current balance, its USD value, and transfer history. Symbols are not unique on-chain: when two tokens collide, each key becomes 'SYMBOL (0xAddress)' — match on token_address for exactness.
Balances map[string]CompassAPIBackendV2ModelsBalancesTokenBalance `json:"balances,omitzero"`
// Total USD value of all priced balances.
TotalUsdValue optionalnullable.OptionalNullable[string] `json:"total_usd_value,omitzero"`
}
TokenizedAssetsBalancesResponse - Token balances and transfer history for a Tokenized Assets Account.
Each token held in the account is keyed by symbol with its current balance, USD value, and transfer history. Uses the same `TokenBalance`/`TokenTransfer` shape as the earn and credit balances endpoints.
func (*TokenizedAssetsBalancesResponse) GetBalances ¶ added in v0.1.23
func (t *TokenizedAssetsBalancesResponse) GetBalances() map[string]CompassAPIBackendV2ModelsBalancesTokenBalance
func (*TokenizedAssetsBalancesResponse) GetTokenizedAssetsAccountAddress ¶ added in v0.1.23
func (t *TokenizedAssetsBalancesResponse) GetTokenizedAssetsAccountAddress() string
func (*TokenizedAssetsBalancesResponse) GetTotalUsdValue ¶ added in v0.1.23
func (t *TokenizedAssetsBalancesResponse) GetTotalUsdValue() optionalnullable.OptionalNullable[string]
func (TokenizedAssetsBalancesResponse) MarshalJSON ¶ added in v0.1.23
func (t TokenizedAssetsBalancesResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsBalancesResponse) UnmarshalJSON ¶ added in v0.1.23
func (t *TokenizedAssetsBalancesResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsBuildOrderRequest ¶
type TokenizedAssetsBuildOrderRequest struct {
// Token the sender is paying. Either an on-chain symbol (e.g. `TSLAon`), the literal `USDC`, or a 0x-prefixed token address.
FromToken string `json:"from_token"`
// Token the sender is receiving. Same accepted forms as `from_token`.
ToToken string `json:"to_token"`
// Human-readable amount of `from_token` to swap (decimal string). Decimals are applied server-side.
Amount string `json:"amount"`
// Wallet that owns the Tokenized Assets Account. The product account address is derived deterministically from this owner. The owner signs the EIP-712 payloads returned by this endpoint (the optional approval and the order itself).
Owner string `json:"owner"`
// Max acceptable slippage in basis points (1 bp = 0.01%). Range 1-5000 (0.01%-50%); defaults to 50 (0.5%). The upper bound is intentionally wide so callers can clear the wide auction floors quoted for thinly-traded tokenized stocks.
SlippageBps *int64 `json:"slippage_bps,omitzero"`
}
TokenizedAssetsBuildOrderRequest - Build a buy or sell order for a tokenized equity.
func (*TokenizedAssetsBuildOrderRequest) GetAmount ¶
func (t *TokenizedAssetsBuildOrderRequest) GetAmount() string
func (*TokenizedAssetsBuildOrderRequest) GetFromToken ¶
func (t *TokenizedAssetsBuildOrderRequest) GetFromToken() string
func (*TokenizedAssetsBuildOrderRequest) GetOwner ¶
func (t *TokenizedAssetsBuildOrderRequest) GetOwner() string
func (*TokenizedAssetsBuildOrderRequest) GetSlippageBps ¶
func (t *TokenizedAssetsBuildOrderRequest) GetSlippageBps() *int64
func (*TokenizedAssetsBuildOrderRequest) GetToToken ¶
func (t *TokenizedAssetsBuildOrderRequest) GetToToken() string
type TokenizedAssetsBuildOrderResponse ¶
type TokenizedAssetsBuildOrderResponse struct {
// Quote preview returned alongside an order.
Quote Quote `json:"quote"`
// EIP-712 payload that authorizes a one-time max-approve of `from_token` to the settlement contract. Populated when the Tokenized Assets Account's existing allowance is below `amount`. The owner signs it, then it is broadcast via `POST /v2/gas_sponsorship/prepare` (or directly by the owner) to set the allowance on-chain. `null` when the allowance is already sufficient.
ApprovalSafeTxEip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"approval_safe_tx_eip712,omitzero"`
// Order metadata plus the EIP-712 payload the owner signs to authorize it.
//
// The owner signs “safe_message_eip712“ off-chain. At submit time the
// signature is sent back to “/order/submit“ together with
// “order_message“, “extension“, and “quote_id“; the signature is
// validated against the Tokenized Assets Account at fill time.
Order OrderToSign `json:"order"`
}
TokenizedAssetsBuildOrderResponse - Quote, optional approval payload, and the EIP-712 order to sign.
func (*TokenizedAssetsBuildOrderResponse) GetApprovalSafeTxEip712 ¶
func (t *TokenizedAssetsBuildOrderResponse) GetApprovalSafeTxEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*TokenizedAssetsBuildOrderResponse) GetOrder ¶
func (t *TokenizedAssetsBuildOrderResponse) GetOrder() OrderToSign
func (*TokenizedAssetsBuildOrderResponse) GetQuote ¶
func (t *TokenizedAssetsBuildOrderResponse) GetQuote() Quote
func (TokenizedAssetsBuildOrderResponse) MarshalJSON ¶
func (t TokenizedAssetsBuildOrderResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsBuildOrderResponse) UnmarshalJSON ¶
func (t *TokenizedAssetsBuildOrderResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsCancelOrderRequest ¶
type TokenizedAssetsCancelOrderRequest struct {
// Wallet that owns the Tokenized Assets Account. The account address derived from this owner must match the order's on-chain maker; the API rejects otherwise (only the order's maker can cancel it).
Owner string `json:"owner"`
}
func (*TokenizedAssetsCancelOrderRequest) GetOwner ¶
func (t *TokenizedAssetsCancelOrderRequest) GetOwner() string
type TokenizedAssetsCancelOrderResponse ¶
type TokenizedAssetsCancelOrderResponse struct {
// Response containing EIP-712 typed data for Safe transaction signing.
CancelSafeTxEip712 BatchedSafeOperationsResponseOutput `json:"cancel_safe_tx_eip712"`
}
func (*TokenizedAssetsCancelOrderResponse) GetCancelSafeTxEip712 ¶
func (t *TokenizedAssetsCancelOrderResponse) GetCancelSafeTxEip712() BatchedSafeOperationsResponseOutput
type TokenizedAssetsChargeFeeRequest ¶ added in v0.1.24
type TokenizedAssetsChargeFeeRequest struct {
// The owner's wallet address; the product account is derived from it.
Owner string `json:"owner"`
// Fee configuration for tokenized-asset trades.
//
// Same shape as `Fee`, but narrows `denomination` to the values supported by
// tokenized-asset trades. PERFORMANCE is not supported because realized-profit
// fees are not computed for spot buy/sell trades.
Fee TokenizedAssetsFee `json:"fee"`
// When true, returns an EIP-712 payload for gas-sponsored execution instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
}
TokenizedAssetsChargeFeeRequest - Charge a partner fee on the USDC proceeds of a filled sell order.
Equity orders fill off-chain via a third-party venue, so the fee can't ride inside the trade (unlike Midas/earn/credit). After the sell order fills, call this with the order hash to build a USDC `transfer(recipient, fee)` executed by the product account.
func (*TokenizedAssetsChargeFeeRequest) GetFee ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeRequest) GetFee() TokenizedAssetsFee
func (*TokenizedAssetsChargeFeeRequest) GetGasSponsorship ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeRequest) GetGasSponsorship() *bool
func (*TokenizedAssetsChargeFeeRequest) GetOwner ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeRequest) GetOwner() string
type TokenizedAssetsChargeFeeResponse ¶ added in v0.1.24
type TokenizedAssetsChargeFeeResponse struct {
// Unsigned transaction transferring the fee from the product account.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 payload for gas-sponsored execution.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Fee charged, in USDC.
FeeAmount string `json:"fee_amount"`
// Filled USDC proceeds the fee was computed on.
Proceeds string `json:"proceeds"`
}
TokenizedAssetsChargeFeeResponse - Unsigned USDC fee transfer for the owner to sign.
Exactly one of `transaction` (gas_sponsorship=false) or `eip_712` (gas_sponsorship=true) is set.
func (*TokenizedAssetsChargeFeeResponse) GetEip712 ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*TokenizedAssetsChargeFeeResponse) GetFeeAmount ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeResponse) GetFeeAmount() string
func (*TokenizedAssetsChargeFeeResponse) GetProceeds ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeResponse) GetProceeds() string
func (*TokenizedAssetsChargeFeeResponse) GetTransaction ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (TokenizedAssetsChargeFeeResponse) MarshalJSON ¶ added in v0.1.24
func (t TokenizedAssetsChargeFeeResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsChargeFeeResponse) UnmarshalJSON ¶ added in v0.1.24
func (t *TokenizedAssetsChargeFeeResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsFee ¶ added in v0.1.24
type TokenizedAssetsFee struct {
// The wallet address that will receive the fee.
Recipient string `json:"recipient"`
// The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
Amount TokenizedAssetsFeeAmount `json:"amount"`
// The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the trade proceeds), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
Denomination *TokenizedAssetsFeeDenomination `json:"denomination,omitzero"`
}
TokenizedAssetsFee - Fee configuration for tokenized-asset trades.
Same shape as `Fee`, but narrows `denomination` to the values supported by tokenized-asset trades. PERFORMANCE is not supported because realized-profit fees are not computed for spot buy/sell trades.
func (*TokenizedAssetsFee) GetAmount ¶ added in v0.1.24
func (t *TokenizedAssetsFee) GetAmount() TokenizedAssetsFeeAmount
func (*TokenizedAssetsFee) GetDenomination ¶ added in v0.1.24
func (t *TokenizedAssetsFee) GetDenomination() *TokenizedAssetsFeeDenomination
func (*TokenizedAssetsFee) GetRecipient ¶ added in v0.1.24
func (t *TokenizedAssetsFee) GetRecipient() string
type TokenizedAssetsFeeAmount ¶ added in v0.1.24
type TokenizedAssetsFeeAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type TokenizedAssetsFeeAmountType
}
TokenizedAssetsFeeAmount - The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
func CreateTokenizedAssetsFeeAmountNumber ¶ added in v0.1.24
func CreateTokenizedAssetsFeeAmountNumber(number float64) TokenizedAssetsFeeAmount
func CreateTokenizedAssetsFeeAmountStr ¶ added in v0.1.24
func CreateTokenizedAssetsFeeAmountStr(str string) TokenizedAssetsFeeAmount
func (TokenizedAssetsFeeAmount) MarshalJSON ¶ added in v0.1.24
func (u TokenizedAssetsFeeAmount) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsFeeAmount) UnmarshalJSON ¶ added in v0.1.24
func (u *TokenizedAssetsFeeAmount) UnmarshalJSON(data []byte) error
type TokenizedAssetsFeeAmountType ¶ added in v0.1.24
type TokenizedAssetsFeeAmountType string
const ( TokenizedAssetsFeeAmountTypeNumber TokenizedAssetsFeeAmountType = "number" TokenizedAssetsFeeAmountTypeStr TokenizedAssetsFeeAmountType = "str" )
type TokenizedAssetsFeeDenomination ¶ added in v0.1.24
type TokenizedAssetsFeeDenomination string
TokenizedAssetsFeeDenomination - The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the trade proceeds), or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
const ( TokenizedAssetsFeeDenominationPercentage TokenizedAssetsFeeDenomination = "PERCENTAGE" TokenizedAssetsFeeDenominationFixed TokenizedAssetsFeeDenomination = "FIXED" )
func (TokenizedAssetsFeeDenomination) ToPointer ¶ added in v0.1.24
func (e TokenizedAssetsFeeDenomination) ToPointer() *TokenizedAssetsFeeDenomination
func (*TokenizedAssetsFeeDenomination) UnmarshalJSON ¶ added in v0.1.24
func (e *TokenizedAssetsFeeDenomination) UnmarshalJSON(data []byte) error
type TokenizedAssetsMarketsListResponse ¶
type TokenizedAssetsMarketsListResponse struct {
// Tokenized equity markets surfaced on Ethereum.
Markets []CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket `json:"markets"`
}
TokenizedAssetsMarketsListResponse - List of tokenized equity markets.
func (*TokenizedAssetsMarketsListResponse) GetMarkets ¶
func (t *TokenizedAssetsMarketsListResponse) GetMarkets() []CompassAPIBackendV2ModelsTokenizedAssetsMarketMarket
type TokenizedAssetsOhlcInterval ¶
type TokenizedAssetsOhlcInterval string
const ( TokenizedAssetsOhlcIntervalOnemin TokenizedAssetsOhlcInterval = "1min" TokenizedAssetsOhlcIntervalFivemin TokenizedAssetsOhlcInterval = "5min" TokenizedAssetsOhlcIntervalFifteenmin TokenizedAssetsOhlcInterval = "15min" TokenizedAssetsOhlcIntervalOnehour TokenizedAssetsOhlcInterval = "1hour" TokenizedAssetsOhlcIntervalFourhour TokenizedAssetsOhlcInterval = "4hour" TokenizedAssetsOhlcIntervalTwelvehour TokenizedAssetsOhlcInterval = "12hour" TokenizedAssetsOhlcIntervalOneday TokenizedAssetsOhlcInterval = "1day" )
func (TokenizedAssetsOhlcInterval) ToPointer ¶
func (e TokenizedAssetsOhlcInterval) ToPointer() *TokenizedAssetsOhlcInterval
func (*TokenizedAssetsOhlcInterval) UnmarshalJSON ¶
func (e *TokenizedAssetsOhlcInterval) UnmarshalJSON(data []byte) error
type TokenizedAssetsOhlcRange ¶
type TokenizedAssetsOhlcRange string
const ( TokenizedAssetsOhlcRangeOneday TokenizedAssetsOhlcRange = "1day" TokenizedAssetsOhlcRangeOnemonth TokenizedAssetsOhlcRange = "1month" TokenizedAssetsOhlcRangeThreemonth TokenizedAssetsOhlcRange = "3month" TokenizedAssetsOhlcRangeSixmonth TokenizedAssetsOhlcRange = "6month" TokenizedAssetsOhlcRangeOneyear TokenizedAssetsOhlcRange = "1year" TokenizedAssetsOhlcRangeAll TokenizedAssetsOhlcRange = "all" )
func (TokenizedAssetsOhlcRange) ToPointer ¶
func (e TokenizedAssetsOhlcRange) ToPointer() *TokenizedAssetsOhlcRange
func (*TokenizedAssetsOhlcRange) UnmarshalJSON ¶
func (e *TokenizedAssetsOhlcRange) UnmarshalJSON(data []byte) error
type TokenizedAssetsPnl ¶ added in v0.1.21
type TokenizedAssetsPnl struct {
// Total USDC paid for this position over all time.
TotalDeposited string `json:"total_deposited"`
// Current USD value of the held balance (`balance * current_price_usd`).
CurrentValue string `json:"current_value"`
// `current_value` minus the remaining cost basis.
UnrealizedPnl string `json:"unrealized_pnl"`
// Realized profit/loss banked from past sales.
RealizedPnl string `json:"realized_pnl"`
// `unrealized_pnl + realized_pnl`.
TotalPnl string `json:"total_pnl"`
// `(total_pnl / total_deposited) * 100`.
TotalPnlPercent string `json:"total_pnl_percent"`
}
TokenizedAssetsPnl - Realized + unrealized PnL for a tokenized-asset position.
Mirrors Earn's “pnl“ shape so SDK/widget reuse is trivial. Cost basis is the USDC paid for the position through its product account; “current_value“ marks the held balance to the current price. All amounts are USD decimal strings; “total_pnl_percent“ is a percentage (also a decimal string).
func (*TokenizedAssetsPnl) GetCurrentValue ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetCurrentValue() string
func (*TokenizedAssetsPnl) GetRealizedPnl ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetRealizedPnl() string
func (*TokenizedAssetsPnl) GetTotalDeposited ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetTotalDeposited() string
func (*TokenizedAssetsPnl) GetTotalPnl ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetTotalPnl() string
func (*TokenizedAssetsPnl) GetTotalPnlPercent ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetTotalPnlPercent() string
func (*TokenizedAssetsPnl) GetUnrealizedPnl ¶ added in v0.1.21
func (t *TokenizedAssetsPnl) GetUnrealizedPnl() string
type TokenizedAssetsPositionsResponse ¶
type TokenizedAssetsPositionsResponse struct {
// Owner address from the request. Balances are read from the Tokenized Assets Account address derived from this owner.
Owner string `json:"owner"`
// Non-zero positions only; tokens with a zero balance are omitted.
Positions []CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition `json:"positions,omitzero"`
// Sum of `balance_usd` across positions where the price is known.
TotalUsd string `json:"total_usd"`
// Account-level PnL summed across positions that have a known PnL; `null` when no position can be priced.
Pnl optionalnullable.OptionalNullable[TokenizedAssetsPnl] `json:"pnl,omitzero"`
}
TokenizedAssetsPositionsResponse - On-chain tokenized-equity holdings for an owner's Tokenized Assets Account.
func (*TokenizedAssetsPositionsResponse) GetOwner ¶ added in v0.1.8
func (t *TokenizedAssetsPositionsResponse) GetOwner() string
func (*TokenizedAssetsPositionsResponse) GetPnl ¶ added in v0.1.21
func (t *TokenizedAssetsPositionsResponse) GetPnl() optionalnullable.OptionalNullable[TokenizedAssetsPnl]
func (*TokenizedAssetsPositionsResponse) GetPositions ¶
func (t *TokenizedAssetsPositionsResponse) GetPositions() []CompassAPIBackendV2ModelsTokenizedAssetsReadResponsePositionsPosition
func (*TokenizedAssetsPositionsResponse) GetTotalUsd ¶
func (t *TokenizedAssetsPositionsResponse) GetTotalUsd() string
func (TokenizedAssetsPositionsResponse) MarshalJSON ¶
func (t TokenizedAssetsPositionsResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsPositionsResponse) UnmarshalJSON ¶
func (t *TokenizedAssetsPositionsResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsQuoteRequest ¶
type TokenizedAssetsQuoteRequest struct {
// Token the sender is paying. Either an on-chain symbol (e.g. `TSLAon`), the literal `USDC`, or a 0x-prefixed token address.
FromToken string `json:"from_token"`
// Token the sender is receiving. Same accepted forms as `from_token`.
ToToken string `json:"to_token"`
// Human-readable amount of `from_token` to swap (decimal string). Decimals are applied server-side.
Amount string `json:"amount"`
// Wallet that owns the Tokenized Assets Account. Used to verify the account is deployed before quoting; the account address is derived deterministically from this owner.
Owner string `json:"owner"`
}
TokenizedAssetsQuoteRequest - Preview a buy or sell quote for a tokenized equity.
Read-only: this previews a quote without consuming a “quote_id“ or committing an order. Use it to surface expected output, fees, and a thin-liquidity warning before the user confirms; pass the same body (plus “slippage_bps“) to “POST /tokenized_assets/order“ when they do.
func (*TokenizedAssetsQuoteRequest) GetAmount ¶
func (t *TokenizedAssetsQuoteRequest) GetAmount() string
func (*TokenizedAssetsQuoteRequest) GetFromToken ¶
func (t *TokenizedAssetsQuoteRequest) GetFromToken() string
func (*TokenizedAssetsQuoteRequest) GetOwner ¶
func (t *TokenizedAssetsQuoteRequest) GetOwner() string
func (*TokenizedAssetsQuoteRequest) GetToToken ¶
func (t *TokenizedAssetsQuoteRequest) GetToToken() string
type TokenizedAssetsQuoteResponse ¶
type TokenizedAssetsQuoteResponse struct {
// Quote preview returned alongside an order.
Quote Quote `json:"quote"`
// Slippage tolerance in basis points (1 bp = 0.01%) the UI should echo back as `slippage_bps` on `POST /tokenized_assets/order`. Derived from the on-chain auction range (`auctionEndAmount` vs `toTokenAmount`) plus a small buffer; capped at 5000 bps.
RecommendedSlippageBps int64 `json:"recommended_slippage_bps"`
// Worst-case basis-points gap between the auction's end amount and the reference quote amount. Surfaces as a thin-liquidity warning before the user signs.
AuctionRangeBps int64 `json:"auction_range_bps"`
}
TokenizedAssetsQuoteResponse - Preview of input/output amounts plus auction-derived risk hints.
func (*TokenizedAssetsQuoteResponse) GetAuctionRangeBps ¶
func (t *TokenizedAssetsQuoteResponse) GetAuctionRangeBps() int64
func (*TokenizedAssetsQuoteResponse) GetQuote ¶
func (t *TokenizedAssetsQuoteResponse) GetQuote() Quote
func (*TokenizedAssetsQuoteResponse) GetRecommendedSlippageBps ¶
func (t *TokenizedAssetsQuoteResponse) GetRecommendedSlippageBps() int64
type TokenizedAssetsSubmitOrderRequest ¶
type TokenizedAssetsSubmitOrderRequest struct {
// The order struct returned by `/order` (`order.order_message`). `maker` is the Tokenized Assets Account, not the owner's wallet — pass this dict back to the API verbatim.
SignedOrder map[string]any `json:"signed_order"`
// Owner's EIP-712 signature over `order.safe_message_eip712` from the `/order` response. The signature is validated against the Tokenized Equities Account at fill time, so it must be a signature over the typed-data hash, not the raw order hash.
Signature string `json:"signature"`
// Opaque hex blob from the `/order` response — pass back unchanged.
Extension string `json:"extension"`
// `order.quote_id` from the `/order` response — pass back unchanged.
QuoteID string `json:"quote_id"`
// `order.order_hash` from the `/order` response. Optional but recommended: the upstream relayer occasionally returns a 2xx with an empty body, and supplying the hash lets the API still return a usable handle for status and cancel lookups instead of failing.
OrderHash optionalnullable.OptionalNullable[string] `json:"order_hash,omitzero"`
}
TokenizedAssetsSubmitOrderRequest - Submit an owner-signed order for settlement.
The shape echoes what `POST /order` returned plus the owner's EIP-712 signature. The maker is the Tokenized Assets Account, so the signature is validated against the product account at fill time.
func (*TokenizedAssetsSubmitOrderRequest) GetExtension ¶
func (t *TokenizedAssetsSubmitOrderRequest) GetExtension() string
func (*TokenizedAssetsSubmitOrderRequest) GetOrderHash ¶
func (t *TokenizedAssetsSubmitOrderRequest) GetOrderHash() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsSubmitOrderRequest) GetQuoteID ¶
func (t *TokenizedAssetsSubmitOrderRequest) GetQuoteID() string
func (*TokenizedAssetsSubmitOrderRequest) GetSignature ¶
func (t *TokenizedAssetsSubmitOrderRequest) GetSignature() string
func (*TokenizedAssetsSubmitOrderRequest) GetSignedOrder ¶
func (t *TokenizedAssetsSubmitOrderRequest) GetSignedOrder() map[string]any
type TokenizedAssetsSubmitOrderResponse ¶
type TokenizedAssetsSubmitOrderResponse struct {
// On-chain order hash for status / cancel lookups.
OrderHash string `json:"order_hash"`
// Server-side ISO 8601 UTC timestamp at which the order was relayed.
SubmittedAt string `json:"submitted_at"`
}
TokenizedAssetsSubmitOrderResponse - Returned after the signed order is submitted for settlement.
func (*TokenizedAssetsSubmitOrderResponse) GetOrderHash ¶
func (t *TokenizedAssetsSubmitOrderResponse) GetOrderHash() string
func (*TokenizedAssetsSubmitOrderResponse) GetSubmittedAt ¶
func (t *TokenizedAssetsSubmitOrderResponse) GetSubmittedAt() string
type TokenizedAssetsTradeRequest ¶ added in v0.1.17
type TokenizedAssetsTradeRequest struct {
// Token to spend. For a buy this must be a stablecoin the Midas issuance vault accepts (USDC on every supported network; mBASIS also accepts USDT/DAI on Ethereum). For a sell it is the Midas RWA asset to redeem (e.g. 'mTBILL').
TokenIn string `json:"token_in"`
// Token to receive. For a buy this is the Midas RWA asset to mint (e.g. 'mTBILL'); for a sell it is the payout stablecoin (USDC).
TokenOut string `json:"token_out"`
// Human-readable amount of `token_in` to trade (token units, not wei).
AmountIn TokenizedAssetsTradeRequestAmountIn `json:"amount_in"`
// Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
Slippage *TokenizedAssetsTradeRequestSlippage `json:"slippage,omitzero"`
// The owner's wallet address.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// When true, returns an EIP-712 payload for gas-sponsored execution instead of an unsigned transaction.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// WisdomTree Connect API credentials, required only when trading a WisdomTree money-market fund. Each organization authenticates with its own credentials, which are exchanged for a short-lived token to look up the settlement wallet for this trade. They are never stored and are masked in logs.
Wisdomtree optionalnullable.OptionalNullable[WisdomTreeCredentials] `json:"wisdomtree,omitzero"`
// Optional partner fee charged when selling (exiting). It is taken from the payout-token (USDC) proceeds and sent to your fee recipient inside the same execution.
Fee optionalnullable.OptionalNullable[TokenizedAssetsFee] `json:"fee,omitzero"`
}
TokenizedAssetsTradeRequest - Buy or sell a swap-traded tokenized asset inside the product account.
Applies to RWA yield assets (Midas mTokens). Equities trade via the order endpoints instead.
func (*TokenizedAssetsTradeRequest) GetAmountIn ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetAmountIn() TokenizedAssetsTradeRequestAmountIn
func (*TokenizedAssetsTradeRequest) GetChain ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetChain() Chain
func (*TokenizedAssetsTradeRequest) GetFee ¶ added in v0.1.24
func (t *TokenizedAssetsTradeRequest) GetFee() optionalnullable.OptionalNullable[TokenizedAssetsFee]
func (*TokenizedAssetsTradeRequest) GetGasSponsorship ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetGasSponsorship() *bool
func (*TokenizedAssetsTradeRequest) GetOwner ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetOwner() string
func (*TokenizedAssetsTradeRequest) GetSlippage ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetSlippage() *TokenizedAssetsTradeRequestSlippage
func (*TokenizedAssetsTradeRequest) GetTokenIn ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetTokenIn() string
func (*TokenizedAssetsTradeRequest) GetTokenOut ¶ added in v0.1.17
func (t *TokenizedAssetsTradeRequest) GetTokenOut() string
func (*TokenizedAssetsTradeRequest) GetWisdomtree ¶ added in v0.1.56
func (t *TokenizedAssetsTradeRequest) GetWisdomtree() optionalnullable.OptionalNullable[WisdomTreeCredentials]
func (TokenizedAssetsTradeRequest) MarshalJSON ¶ added in v0.1.24
func (t TokenizedAssetsTradeRequest) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTradeRequest) UnmarshalJSON ¶ added in v0.1.24
func (t *TokenizedAssetsTradeRequest) UnmarshalJSON(data []byte) error
type TokenizedAssetsTradeRequestAmountIn ¶ added in v0.1.17
type TokenizedAssetsTradeRequestAmountIn struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type TokenizedAssetsTradeRequestAmountInType
}
TokenizedAssetsTradeRequestAmountIn - Human-readable amount of `token_in` to trade (token units, not wei).
func CreateTokenizedAssetsTradeRequestAmountInNumber ¶ added in v0.1.17
func CreateTokenizedAssetsTradeRequestAmountInNumber(number float64) TokenizedAssetsTradeRequestAmountIn
func CreateTokenizedAssetsTradeRequestAmountInStr ¶ added in v0.1.17
func CreateTokenizedAssetsTradeRequestAmountInStr(str string) TokenizedAssetsTradeRequestAmountIn
func (TokenizedAssetsTradeRequestAmountIn) MarshalJSON ¶ added in v0.1.17
func (u TokenizedAssetsTradeRequestAmountIn) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTradeRequestAmountIn) UnmarshalJSON ¶ added in v0.1.17
func (u *TokenizedAssetsTradeRequestAmountIn) UnmarshalJSON(data []byte) error
type TokenizedAssetsTradeRequestAmountInType ¶ added in v0.1.17
type TokenizedAssetsTradeRequestAmountInType string
const ( TokenizedAssetsTradeRequestAmountInTypeNumber TokenizedAssetsTradeRequestAmountInType = "number" TokenizedAssetsTradeRequestAmountInTypeStr TokenizedAssetsTradeRequestAmountInType = "str" )
type TokenizedAssetsTradeRequestSlippage ¶ added in v0.1.17
type TokenizedAssetsTradeRequestSlippage struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type TokenizedAssetsTradeRequestSlippageType
}
TokenizedAssetsTradeRequestSlippage - Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%).
func CreateTokenizedAssetsTradeRequestSlippageNumber ¶ added in v0.1.17
func CreateTokenizedAssetsTradeRequestSlippageNumber(number float64) TokenizedAssetsTradeRequestSlippage
func CreateTokenizedAssetsTradeRequestSlippageStr ¶ added in v0.1.17
func CreateTokenizedAssetsTradeRequestSlippageStr(str string) TokenizedAssetsTradeRequestSlippage
func (TokenizedAssetsTradeRequestSlippage) MarshalJSON ¶ added in v0.1.17
func (u TokenizedAssetsTradeRequestSlippage) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTradeRequestSlippage) UnmarshalJSON ¶ added in v0.1.17
func (u *TokenizedAssetsTradeRequestSlippage) UnmarshalJSON(data []byte) error
type TokenizedAssetsTradeRequestSlippageType ¶ added in v0.1.17
type TokenizedAssetsTradeRequestSlippageType string
const ( TokenizedAssetsTradeRequestSlippageTypeNumber TokenizedAssetsTradeRequestSlippageType = "number" TokenizedAssetsTradeRequestSlippageTypeStr TokenizedAssetsTradeRequestSlippageType = "str" )
type TokenizedAssetsTradeResponse ¶ added in v0.1.17
type TokenizedAssetsTradeResponse struct {
// Unsigned transaction executing the trade in the product account.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 payload for gas-sponsored execution.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Estimated amount of `token_out` received (human-readable units).
EstimatedAmountOut string `json:"estimated_amount_out"`
// Fee charged on the sell, in payout-token (USDC) units. Null when no fee was applied.
FeeAmount optionalnullable.OptionalNullable[string] `json:"fee_amount,omitzero"`
// How the trade settles. `instant`: the signed transaction completes the trade (Midas/Ondo swaps and IXS deposits). `async`: the transaction only *requests* an IXS redemption, which the vault operator settles off-chain later — poll `poll_endpoint` for status.
Settlement *Settlement `json:"settlement,omitzero"`
// For `async` settlements, the endpoint to poll for redemption status (`GET /v2/tokenized_assets/redemptions`). Null for instant trades.
PollEndpoint optionalnullable.OptionalNullable[string] `json:"poll_endpoint,omitzero"`
}
TokenizedAssetsTradeResponse - Unsigned trade execution for the owner to sign.
Exactly one of `transaction` (gas_sponsorship=false) or `eip_712` (gas_sponsorship=true) is set.
func (*TokenizedAssetsTradeResponse) GetEip712 ¶ added in v0.1.17
func (t *TokenizedAssetsTradeResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*TokenizedAssetsTradeResponse) GetEstimatedAmountOut ¶ added in v0.1.17
func (t *TokenizedAssetsTradeResponse) GetEstimatedAmountOut() string
func (*TokenizedAssetsTradeResponse) GetFeeAmount ¶ added in v0.1.24
func (t *TokenizedAssetsTradeResponse) GetFeeAmount() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsTradeResponse) GetPollEndpoint ¶ added in v0.1.33
func (t *TokenizedAssetsTradeResponse) GetPollEndpoint() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsTradeResponse) GetSettlement ¶ added in v0.1.33
func (t *TokenizedAssetsTradeResponse) GetSettlement() *Settlement
func (*TokenizedAssetsTradeResponse) GetTransaction ¶ added in v0.1.17
func (t *TokenizedAssetsTradeResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (TokenizedAssetsTradeResponse) MarshalJSON ¶ added in v0.1.17
func (t TokenizedAssetsTradeResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTradeResponse) UnmarshalJSON ¶ added in v0.1.17
func (t *TokenizedAssetsTradeResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsTransferRequest ¶ added in v0.1.18
type TokenizedAssetsTransferRequest struct {
// The owner's wallet address (EOA).
Owner string `json:"owner"`
// The chain to use.
Chain *Chain `json:"chain,omitzero"`
// The token to transfer. Tokenized-asset orders settle in USDC.
Token string `json:"token"`
// The amount of tokens to transfer (in token units, not wei).
Amount TokenizedAssetsTransferRequestAmount `json:"amount"`
// Whether you are depositing to or withdrawing from your Tokenized Assets Account.
Action TokenizedAssetsTransferRequestAction `json:"action"`
// Optionally request gas sponsorship. If set to `true`, EIP-712 signature data will be returned that must be signed by the `owner` and submitted to the `/gas_sponsorship/prepare` endpoint.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
// The address that will call Permit2's permitTransferFrom to execute the transfer. When `action` is 'DEPOSIT' and `gas_sponsorship` is `true`: - If provided, the signature will authorize this address (typically a gas sponsor) to pull tokens. - If not provided, defaults to the Tokenized Assets Account (Safe) address, allowing the transfer to be included in a bundle transaction where the Safe pulls the tokens itself.
Spender optionalnullable.OptionalNullable[string] `json:"spender,omitzero"`
}
func (*TokenizedAssetsTransferRequest) GetAction ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetAction() TokenizedAssetsTransferRequestAction
func (*TokenizedAssetsTransferRequest) GetAmount ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetAmount() TokenizedAssetsTransferRequestAmount
func (*TokenizedAssetsTransferRequest) GetChain ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetChain() *Chain
func (*TokenizedAssetsTransferRequest) GetGasSponsorship ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetGasSponsorship() *bool
func (*TokenizedAssetsTransferRequest) GetOwner ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetOwner() string
func (*TokenizedAssetsTransferRequest) GetSpender ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetSpender() optionalnullable.OptionalNullable[string]
func (*TokenizedAssetsTransferRequest) GetToken ¶ added in v0.1.18
func (t *TokenizedAssetsTransferRequest) GetToken() string
type TokenizedAssetsTransferRequestAction ¶ added in v0.1.18
type TokenizedAssetsTransferRequestAction string
TokenizedAssetsTransferRequestAction - Whether you are depositing to or withdrawing from your Tokenized Assets Account.
const ( TokenizedAssetsTransferRequestActionDeposit TokenizedAssetsTransferRequestAction = "DEPOSIT" TokenizedAssetsTransferRequestActionWithdraw TokenizedAssetsTransferRequestAction = "WITHDRAW" )
func (TokenizedAssetsTransferRequestAction) ToPointer ¶ added in v0.1.18
func (e TokenizedAssetsTransferRequestAction) ToPointer() *TokenizedAssetsTransferRequestAction
func (*TokenizedAssetsTransferRequestAction) UnmarshalJSON ¶ added in v0.1.18
func (e *TokenizedAssetsTransferRequestAction) UnmarshalJSON(data []byte) error
type TokenizedAssetsTransferRequestAmount ¶ added in v0.1.18
type TokenizedAssetsTransferRequestAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type TokenizedAssetsTransferRequestAmountType
}
TokenizedAssetsTransferRequestAmount - The amount of tokens to transfer (in token units, not wei).
func CreateTokenizedAssetsTransferRequestAmountNumber ¶ added in v0.1.18
func CreateTokenizedAssetsTransferRequestAmountNumber(number float64) TokenizedAssetsTransferRequestAmount
func CreateTokenizedAssetsTransferRequestAmountStr ¶ added in v0.1.18
func CreateTokenizedAssetsTransferRequestAmountStr(str string) TokenizedAssetsTransferRequestAmount
func (TokenizedAssetsTransferRequestAmount) MarshalJSON ¶ added in v0.1.18
func (u TokenizedAssetsTransferRequestAmount) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTransferRequestAmount) UnmarshalJSON ¶ added in v0.1.18
func (u *TokenizedAssetsTransferRequestAmount) UnmarshalJSON(data []byte) error
type TokenizedAssetsTransferRequestAmountType ¶ added in v0.1.18
type TokenizedAssetsTransferRequestAmountType string
const ( TokenizedAssetsTransferRequestAmountTypeNumber TokenizedAssetsTransferRequestAmountType = "number" TokenizedAssetsTransferRequestAmountTypeStr TokenizedAssetsTransferRequestAmountType = "str" )
type TokenizedAssetsTransferResponse ¶ added in v0.1.18
type TokenizedAssetsTransferResponse struct {
// Unsigned transaction for direct execution. Present when `gas_sponsorship=false`.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when `gas_sponsorship=true`. A Permit2 `PermitTransferFrom` for DEPOSIT, or a Safe transaction for WITHDRAW. The owner signs it and submits to `/v2/gas_sponsorship/prepare`.
Eip712 optionalnullable.OptionalNullable[TokenizedAssetsTransferResponseEip712] `json:"eip_712,omitzero"`
}
func (*TokenizedAssetsTransferResponse) GetEip712 ¶ added in v0.1.18
func (t *TokenizedAssetsTransferResponse) GetEip712() optionalnullable.OptionalNullable[TokenizedAssetsTransferResponseEip712]
func (*TokenizedAssetsTransferResponse) GetTransaction ¶ added in v0.1.18
func (t *TokenizedAssetsTransferResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (TokenizedAssetsTransferResponse) MarshalJSON ¶ added in v0.1.18
func (t TokenizedAssetsTransferResponse) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTransferResponse) UnmarshalJSON ¶ added in v0.1.18
func (t *TokenizedAssetsTransferResponse) UnmarshalJSON(data []byte) error
type TokenizedAssetsTransferResponseEip712 ¶ added in v0.1.18
type TokenizedAssetsTransferResponseEip712 struct {
BatchedSafeOperationsResponseOutput *BatchedSafeOperationsResponseOutput `queryParam:"inline" union:"member"`
Permit2TypedDataOutput *Permit2TypedDataOutput `queryParam:"inline" union:"member"`
UnknownRaw json.RawMessage `json:"-" union:"unknown"`
Type TokenizedAssetsTransferResponseEip712Type
}
TokenizedAssetsTransferResponseEip712 - EIP-712 typed data for gas-sponsored execution. Present when `gas_sponsorship=true`. A Permit2 `PermitTransferFrom` for DEPOSIT, or a Safe transaction for WITHDRAW. The owner signs it and submits to `/v2/gas_sponsorship/prepare`.
func CreateTokenizedAssetsTransferResponseEip712BatchedSafeOperationsResponseOutput ¶ added in v0.1.18
func CreateTokenizedAssetsTransferResponseEip712BatchedSafeOperationsResponseOutput(batchedSafeOperationsResponseOutput BatchedSafeOperationsResponseOutput) TokenizedAssetsTransferResponseEip712
func CreateTokenizedAssetsTransferResponseEip712Permit2TypedDataOutput ¶ added in v0.1.18
func CreateTokenizedAssetsTransferResponseEip712Permit2TypedDataOutput(permit2TypedDataOutput Permit2TypedDataOutput) TokenizedAssetsTransferResponseEip712
func CreateTokenizedAssetsTransferResponseEip712Unknown ¶ added in v0.1.18
func CreateTokenizedAssetsTransferResponseEip712Unknown(raw json.RawMessage) TokenizedAssetsTransferResponseEip712
func (TokenizedAssetsTransferResponseEip712) GetUnknownRaw ¶ added in v0.1.18
func (u TokenizedAssetsTransferResponseEip712) GetUnknownRaw() json.RawMessage
func (TokenizedAssetsTransferResponseEip712) IsUnknown ¶ added in v0.1.18
func (u TokenizedAssetsTransferResponseEip712) IsUnknown() bool
func (TokenizedAssetsTransferResponseEip712) MarshalJSON ¶ added in v0.1.18
func (u TokenizedAssetsTransferResponseEip712) MarshalJSON() ([]byte, error)
func (*TokenizedAssetsTransferResponseEip712) UnmarshalJSON ¶ added in v0.1.18
func (u *TokenizedAssetsTransferResponseEip712) UnmarshalJSON(data []byte) error
type TokenizedAssetsTransferResponseEip712Type ¶ added in v0.1.18
type TokenizedAssetsTransferResponseEip712Type string
const ( TokenizedAssetsTransferResponseEip712TypeBatchedSafeOperationsResponseOutput TokenizedAssetsTransferResponseEip712Type = "BatchedSafeOperationsResponse-Output" TokenizedAssetsTransferResponseEip712TypePermit2TypedDataOutput TokenizedAssetsTransferResponseEip712Type = "Permit2TypedData-Output" TokenizedAssetsTransferResponseEip712TypeUnknown TokenizedAssetsTransferResponseEip712Type = "Unknown" )
type TradingState ¶ added in v0.1.36
type TradingState string
TradingState - Coarse tradability state for a tokenized market.
const ( TradingStateOpen TradingState = "OPEN" TradingStateClosed TradingState = "CLOSED" TradingStatePaused TradingState = "PAUSED" TradingStateLimited TradingState = "LIMITED" )
func (*TradingState) IsExact ¶ added in v0.1.36
func (e *TradingState) IsExact() bool
IsExact returns true if the value matches a known enum value, false otherwise.
func (TradingState) ToPointer ¶ added in v0.1.36
func (e TradingState) ToPointer() *TradingState
type TradingStatus ¶ added in v0.1.36
type TradingStatus struct {
// True if the market can be traded right now.
IsOpen bool `json:"is_open"`
// Coarse tradability state for a tokenized market.
State TradingState `json:"state"`
// Why the market is not fully open (e.g. 'Weekend or Holiday', 'cash_dividend'). Null when open.
Reason optionalnullable.OptionalNullable[string] `json:"reason,omitzero"`
// Active trading session for equities when open ('regular', 'premarket', 'postmarket', 'overnight', 'offhours'). Null for RWA/vault assets or when closed.
Session optionalnullable.OptionalNullable[string] `json:"session,omitzero"`
// ISO 8601 UTC time the market next opens. Null when open now or unknown.
NextOpen optionalnullable.OptionalNullable[string] `json:"next_open,omitzero"`
// ISO 8601 UTC time the market next closes. Null when closed now or unknown.
NextClose optionalnullable.OptionalNullable[string] `json:"next_close,omitzero"`
}
TradingStatus - Whether a tokenized market can be traded right now, and if not, why.
func (*TradingStatus) GetIsOpen ¶ added in v0.1.36
func (t *TradingStatus) GetIsOpen() bool
func (*TradingStatus) GetNextClose ¶ added in v0.1.36
func (t *TradingStatus) GetNextClose() optionalnullable.OptionalNullable[string]
func (*TradingStatus) GetNextOpen ¶ added in v0.1.36
func (t *TradingStatus) GetNextOpen() optionalnullable.OptionalNullable[string]
func (*TradingStatus) GetReason ¶ added in v0.1.36
func (t *TradingStatus) GetReason() optionalnullable.OptionalNullable[string]
func (*TradingStatus) GetSession ¶ added in v0.1.36
func (t *TradingStatus) GetSession() optionalnullable.OptionalNullable[string]
func (*TradingStatus) GetState ¶ added in v0.1.36
func (t *TradingStatus) GetState() TradingState
type UnloopLegPreview ¶ added in v0.1.35
type UnloopLegPreview struct {
// Collateral withdrawn this iteration (token units).
WithdrawAmount *string `json:"withdraw_amount"`
// Guaranteed swap output (borrow-token units) — enforced on-chain by the swap's minimum-return. Null on the final collateral sweep leg, which does not swap.
MinSwapOut optionalnullable.OptionalNullable[string] `json:"min_swap_out,omitzero"`
// Debt repaid this iteration (borrow-token units); null on the final collateral sweep leg.
RepayAmount optionalnullable.OptionalNullable[string] `json:"repay_amount,omitzero"`
// True on the closing leg that clears the remaining debt exactly (Aave clamps to live debt; Morpho repays the remaining shares).
FullRepay *bool `json:"full_repay,omitzero"`
}
UnloopLegPreview - One planned unwind iteration: withdraw [+ swap + repay].
func (*UnloopLegPreview) GetFullRepay ¶ added in v0.1.35
func (u *UnloopLegPreview) GetFullRepay() *bool
func (*UnloopLegPreview) GetMinSwapOut ¶ added in v0.1.35
func (u *UnloopLegPreview) GetMinSwapOut() optionalnullable.OptionalNullable[string]
func (*UnloopLegPreview) GetRepayAmount ¶ added in v0.1.35
func (u *UnloopLegPreview) GetRepayAmount() optionalnullable.OptionalNullable[string]
func (*UnloopLegPreview) GetWithdrawAmount ¶ added in v0.1.35
func (u *UnloopLegPreview) GetWithdrawAmount() *string
type UnsignedTransaction ¶
type UnsignedTransaction struct {
// The chain id of the transaction
ChainID string `json:"chainId"`
// The data of the transaction
Data string `json:"data"`
// The sender of the transaction
From string `json:"from"`
// The gas of the transaction
Gas *string `json:"gas"`
// The recipient of the transaction
To string `json:"to"`
// The value of the transaction
Value string `json:"value"`
// The nonce of the address
Nonce string `json:"nonce"`
// The max fee per gas of the transaction
MaxFeePerGas string `json:"maxFeePerGas"`
// The max priority fee per gas of the transaction
MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
}
func (*UnsignedTransaction) GetChainID ¶
func (u *UnsignedTransaction) GetChainID() string
func (*UnsignedTransaction) GetData ¶
func (u *UnsignedTransaction) GetData() string
func (*UnsignedTransaction) GetFrom ¶
func (u *UnsignedTransaction) GetFrom() string
func (*UnsignedTransaction) GetGas ¶
func (u *UnsignedTransaction) GetGas() *string
func (*UnsignedTransaction) GetMaxFeePerGas ¶
func (u *UnsignedTransaction) GetMaxFeePerGas() string
func (*UnsignedTransaction) GetMaxPriorityFeePerGas ¶
func (u *UnsignedTransaction) GetMaxPriorityFeePerGas() string
func (*UnsignedTransaction) GetNonce ¶
func (u *UnsignedTransaction) GetNonce() string
func (*UnsignedTransaction) GetTo ¶
func (u *UnsignedTransaction) GetTo() string
func (*UnsignedTransaction) GetValue ¶
func (u *UnsignedTransaction) GetValue() string
type V2BundleRequest ¶
type V2BundleRequest struct {
// The owner's wallet address that controls the Earn Account.
Owner string `json:"owner"`
// The chain to use.
Chain Chain `json:"chain"`
// List of actions to bundle. Actions are executed in order.
Actions []V2UserOperation `json:"actions"`
// If true, returns EIP-712 typed data for gas sponsorship. The owner must sign this data and submit to /gas_sponsorship/prepare.
GasSponsorship *bool `json:"gas_sponsorship,omitzero"`
}
V2BundleRequest - Request to execute multiple earn actions in a single atomic transaction.
## Supported Action Types
- **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the product account using Permit2. Requires a signed Permit2 message.
- **V2_TRANSFER_TO_EOA**: Transfer tokens from the product account back to the owner's EOA. No signature required (product account owns the tokens).
- **V2_TRANSFER_TO_ADDRESS**: Transfer ERC20 tokens from the product account to any specified recipient address. No signature required (product account owns the tokens).
- **V2_SWAP**: Swap tokens within the product account using 1inch aggregator.
- **V2_MANAGE**: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)
## Using V2_TRANSFER_FROM_EOA (Deposit to Product Account)
To include a transfer from EOA in your bundle, follow these steps:
- **One-time setup**: Approve Permit2 to spend the token by calling `POST /v2/gas_sponsorship/approve_transfer` and executing the returned transaction.
2. **Get Permit2 signature**: Call `POST /v2/earn/transfer` with:
`action`: "DEPOSIT"
`gas_sponsorship`: true
`spender`: omit this field (defaults to product account address for bundle use)
This returns EIP-712 typed data. Sign it with the owner's wallet.
3. **Include in bundle**: Add a V2_TRANSFER_FROM_EOA action with the signature and nonce/deadline from the typed data.
The bundle will atomically: pull tokens from EOA → execute subsequent actions.
## Using V2_TRANSFER_TO_EOA (Withdraw to EOA)
To transfer tokens from the product account back to the owner's EOA, simply add a V2_TRANSFER_TO_EOA action to your bundle. No signature is required since the product account already owns the tokens.
Specify the exact token amount to transfer.
func (*V2BundleRequest) GetActions ¶
func (v *V2BundleRequest) GetActions() []V2UserOperation
func (*V2BundleRequest) GetChain ¶
func (v *V2BundleRequest) GetChain() Chain
func (*V2BundleRequest) GetGasSponsorship ¶
func (v *V2BundleRequest) GetGasSponsorship() *bool
func (*V2BundleRequest) GetOwner ¶
func (v *V2BundleRequest) GetOwner() string
type V2BundleResponse ¶
type V2BundleResponse struct {
// Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.
Transaction optionalnullable.OptionalNullable[UnsignedTransaction] `json:"transaction,omitzero"`
// EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. Owner must sign and submit to /gas_sponsorship/prepare.
Eip712 optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput] `json:"eip_712,omitzero"`
// Number of individual transactions bundled in this execution.
ActionsCount int64 `json:"actions_count"`
}
func (*V2BundleResponse) GetActionsCount ¶
func (v *V2BundleResponse) GetActionsCount() int64
func (*V2BundleResponse) GetEip712 ¶
func (v *V2BundleResponse) GetEip712() optionalnullable.OptionalNullable[BatchedSafeOperationsResponseOutput]
func (*V2BundleResponse) GetTransaction ¶
func (v *V2BundleResponse) GetTransaction() optionalnullable.OptionalNullable[UnsignedTransaction]
func (V2BundleResponse) MarshalJSON ¶
func (v V2BundleResponse) MarshalJSON() ([]byte, error)
func (*V2BundleResponse) UnmarshalJSON ¶
func (v *V2BundleResponse) UnmarshalJSON(data []byte) error
type V2UserOperation ¶
type V2UserOperation struct {
Body V2UserOperationBody `json:"body"`
}
V2UserOperation - A single operation in a V2 bundle.
func (*V2UserOperation) GetBody ¶
func (v *V2UserOperation) GetBody() V2UserOperationBody
func (*V2UserOperation) GetBodyV2Manage ¶
func (v *V2UserOperation) GetBodyV2Manage() *EarnManageParams
func (*V2UserOperation) GetBodyV2Swap ¶
func (v *V2UserOperation) GetBodyV2Swap() *EarnSwapParams
func (*V2UserOperation) GetBodyV2TransferFromEoa ¶
func (v *V2UserOperation) GetBodyV2TransferFromEoa() *EarnTransferFromEOAParams
func (*V2UserOperation) GetBodyV2TransferToAddress ¶
func (v *V2UserOperation) GetBodyV2TransferToAddress() *EarnTransferToAddressParams
func (*V2UserOperation) GetBodyV2TransferToEoa ¶
func (v *V2UserOperation) GetBodyV2TransferToEoa() *EarnTransferToEOAParams
type V2UserOperationBody ¶
type V2UserOperationBody struct {
EarnSwapParams *EarnSwapParams `queryParam:"inline" union:"member"`
EarnManageParams *EarnManageParams `queryParam:"inline" union:"member"`
EarnTransferFromEOAParams *EarnTransferFromEOAParams `queryParam:"inline" union:"member"`
EarnTransferToEOAParams *EarnTransferToEOAParams `queryParam:"inline" union:"member"`
EarnTransferToAddressParams *EarnTransferToAddressParams `queryParam:"inline" union:"member"`
Type V2UserOperationBodyType
}
func CreateV2UserOperationBodyV2Manage ¶
func CreateV2UserOperationBodyV2Manage(v2Manage EarnManageParams) V2UserOperationBody
func CreateV2UserOperationBodyV2Swap ¶
func CreateV2UserOperationBodyV2Swap(v2Swap EarnSwapParams) V2UserOperationBody
func CreateV2UserOperationBodyV2TransferFromEoa ¶
func CreateV2UserOperationBodyV2TransferFromEoa(v2TransferFromEoa EarnTransferFromEOAParams) V2UserOperationBody
func CreateV2UserOperationBodyV2TransferToAddress ¶
func CreateV2UserOperationBodyV2TransferToAddress(v2TransferToAddress EarnTransferToAddressParams) V2UserOperationBody
func CreateV2UserOperationBodyV2TransferToEoa ¶
func CreateV2UserOperationBodyV2TransferToEoa(v2TransferToEoa EarnTransferToEOAParams) V2UserOperationBody
func (V2UserOperationBody) MarshalJSON ¶
func (u V2UserOperationBody) MarshalJSON() ([]byte, error)
func (*V2UserOperationBody) UnmarshalJSON ¶
func (u *V2UserOperationBody) UnmarshalJSON(data []byte) error
type V2UserOperationBodyType ¶
type V2UserOperationBodyType string
const ( V2UserOperationBodyTypeV2Manage V2UserOperationBodyType = "V2_MANAGE" V2UserOperationBodyTypeV2Swap V2UserOperationBodyType = "V2_SWAP" V2UserOperationBodyTypeV2TransferFromEoa V2UserOperationBodyType = "V2_TRANSFER_FROM_EOA" V2UserOperationBodyTypeV2TransferToAddress V2UserOperationBodyType = "V2_TRANSFER_TO_ADDRESS" V2UserOperationBodyTypeV2TransferToEoa V2UserOperationBodyType = "V2_TRANSFER_TO_EOA" )
type ValidationError ¶
type ValidationError struct {
Loc []Loc `json:"loc"`
Msg string `json:"msg"`
Type string `json:"type"`
}
func (*ValidationError) GetLoc ¶
func (v *ValidationError) GetLoc() []Loc
func (*ValidationError) GetMsg ¶
func (v *ValidationError) GetMsg() string
func (*ValidationError) GetType ¶
func (v *ValidationError) GetType() string
type VaultInfo ¶
type VaultInfo struct {
// The vault contract address.
VaultAddress string `json:"vault_address"`
// Blockchain name (e.g., 'ethereum', 'base').
Chain string `json:"chain"`
// Lending protocol backing this vault. 'MORPHO' for Morpho vaults, 'EULER' for Euler V2 (EVK) vaults. Both are ERC-4626 and are deposited into / withdrawn from the same way (by `vault_address`, via the Earn `VAULT` venue).
Protocol *Protocol `json:"protocol,omitzero"`
// The name of the vault.
Name optionalnullable.OptionalNullable[string] `json:"name,omitzero"`
// The vault share token symbol.
Symbol optionalnullable.OptionalNullable[string] `json:"symbol,omitzero"`
// The vault owner address. For Morpho vaults this is the vault curator/owner. Euler V2 (EVK) vaults have no Morpho-style owner, so this is the zero-address sentinel (0x0 + 40 zeros). Always a string, never null, for backward compatibility.
Owner string `json:"owner"`
// The underlying asset contract address.
Asset string `json:"asset"`
// The name of the underlying asset.
AssetName optionalnullable.OptionalNullable[string] `json:"asset_name,omitzero"`
// The symbol of the underlying asset (e.g., 'USDC').
AssetSymbol optionalnullable.OptionalNullable[string] `json:"asset_symbol,omitzero"`
// Morpho factory version this vault was created from. 'v1.0' / 'v1.1' = MetaMorpho v1 (single-asset, Morpho Blue markets only). 'v2' = Morpho Vaults v2 (adapter framework, can route to non-Morpho-Blue venues). Null only on legacy rows that pre-date factory tracking.
FactoryVersion optionalnullable.OptionalNullable[string] `json:"factory_version,omitzero"`
// Total Value Locked in USD. Represents the total assets deposited in the vault.
TvlUsd optionalnullable.OptionalNullable[string] `json:"tvl_usd,omitzero"`
// Available liquidity in USD. The amount that can be withdrawn right now, accounting for idle funds and borrowable supply across the vault's markets. Always <= tvl_usd.
LiquidityUsd optionalnullable.OptionalNullable[string] `json:"liquidity_usd,omitzero"`
// Maximum additional amount that can be deposited into the vault, in human-readable token units (e.g., 1000.5 USDC). Derived from the ERC4626 maxDeposit function. A value of 0 means the vault is paused or full.
DepositCap optionalnullable.OptionalNullable[string] `json:"deposit_cap,omitzero"`
// Maximum additional depositable amount converted to USD.
DepositCapUsd optionalnullable.OptionalNullable[string] `json:"deposit_cap_usd,omitzero"`
// 7-day APY as a percentage (e.g., 5.25 = 5.25%).
Apy7d optionalnullable.OptionalNullable[string] `json:"apy_7d,omitzero"`
// 30-day APY as a percentage.
Apy30d optionalnullable.OptionalNullable[string] `json:"apy_30d,omitzero"`
// 90-day APY as a percentage.
Apy90d optionalnullable.OptionalNullable[string] `json:"apy_90d,omitzero"`
// Morpho Blue markets in this vault's supply queue, ordered by queue index. Shows how the vault's capital is split across lending markets with different collateral types and risk parameters.
Markets []MarketAllocation `json:"markets,omitzero"`
}
VaultInfo - Information about a single ERC-4626 vault from the database.
func (*VaultInfo) GetApy7d ¶
func (v *VaultInfo) GetApy7d() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetApy30d ¶
func (v *VaultInfo) GetApy30d() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetApy90d ¶
func (v *VaultInfo) GetApy90d() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetAssetName ¶
func (v *VaultInfo) GetAssetName() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetAssetSymbol ¶
func (v *VaultInfo) GetAssetSymbol() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetDepositCap ¶
func (v *VaultInfo) GetDepositCap() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetDepositCapUsd ¶
func (v *VaultInfo) GetDepositCapUsd() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetFactoryVersion ¶
func (v *VaultInfo) GetFactoryVersion() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetLiquidityUsd ¶
func (v *VaultInfo) GetLiquidityUsd() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetMarkets ¶
func (v *VaultInfo) GetMarkets() []MarketAllocation
func (*VaultInfo) GetName ¶
func (v *VaultInfo) GetName() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetProtocol ¶ added in v0.1.31
func (*VaultInfo) GetSymbol ¶
func (v *VaultInfo) GetSymbol() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetTvlUsd ¶
func (v *VaultInfo) GetTvlUsd() optionalnullable.OptionalNullable[string]
func (*VaultInfo) GetVaultAddress ¶
func (VaultInfo) MarshalJSON ¶
func (*VaultInfo) UnmarshalJSON ¶
type VaultVenue ¶
type VaultVenue struct {
// The vault address you are interacting with for this action.
VaultAddress string `json:"vault_address"`
// contains filtered or unexported fields
}
func (*VaultVenue) GetType ¶
func (v *VaultVenue) GetType() string
func (*VaultVenue) GetVaultAddress ¶
func (v *VaultVenue) GetVaultAddress() string
func (VaultVenue) MarshalJSON ¶
func (v VaultVenue) MarshalJSON() ([]byte, error)
func (*VaultVenue) UnmarshalJSON ¶
func (v *VaultVenue) UnmarshalJSON(data []byte) error
type VaultsResponse ¶
type VaultsResponse struct {
Total int64 `json:"total"`
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
// A list of vault information objects.
Vaults []VaultInfo `json:"vaults"`
}
VaultsResponse - Response model for a paginated list of ERC-4626 vaults.
func (*VaultsResponse) GetLimit ¶
func (v *VaultsResponse) GetLimit() int64
func (*VaultsResponse) GetOffset ¶
func (v *VaultsResponse) GetOffset() int64
func (*VaultsResponse) GetTotal ¶
func (v *VaultsResponse) GetTotal() int64
func (*VaultsResponse) GetVaults ¶
func (v *VaultsResponse) GetVaults() []VaultInfo
type WisdomTreeCredentials ¶ added in v0.1.56
type WisdomTreeCredentials struct {
// WisdomTree Connect client id for your organization.
ClientID string `json:"client_id"`
// WisdomTree Connect client secret for your organization.
ClientSecret string `json:"client_secret"`
// WisdomTree Connect username for your organization's account.
Username string `json:"username"`
// WisdomTree Connect password for your organization's account.
Password string `json:"password"`
}
WisdomTreeCredentials - Per-organization WisdomTree Connect API credentials.
Supplied per request rather than configured on the service: each organization has its own WisdomTree account, whitelisted wallets and KYC, so there is no single service-level credential that could serve every caller. The secret is a “SecretStr“ so it cannot be printed by accident, and the error logger masks it in request bodies.
func (*WisdomTreeCredentials) GetClientID ¶ added in v0.1.56
func (w *WisdomTreeCredentials) GetClientID() string
func (*WisdomTreeCredentials) GetClientSecret ¶ added in v0.1.56
func (w *WisdomTreeCredentials) GetClientSecret() string
func (*WisdomTreeCredentials) GetPassword ¶ added in v0.1.56
func (w *WisdomTreeCredentials) GetPassword() string
func (*WisdomTreeCredentials) GetUsername ¶ added in v0.1.56
func (w *WisdomTreeCredentials) GetUsername() string
type WithdrawAmount ¶
type WithdrawAmount struct {
Number *float64 `queryParam:"inline" union:"member"`
Str *string `queryParam:"inline" union:"member"`
Type WithdrawAmountType
}
WithdrawAmount - Amount of collateral to withdraw (in token units, not wei). Omit together with withdraw_token for repay-only mode.
func CreateWithdrawAmountNumber ¶
func CreateWithdrawAmountNumber(number float64) WithdrawAmount
func CreateWithdrawAmountStr ¶
func CreateWithdrawAmountStr(str string) WithdrawAmount
func (WithdrawAmount) MarshalJSON ¶
func (u WithdrawAmount) MarshalJSON() ([]byte, error)
func (*WithdrawAmount) UnmarshalJSON ¶
func (u *WithdrawAmount) UnmarshalJSON(data []byte) error
type WithdrawAmountType ¶
type WithdrawAmountType string
const ( WithdrawAmountTypeNumber WithdrawAmountType = "number" WithdrawAmountTypeStr WithdrawAmountType = "str" )
type WithdrawalEvent ¶
type WithdrawalEvent struct {
// Block number when withdrawal occurred
BlockNumber int64 `json:"block_number"`
// Timestamp when withdrawal occurred
BlockTimestamp time.Time `json:"block_timestamp"`
// Transaction hash of the withdrawal
TransactionHash string `json:"transaction_hash"`
// Units withdrawn (shares, aTokens, PT)
InputAmount string `json:"input_amount"`
// Symbol of units withdrawn
InputSymbol string `json:"input_symbol"`
// Amount received (underlying or token)
OutputAmount string `json:"output_amount"`
// Symbol of token received
OutputSymbol string `json:"output_symbol"`
// Profit/loss: output value - cost basis consumed
RealizedPnl string `json:"realized_pnl"`
}
WithdrawalEvent - Historical withdrawal event with realized PnL.
Uses generic input/output format: - Vault: input=shares, output=underlying - Aave: input=aTokens, output=underlying - Pendle: input=PT, output=token (varies)
func (*WithdrawalEvent) GetBlockNumber ¶
func (w *WithdrawalEvent) GetBlockNumber() int64
func (*WithdrawalEvent) GetBlockTimestamp ¶
func (w *WithdrawalEvent) GetBlockTimestamp() time.Time
func (*WithdrawalEvent) GetInputAmount ¶
func (w *WithdrawalEvent) GetInputAmount() string
func (*WithdrawalEvent) GetInputSymbol ¶
func (w *WithdrawalEvent) GetInputSymbol() string
func (*WithdrawalEvent) GetOutputAmount ¶
func (w *WithdrawalEvent) GetOutputAmount() string
func (*WithdrawalEvent) GetOutputSymbol ¶
func (w *WithdrawalEvent) GetOutputSymbol() string
func (*WithdrawalEvent) GetRealizedPnl ¶
func (w *WithdrawalEvent) GetRealizedPnl() string
func (*WithdrawalEvent) GetTransactionHash ¶
func (w *WithdrawalEvent) GetTransactionHash() string
func (WithdrawalEvent) MarshalJSON ¶
func (w WithdrawalEvent) MarshalJSON() ([]byte, error)
func (*WithdrawalEvent) UnmarshalJSON ¶
func (w *WithdrawalEvent) UnmarshalJSON(data []byte) error
Source Files
¶
- aaveposition.go
- aavevenue.go
- accountsummary.go
- approvetransferrequest.go
- approvetransferresponse.go
- batchedsafeoperationsresponseinput.go
- batchedsafeoperationsresponseoutput.go
- borrowabletoken.go
- builder.go
- candle.go
- chain.go
- chainmarketinfo.go
- collateralposition.go
- compassapibackendv2modelsbalancestokenbalance.go
- compassapibackendv2modelsearnreadresponsepositionsvaultposition.go
- compassapibackendv2modelsgassponsorshippermit2typeddataeip712domain.go
- compassapibackendv2modelsgassponsorshippermit2typeddataeip712types.go
- compassapibackendv2modelsgassponsorshippermittypeddataeip712domain.go
- compassapibackendv2modelsgassponsorshippermittypeddataeip712types.go
- compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.go
- compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712types.go
- compassapibackendv2modelstokenizedassetsmarketmarket.go
- compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.go
- createaccountrequest.go
- createaccountresponse.go
- createcreditaccountrequest.go
- createcreditaccountresponse.go
- createtokenizedassetsaccountrequest.go
- createtokenizedassetsaccountresponse.go
- creditbalancesresponse.go
- creditborrowparams.go
- creditborrowrequest.go
- creditborrowresponse.go
- creditbundlerequest.go
- creditbundleresponse.go
- creditenablecollateralparams.go
- creditevent.go
- creditfee.go
- creditloopedpositionsresponse.go
- creditlooppreview.go
- creditlooprequest.go
- creditloopresponse.go
- creditpositionsresponse.go
- creditprotocol.go
- creditrebalancepreview.go
- creditrebalancerequest.go
- creditrebalanceresponse.go
- creditrepayparams.go
- creditrepayrequest.go
- creditrepayresponse.go
- creditsupplyparams.go
- credittransferrequest.go
- credittransferresponse.go
- credittransfertoaddressparams.go
- creditunlooppreview.go
- creditunlooprequest.go
- creditunloopresponse.go
- credituseroperation.go
- creditwithdrawparams.go
- debtposition.go
- depositevent.go
- earnbalancesresponse.go
- earnmanageparams.go
- earnmanagerequest.go
- earnmanageresponse.go
- earnpositionsallresponse.go
- earnpositionsresponse.go
- earnswapparams.go
- earnswapquoteresponse.go
- earnswaprequest.go
- earnswapresponse.go
- earntransferfromeoaparams.go
- earntransferrequest.go
- earntransferresponse.go
- earntransfertoaddressparams.go
- earntransfertoeoaparams.go
- eip712domainfield.go
- eip712field.go
- eulermarket.go
- eulermarketcollateral.go
- eulermarketsresponse.go
- fee.go
- httpmetadata.go
- interestratemode.go
- listaavemarketsresponse.go
- loopedposition.go
- loopedpositioncurrentstate.go
- loopedpositionhistoryentry.go
- loopedpositiontotals.go
- looplegpreview.go
- marketallocation.go
- marketdetail.go
- maxsupplyapyinfo.go
- morpholendingmarket.go
- morphomarketsresponse.go
- ohlccandle.go
- onrampcreate.go
- onrampcreaterequest.go
- onrampfees.go
- onrampquote.go
- onrampquoterequest.go
- onrampstatus.go
- operationtype.go
- orderstatus.go
- ordertosign.go
- pendledepositevent.go
- pendlemarketinfo.go
- pendlemarketsresponse.go
- pendleptposition.go
- pendleptvenue.go
- pendlewithdrawalevent.go
- permit2typeddatainput.go
- permit2typeddataoutput.go
- permitfield.go
- permitmessage.go
- permittransferfrommessage.go
- permittypeddataresponseinput.go
- permittypeddataresponseoutput.go
- perpetualtradingactivitypartialerror.go
- perpetualtradingactivityresponse.go
- perpetualtradingapprovebuilderfeerequest.go
- perpetualtradingbuilderapproval.go
- perpetualtradingcancelorderrequest.go
- perpetualtradingcandlesresponse.go
- perpetualtradingcategory.go
- perpetualtradingdepositrequest.go
- perpetualtradingdepositresponse.go
- perpetualtradingdepositsponsorpreparerequest.go
- perpetualtradingdepositsponsorprepareresponse.go
- perpetualtradingenableunifiedaccountrequest.go
- perpetualtradingenableunifiedaccountresponse.go
- perpetualtradingensureleveragerequest.go
- perpetualtradingensureleverageresponse.go
- perpetualtradingexecuterequest.go
- perpetualtradingexecuteresponse.go
- perpetualtradingfill.go
- perpetualtradinglimitorderrequest.go
- perpetualtradingmarketorderrequest.go
- perpetualtradingopenorder.go
- perpetualtradingopportunitiesresponse.go
- perpetualtradingopportunity.go
- perpetualtradingposition.go
- perpetualtradingpositionsresponse.go
- perpetualtradingsetleveragerequest.go
- perpetualtradingsetleverageresponse.go
- perpetualtradingsignableactionresponse.go
- perpetualtradingwithdrawrequest.go
- positionpnl.go
- pricepoint.go
- quote.go
- quotefee.go
- rebalancedirection.go
- rebalancetarget.go
- rebalancetargetpreview.go
- redemption.go
- redemptionsresponse.go
- reserveinfo.go
- routingswappreview.go
- safemessageeip712response.go
- safemessageeip712types.go
- safemessagefield.go
- safemessagemessage.go
- safetxfield.go
- safetxmessage.go
- security.go
- sponsorgasrequest.go
- sponsorgasresponse.go
- swapinfo.go
- tokenamount.go
- tokenizedassetclass.go
- tokenizedassetprovider.go
- tokenizedassetsactivityevent.go
- tokenizedassetsbalancesresponse.go
- tokenizedassetsbuildorderrequest.go
- tokenizedassetsbuildorderresponse.go
- tokenizedassetscancelorderrequest.go
- tokenizedassetscancelorderresponse.go
- tokenizedassetschargefeerequest.go
- tokenizedassetschargefeeresponse.go
- tokenizedassetsfee.go
- tokenizedassetsmarketslistresponse.go
- tokenizedassetsohlcinterval.go
- tokenizedassetsohlcrange.go
- tokenizedassetspnl.go
- tokenizedassetspositionsresponse.go
- tokenizedassetsquoterequest.go
- tokenizedassetsquoteresponse.go
- tokenizedassetssubmitorderrequest.go
- tokenizedassetssubmitorderresponse.go
- tokenizedassetstraderequest.go
- tokenizedassetstraderesponse.go
- tokenizedassetstransferrequest.go
- tokenizedassetstransferresponse.go
- tokenmarketdata.go
- tokenpermissions.go
- tokentransfer.go
- tradingstate.go
- tradingstatus.go
- unlooplegpreview.go
- unsignedtransaction.go
- v2bundlerequest.go
- v2bundleresponse.go
- v2useroperation.go
- validationerror.go
- vaultinfo.go
- vaultsresponse.go
- vaultvenue.go
- wisdomtreecredentials.go
- withdrawalevent.go