Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountID
- type AccountName
- type AccountOperation
- type AccountOperationID
- type AccountState
- type AccountStatus
- type Asset
- type AssetHash
- type AssetID
- type AssetIcon
- type AssetInfo
- type Base58
- type Batch
- type BatchData
- type BatchID
- type BatchInfo
- type BatchInfoCryptoData
- type BatchInfoData
- type BatchInfoID
- type BatchMode
- type BatchNetwork
- type BatchStatus
- type BatchWithdraw
- type BlockID
- type Credential
- type CryptoAddress
- type CryptoAddressID
- type Currency
- type CurrencyAvailable
- type CurrencyName
- type CurrencyRate
- type CurrencyRateID
- type CurrencyRateSource
- type CurrencyRateValue
- type Fee
- type FeeData
- type FeeID
- type FeeInfo
- type Float
- type ID
- type Int
- type OAuth
- type OAuthData
- type OperationInfo
- type OperationInfoID
- type OperationStatus
- type OperationType
- type Payload
- type RefID
- type RoleName
- type SsmAddress
- type SsmAddressID
- type SsmAddressInfo
- type SsmAddressState
- type SsmAddressStateID
- type SsmAddressStatus
- type SsmBlindingKey
- type SsmChain
- type SsmFingerprint
- type SsmHDPath
- type SsmPubkey
- type SsmPublicAddress
- type String
- type Swap
- type SwapID
- type SwapInfo
- type SwapInfoID
- type SwapStatus
- type SwapType
- type SynchroneousType
- type TxID
- type User
- type UserEmail
- type UserID
- type UserName
- type UserRole
- type Vout
- type Withdraw
- type WithdrawData
- type WithdrawID
- type WithdrawInfo
- type WithdrawInfoData
- type WithdrawInfoID
- type WithdrawStatus
- type WithdrawTarget
- func FromCardData(withdrawID WithdrawID, card WithdrawTargetCardData) WithdrawTarget
- func FromLightningData(withdrawID WithdrawID, lightning WithdrawTargetLightningData) WithdrawTarget
- func FromLiquidData(withdrawID WithdrawID, liquid WithdrawTargetLiquidData) WithdrawTarget
- func FromOnChainData(withdrawID WithdrawID, chain string, onChain WithdrawTargetOnChainData) WithdrawTarget
- func FromSepaData(withdrawID WithdrawID, sepa WithdrawTargetSepaData) WithdrawTarget
- func FromSwiftData(withdrawID WithdrawID, swift WithdrawTargetSwiftData) WithdrawTarget
- func (p *WithdrawTarget) CardData() (WithdrawTargetCardData, error)
- func (p *WithdrawTarget) LightningData() (WithdrawTargetLightningData, error)
- func (p *WithdrawTarget) LiquidData() (WithdrawTargetLiquidData, error)
- func (p *WithdrawTarget) OnChainData() (WithdrawTargetOnChainData, error)
- func (p *WithdrawTarget) SepaData() (WithdrawTargetSepaData, error)
- func (p *WithdrawTarget) SwiftData() (WithdrawTargetSwiftData, error)
- type WithdrawTargetCardData
- type WithdrawTargetCryptoData
- type WithdrawTargetData
- type WithdrawTargetFiatData
- type WithdrawTargetID
- type WithdrawTargetLightningData
- type WithdrawTargetLiquidData
- type WithdrawTargetOnChainData
- type WithdrawTargetSepaData
- type WithdrawTargetSwiftData
- type WithdrawTargetType
- type ZeroFloat
- type ZeroInt
Constants ¶
const ( SsmAddressStatusUnused = SsmAddressStatus("unused") SsmAddressStatusUsed = SsmAddressStatus("used") SsmAddressStatusBlacklisted = SsmAddressStatus("blacklisted") )
const DefaultFeeRate = Float(0.001) // 0.1%
const MemPoolBlockID = BlockID(1)
Variables ¶
var (
ErrAccountStatusInvalid = errors.New("Invalid AccountStatus")
)
var (
ErrInvalidDataType = errors.New("Invalid DataType")
)
var (
ErrOperationTypeInvalid = errors.New("Invalid OperationType")
)
var (
ErrSynchroneousTypeInvalid = errors.New("Invalid SynchroneousType")
)
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v0.0.2
type Account struct { ID AccountID `gorm:"primary_key"` // [PK] Account UserID UserID `gorm:"index;not null"` // [FK] Reference to User table CurrencyName CurrencyName `gorm:"index;not null;type:varchar(16)"` // [FK] Reference to Currency table Name AccountName `gorm:"index;not null"` // [U] Unique Account name for User and Currency }
type AccountName ¶ added in v0.0.2
type AccountName String
type AccountOperation ¶ added in v0.0.2
type AccountOperation struct { ID AccountOperationID `gorm:"primary_key;unique_index:idx_id_previd;"` // [PK] AccountOperation AccountID AccountID `gorm:"index;not null"` // [FK] Reference to Account table SynchroneousType SynchroneousType `gorm:"index;not null;type:varchar(16)"` // [enum] Operation synchroneous type (sync, async-start, async-end) OperationType OperationType `gorm:"index;not null;type:varchar(16)"` // [enum] Determine table for ReferenceID (deposit, withdraw, transfer, adjustment, none, other) ReferenceID RefID `gorm:"index;not null"` // [optional - FK] Reference to related table with OperationType Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Operation timestamp Amount ZeroFloat `gorm:"default:0;not null"` // Operation amount (can be negative) Balance ZeroFloat `gorm:"default:0;not null"` // Account balance (strictly positive or zero) LockAmount ZeroFloat `gorm:"default:0;not null"` // Operation amount (can be negative) TotalLocked ZeroFloat `gorm:"default:0;not null"` // Total locked (strictly positive or zero and less or equal than Balance) }
AccountOperation model
func NewAccountOperation ¶ added in v0.0.2
func NewAccountOperation(ID AccountOperationID, accountID AccountID, synchroneousType SynchroneousType, operationType OperationType, referenceID RefID, timestamp time.Time, amount, balance, lockAmount, totalLocked Float) AccountOperation
func NewInitOperation ¶ added in v0.0.3
func NewInitOperation(accountID AccountID, referenceID RefID) AccountOperation
func (*AccountOperation) IsValid ¶ added in v0.0.2
func (p *AccountOperation) IsValid() bool
func (*AccountOperation) PreCheck ¶ added in v0.0.2
func (p *AccountOperation) PreCheck() bool
type AccountOperationID ¶ added in v0.0.2
type AccountOperationID ID
type AccountState ¶ added in v0.0.2
type AccountState struct { AccountID AccountID `gorm:"unique_index;not null"` // [FK] Reference to Account table State AccountStatus `gorm:"index;not null;type:varchar(16)"` // AccountStatus [normal, locked, disabled] }
type AccountStatus ¶ added in v0.0.2
type AccountStatus String
const ( AccountStatusInvalid AccountStatus = "" AccountStatusCreated AccountStatus = "created" AccountStatusNormal AccountStatus = "normal" AccountStatusLocked AccountStatus = "locked" AccountStatusDisabled AccountStatus = "disabled" )
func ParseAccountStatus ¶ added in v0.0.2
func ParseAccountStatus(str string) AccountStatus
func (AccountStatus) String ¶ added in v0.0.2
func (p AccountStatus) String() string
func (AccountStatus) Valid ¶ added in v0.0.2
func (p AccountStatus) Valid() bool
type Asset ¶ added in v0.0.3
type Asset struct { ID AssetID `gorm:"primary_key;"` // [PK] Asset CurrencyName CurrencyName `gorm:"index;unique_index:idx_currency_hash;not null;size:16"` // [FK] Currency, non mutable` Hash AssetHash `gorm:"index;unique_index:idx_currency_hash;not null;size:64"` // Asset Hash }
type AssetIcon ¶ added in v0.0.3
type AssetIcon struct { AssetID AssetID `gorm:"unique_index;not null"` // [FK] Reference to Asset table LastUpdate time.Time `gorm:"index;not null;type:timestamp"` // Last update timestamp Data []byte `gorm:"type:MEDIUMBLOB;default:null"` // Decoded data byte }
AssetIcon from https://assets.blockstream.info/icons.json
type AssetInfo ¶ added in v0.0.3
type AssetInfo struct { AssetID AssetID `gorm:"unique_index;not null"` // [FK] Reference to Asset table LastUpdate time.Time `gorm:"index;not null;type:timestamp"` // Last update timestamp Domain string `gorm:"index;not null;size:253"` // AssetDomaine name (RFC 1053) Name string `gorm:"index;not null;size:255"` // Asset unique asset name Ticker string `gorm:"index;not null;size:5"` // Asset unique ticker name Precision uint8 `gorm:"default:0;not null"` // Asset precision [0, 8] }
AssetInfo from https://assets.blockstream.info/
type Batch ¶ added in v0.0.5
type Batch struct { ID BatchID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp ExecuteAfter time.Time `gorm:"index;not null;type:timestamp"` // Execute after timestamp Capacity Int `gorm:"index;not null"` // Batch capacity Network BatchNetwork `gorm:"index;not null;size:24"` // Network [sepa, swift, card, bitcoin, bitcoin-testnet, liquid, lightning] Data BatchData `gorm:"type:blob;not null;default:'{}'"` // Batch data }
func (*Batch) IsComplete ¶ added in v0.0.5
type BatchInfo ¶ added in v0.0.5
type BatchInfo struct { ID BatchInfoID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp BatchID BatchID `gorm:"index;not null"` // [FK] Reference to Batch table Status BatchStatus `gorm:"index;not null;size:16"` // BatchStatus [created, processing, completed, canceled] Type encoding.DataType `gorm:"index;not null;size:16"` // DataType [crypto] Data BatchInfoData `gorm:"type:blob;not null;default:'{}'"` // BatchInfo data }
func (*BatchInfo) CryptoData ¶ added in v0.0.5
func (p *BatchInfo) CryptoData() (BatchInfoCryptoData, error)
type BatchInfoCryptoData ¶ added in v0.0.5
type BatchInfoCryptoData struct { TxID String `json:"txid,omitempty"` Height Int `json:"height,omitempty"` }
BatchInfoCryptoData data type for BatchInfo crypto
type BatchInfoData ¶ added in v0.0.5
type BatchInfoID ¶ added in v0.0.5
type BatchInfoID ID
type BatchNetwork ¶ added in v0.0.5
type BatchNetwork String
const ( BatchNetworkSepa BatchNetwork = "sepa" BatchNetworkSwift BatchNetwork = "swift" BatchNetworkCard BatchNetwork = "card" BatchNetworkBitcoin BatchNetwork = "bitcoin" BatchNetworkBitcoinTestnet BatchNetwork = "bitcoin-testnet" BatchNetworkBitcoinLiquid BatchNetwork = "liquid" BatchNetworkBitcoinLightning BatchNetwork = "lightning" )
type BatchStatus ¶ added in v0.0.5
type BatchStatus String
const ( BatchStatusCreated BatchStatus = "created" BatchStatusReady BatchStatus = "ready" BatchStatusProcessing BatchStatus = "processing" BatchStatusConfirmed BatchStatus = "confirmed" BatchStatusSettled BatchStatus = "settled" BatchStatusCanceled BatchStatus = "canceled" BatchInfoCrypto encoding.DataType = "crypto" )
type BatchWithdraw ¶ added in v0.0.5
type BatchWithdraw struct { BatchID BatchID `gorm:"unique_index:idx_batch_withdraw;index;not null"` // [FK] Reference to Batch table WithdrawID WithdrawID `gorm:"unique_index:idx_withdraw;unique_index:idx_batch_withdraw;not null"` // [FK] Reference to Withdraw table }
type Credential ¶
type CryptoAddress ¶ added in v0.0.3
type CryptoAddress struct { ID CryptoAddressID `gorm:"primary_key"` // [PK] CryptoAddress AccountID AccountID `gorm:"index;not null"` // [FK] Reference to Account table PublicAddress String `gorm:"unique_index;not null;size:128"` // CryptoAddress public key, non mutable Unconfidential String `gorm:"index;size:64"` // CryptoAddress unconfidential address, non mutable` Chain String `gorm:"index;not null;size:16"` // CryptoAddress chain, non mutable CreationDate *time.Time `gorm:"index;not null"` // CryptoAddress creation date, non mutable FirstBlockId BlockID `gorm:"index;not null"` // Block height of the first transaction IgnoreAccounting bool `gorm:"not null"` // This address is not for Accounting (change address) }
func (*CryptoAddress) Confirmations ¶ added in v0.0.3
func (p *CryptoAddress) Confirmations(height BlockID) int
func (*CryptoAddress) IsUsed ¶ added in v0.0.3
func (p *CryptoAddress) IsUsed() bool
type CryptoAddressID ¶ added in v0.0.3
type CryptoAddressID ID
type Currency ¶ added in v0.0.2
type Currency struct { Name CurrencyName `gorm:"primary_key;type:varchar(16)"` // [PK] Currency DisplayName CurrencyName `gorm:"type:varchar(32)"` Type ZeroInt `gorm:"default:0;not null"` // currencyType [Fiat=0, CryptoNative=1, CryptoAsset=2] Available ZeroInt `gorm:"default:0;not null"` Crypto ZeroInt `gorm:"default:0;not null"` Precision ZeroInt `gorm:"default:0;not null"` AutoCreate bool `gorm:"default:false"` // Automatic creation for accounts }
func NewCurrency ¶ added in v0.0.2
func NewCurrency(name, displayName CurrencyName, currencyType, available, crypto, precision Int) Currency
func (*Currency) DisplayPrecision ¶ added in v0.0.2
func (*Currency) IsAvailable ¶ added in v0.0.2
type CurrencyAvailable ¶ added in v0.0.2
type CurrencyAvailable ZeroInt
type CurrencyName ¶ added in v0.0.2
type CurrencyName String
type CurrencyRate ¶ added in v0.0.2
type CurrencyRate struct { ID CurrencyRateID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` Source CurrencyRateSource `gorm:"index;not null;type:varchar(16)"` Base CurrencyName `gorm:"index;not null;type:varchar(16)"` Name CurrencyName `gorm:"index;not null;type:varchar(16)"` Rate CurrencyRateValue `gorm:"not null"` }
type CurrencyRateID ¶ added in v0.0.2
type CurrencyRateID ID
type CurrencyRateSource ¶ added in v0.0.2
type CurrencyRateSource String
type CurrencyRateValue ¶ added in v0.0.2
type CurrencyRateValue Float
type Fee ¶ added in v0.0.5
type Fee struct { ID FeeID `gorm:"primary_key"` WithdrawID WithdrawID `gorm:"unique_index;not null"` // [FK] Reference to Withdraw table Amount ZeroFloat `gorm:"default:0;not null"` // Operation amount (can be negative) Data FeeData `gorm:"type:blob;not null;default:'{}'"` // Fee data }
type FeeInfo ¶ added in v0.0.5
type FeeInfo struct { Currency CurrencyName `gorm:"primary_key"` // [PK] Related currency Minimum Float `gorm:"default:0.0;not null"` // Minimum Fee Rate Float `gorm:"default:0.001;not null"` // Percent Fee Rate (default 0.1%) }
type OAuth ¶ added in v0.0.2
type OAuth struct { ID ID `gorm:"primary_key"` // [PK] OAuth Provider string `gorm:"unique_index:idx_prov_provid;not null;type:varchar(16)"` // [U] Provider name ProviderID string `gorm:"unique_index:idx_prov_provid;not null;type:varchar(64)"` // [U] Provider unique ID (from goth User.UserID) UserID UserID `gorm:"index;not null"` // [FK] Reference to User table. Same user can have multiple providers }
type OperationInfo ¶ added in v0.0.3
type OperationInfo struct { ID OperationInfoID `gorm:"primary_key;"` // [PK] OperationInfo CryptoAddressID CryptoAddressID `gorm:"index;not null"` // [FK] Reference to CryptoAddress table AssetID AssetID `gorm:"default:0;not null"` // [FK] Reference to Asset table, optional Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp TxID TxID `gorm:"unique_index;not null;size:64"` // Transaction ID Vout Vout `gorm:"default:0"` // Transaction output ID Amount Float `gorm:"default:0.0;not null"` // Operation amount (GTE 0.0) Data String `gorm:"type:json;not null"` // Specific operation json data }
type OperationInfoID ¶ added in v0.0.3
type OperationInfoID ID
type OperationStatus ¶ added in v0.0.3
type OperationStatus struct { OperationInfoID OperationInfoID `gorm:"unique_index;not null"` // [FK] Reference to OperationInfo table LastUpdate time.Time `gorm:"index;not null;type:timestamp"` // Last update timestamp State string `gorm:"index;not null;type:varchar(16)"` // [enum] Operation synchroneous state (received, confirmed, settled) Accounted string `gorm:"index;not null;type:varchar(16)"` // Accounted state (see State) }
type OperationType ¶ added in v0.0.2
type OperationType String
const ( OperationTypeInvalid OperationType = "" OperationTypeInit OperationType = "init" OperationTypeDeposit OperationType = "deposit" OperationTypeWithdraw OperationType = "withdraw" OperationTypeTransfer OperationType = "transfer" OperationTypeTransferFee OperationType = "transfer_fee" OperationTypeRefund OperationType = "refund" OperationTypeAdjustment OperationType = "adjustment" OperationTypeNone OperationType = "none" OperationTypeOther OperationType = "other" )
func ParseOperationType ¶ added in v0.0.2
func ParseOperationType(str string) OperationType
func (OperationType) String ¶ added in v0.0.2
func (p OperationType) String() string
func (OperationType) Valid ¶ added in v0.0.2
func (p OperationType) Valid() bool
type SsmAddress ¶ added in v0.0.5
type SsmAddress struct { ID SsmAddressID `gorm:"primary_key;"` // [PK] SsmAddress ID PublicAddress SsmPublicAddress `gorm:"unique_index;not null;size:126"` // Ssm Address, non mutable ScriptPubkey SsmPubkey `gorm:"not null;size:66"` // Ssm Script, non mutable BlindingKey SsmBlindingKey `gorm:"not null;size:64"` // Ssm BlindingKey, non mutable (optional) }
func (*SsmAddress) IsValid ¶ added in v0.0.5
func (p *SsmAddress) IsValid() bool
type SsmAddressID ¶ added in v0.0.5
type SsmAddressID ID
type SsmAddressInfo ¶ added in v0.0.5
type SsmAddressInfo struct { SsmAddressID SsmAddressID `gorm:"unique_index;not null"` // [FK] Reference to SsmAddress table Chain SsmChain `gorm:"index;not null;size:16"` // Ssm chain, non mutable Fingerprint SsmFingerprint `gorm:"index;not null;size:8"` // Ssm fingerprint, non mutable HDPath SsmHDPath `gorm:"index;not null;size:24"` // Ssm HDPath, non mutable }
func (*SsmAddressInfo) IsValid ¶ added in v0.0.5
func (p *SsmAddressInfo) IsValid() bool
type SsmAddressState ¶ added in v0.0.5
type SsmAddressState struct { ID SsmAddressStateID `gorm:"primary_key;"` // [PK] SsmAddressState ID SsmAddressID SsmAddressID `gorm:"index;not null"` // [FK] Reference to SsmAddress table Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp State SsmAddressStatus `gorm:"not null;size:64"` // Ssm State [unused, used, blacklisted] }
type SsmAddressStateID ¶ added in v0.0.5
type SsmAddressStateID ID
type SsmAddressStatus ¶ added in v0.0.5
type SsmAddressStatus String
type SsmBlindingKey ¶ added in v0.0.5
type SsmBlindingKey String
type SsmFingerprint ¶ added in v0.0.5
type SsmFingerprint String
type SsmPublicAddress ¶ added in v0.0.5
type SsmPublicAddress String
type Swap ¶ added in v0.0.4
type Swap struct { ID SwapID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp ValidUntil time.Time `gorm:"index;not null;type:timestamp"` // Valid Until Type SwapType `gorm:"index;not null;size:16"` // SwapType [bid, ask] CryptoAddressID CryptoAddressID `gorm:"index;not null"` // [FK] Reference to CryptoAddress table DebitAsset AssetID `gorm:"index;not null"` // [FK] Reference to Asset table for Debit DebitAmount Float `gorm:"default:0;not null"` // DebitAmount (strictly positive) CreditAsset AssetID `gorm:"index;not null"` // [FK] Reference to Asset table for Credit CreditAmount Float `gorm:"default:0;not null"` // CreditAmount (strictly positive) }
type SwapInfo ¶ added in v0.0.4
type SwapInfo struct { ID SwapInfoID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp SwapID SwapID `gorm:"index;not null"` // [FK] Reference to Swap table Status SwapStatus `gorm:"index;not null;size:16"` // SwapStatus [proposed, accepted, finalized, completed, canceled] Payload Payload `gorm:"type:blob;not null"` // Payload swap data }
type SwapInfoID ¶ added in v0.0.4
type SwapInfoID ID
type SwapStatus ¶ added in v0.0.4
type SwapStatus String
const ( SwapStatusProposed SwapStatus = "proposed" SwapStatusAccepted SwapStatus = "accepted" SwapStatusFinalized SwapStatus = "finalized" SwapStatusCompleted SwapStatus = "completed" SwapStatusCanceled SwapStatus = "canceled" )
type SynchroneousType ¶ added in v0.0.2
type SynchroneousType String
const ( SynchroneousTypeInvalid SynchroneousType = "" SynchroneousTypeSync SynchroneousType = "sync" SynchroneousTypeAsyncStart SynchroneousType = "async-start" SynchroneousTypeAsyncEnd SynchroneousType = "async-end" )
func ParseSynchroneousType ¶ added in v0.0.2
func ParseSynchroneousType(str string) SynchroneousType
func (SynchroneousType) String ¶ added in v0.0.2
func (p SynchroneousType) String() string
func (SynchroneousType) Valid ¶ added in v0.0.2
func (p SynchroneousType) Valid() bool
type Withdraw ¶ added in v0.0.5
type Withdraw struct { ID WithdrawID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp From AccountID `gorm:"index;not null"` // [FK] Reference to Account table To AccountID `gorm:"index;not null"` // [FK] Reference to Account table Amount ZeroFloat `gorm:"default:0;not null"` // Operation amount (can not be negative) Batch BatchMode `gorm:"index;not null;size:16"` // BatchMode [instant, fast, normal, slow] Data WithdrawData `gorm:"type:blob;not null;default:'{}'"` // Withdraw data }
type WithdrawData ¶ added in v0.0.5
type WithdrawData String
type WithdrawID ¶ added in v0.0.5
type WithdrawID ID
type WithdrawInfo ¶ added in v0.0.5
type WithdrawInfo struct { ID WithdrawInfoID `gorm:"primary_key"` Timestamp time.Time `gorm:"index;not null;type:timestamp"` // Creation timestamp WithdrawID WithdrawID `gorm:"index;not null"` // [FK] Reference to Withdraw table Status WithdrawStatus `gorm:"index;not null;size:16"` // WithdrawStatus [created, processing, completed, canceled] Data WithdrawInfoData `gorm:"type:blob;not null;default:'{}'"` // WithdrawInfo data }
type WithdrawInfoData ¶ added in v0.0.5
type WithdrawInfoData String
type WithdrawInfoID ¶ added in v0.0.5
type WithdrawInfoID ID
type WithdrawStatus ¶ added in v0.0.5
type WithdrawStatus String
const ( WithdrawStatusCreated WithdrawStatus = "created" WithdrawStatusProcessing WithdrawStatus = "processing" WithdrawStatusSettled WithdrawStatus = "settled" WithdrawStatusCanceling WithdrawStatus = "canceling" WithdrawStatusCanceled WithdrawStatus = "canceled" )
type WithdrawTarget ¶ added in v0.0.5
type WithdrawTarget struct { ID WithdrawTargetID `gorm:"primary_key"` WithdrawID WithdrawID `gorm:"index;not null"` // [FK] Reference to Withdraw table Type WithdrawTargetType `gorm:"index;not null;size:16"` // DataType [onchain, liquid, lightning, sepa, swift, card] Data WithdrawTargetData `gorm:"type:blob;not null;default:'{}'"` // WithdrawTarget data }
func FromCardData ¶ added in v0.0.5
func FromCardData(withdrawID WithdrawID, card WithdrawTargetCardData) WithdrawTarget
func FromLightningData ¶ added in v0.0.5
func FromLightningData(withdrawID WithdrawID, lightning WithdrawTargetLightningData) WithdrawTarget
func FromLiquidData ¶ added in v0.0.5
func FromLiquidData(withdrawID WithdrawID, liquid WithdrawTargetLiquidData) WithdrawTarget
func FromOnChainData ¶ added in v0.0.5
func FromOnChainData(withdrawID WithdrawID, chain string, onChain WithdrawTargetOnChainData) WithdrawTarget
func FromSepaData ¶ added in v0.0.5
func FromSepaData(withdrawID WithdrawID, sepa WithdrawTargetSepaData) WithdrawTarget
func FromSwiftData ¶ added in v0.0.5
func FromSwiftData(withdrawID WithdrawID, swift WithdrawTargetSwiftData) WithdrawTarget
func (*WithdrawTarget) CardData ¶ added in v0.0.5
func (p *WithdrawTarget) CardData() (WithdrawTargetCardData, error)
func (*WithdrawTarget) LightningData ¶ added in v0.0.5
func (p *WithdrawTarget) LightningData() (WithdrawTargetLightningData, error)
func (*WithdrawTarget) LiquidData ¶ added in v0.0.5
func (p *WithdrawTarget) LiquidData() (WithdrawTargetLiquidData, error)
func (*WithdrawTarget) OnChainData ¶ added in v0.0.5
func (p *WithdrawTarget) OnChainData() (WithdrawTargetOnChainData, error)
func (*WithdrawTarget) SepaData ¶ added in v0.0.5
func (p *WithdrawTarget) SepaData() (WithdrawTargetSepaData, error)
func (*WithdrawTarget) SwiftData ¶ added in v0.0.5
func (p *WithdrawTarget) SwiftData() (WithdrawTargetSwiftData, error)
type WithdrawTargetCardData ¶ added in v0.0.5
type WithdrawTargetCardData struct { WithdrawTargetFiatData PAN string `json:"pan,omitempty"` }
WithdrawTargetCardData data type for WithdrawTargetType card
type WithdrawTargetCryptoData ¶ added in v0.0.5
type WithdrawTargetCryptoData struct { Chain string `json:"chain,omitempty"` PublicKey string `json:"publickey,omitempty"` }
WithdrawTargetCryptoData data type for WithdrawTargetType crypto, liquid & lightning
type WithdrawTargetData ¶ added in v0.0.5
type WithdrawTargetFiatData ¶ added in v0.0.5
type WithdrawTargetFiatData struct {
Network string `json:"network,omitempty"`
}
WithdrawTargetFiatData data type for WithdrawTargetType sepa, swift & cb
type WithdrawTargetID ¶ added in v0.0.5
type WithdrawTargetID ID
type WithdrawTargetLightningData ¶ added in v0.0.5
type WithdrawTargetLightningData struct { WithdrawTargetCryptoData Invoice string `json:"invoice,omitempty"` }
WithdrawTargetLightningData data type for WithdrawTargetType Lightning
type WithdrawTargetLiquidData ¶ added in v0.0.5
type WithdrawTargetLiquidData struct {
WithdrawTargetCryptoData
}
WithdrawTargetLiquidData data type for WithdrawTargetType liquid
type WithdrawTargetOnChainData ¶ added in v0.0.5
type WithdrawTargetOnChainData struct {
WithdrawTargetCryptoData
}
WithdrawTargetOnChainData data type for WithdrawTargetType crypto
type WithdrawTargetSepaData ¶ added in v0.0.5
type WithdrawTargetSepaData struct { WithdrawTargetFiatData BIC string `json:"bic,omitempty"` IBAN string `json:"iban,omitempty"` }
WithdrawTargetSepaData data type for WithdrawTargetType sepa
type WithdrawTargetSwiftData ¶ added in v0.0.5
type WithdrawTargetSwiftData struct { WithdrawTargetFiatData CountryCode string `json:"country_code,omitempty"` Bank string `json:"bank,omitempty"` Account string `json:"account,omitempty"` }
WithdrawTargetSwiftData data type for WithdrawTargetType sepa
type WithdrawTargetType ¶ added in v0.0.5
const ( // Fiat WithdrawTargetSepa WithdrawTargetType = "sepa" WithdrawTargetSwift WithdrawTargetType = "swift" WithdrawTargetCard WithdrawTargetType = "card" // Crypto WithdrawTargetOnChain WithdrawTargetType = "onchain" WithdrawTargetLiquid WithdrawTargetType = "liquid" WithdrawTargetLightning WithdrawTargetType = "lightning" )
Source Files ¶
- FeeInfo.go
- account.go
- accountoperation.go
- accountstate.go
- asset.go
- asseticon.go
- assetinfo.go
- batch.go
- batchinfo.go
- batchwithdraw.go
- credential.go
- cryptoaddress.go
- currency.go
- currencyrate.go
- fee.go
- oauth.go
- operationinfo.go
- operationstatus.go
- operationtype.go
- ssmaddress.go
- ssmaddressinfo.go
- ssmaddressstate.go
- swap.go
- swapinfo.go
- synchroneoustype.go
- types.go
- user.go
- userrole.go
- utils.go
- withdraw.go
- withdrawinfo.go
- withdrawtarget.go