mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
- go.mod module path + all self-imports: github.com/formancehq/payments -> github.com/hanzo-fi/payments (1590 .go files / 3152 refs; 20 modules: root, pkg/client, pkg/domain, 18 ce/plugins). External dep kept: formancehq/go-libs. - plugins: each ce/plugins/* consumed a *published* pkg/domain; added local 'replace .../pkg/domain => ../../../pkg/domain' (consistent with root) so every standalone plugin module builds in-monorepo. compile-plugin.sh MOD var rebranded too. - branding: README, LICENSE (dual MIT+EE; upstream copyright retained + Hanzo added), goreleaser (release images -> registry.hanzo.ai/hanzo-fi, OCI labels, homepage), proto go_package, renovate, speakeasy gen.yaml, connector-template *.gotpl. - CI: removed Numary/Formance workflows + composite action; added canonical hanzo.yml + cicd.yml (hanzoai/ci, gated HANZO_CI_ENABLED) + secretless ci.yml (go build/vet). - kept as data/compat keys: wire capability enums ALLOW_FORMANCE_*, generated SDK type client.Formance, domain field FormanceRedirectURL, OTEL_SERVICE_NAME, upstream base image. - verified: go build ./... (default + -tags ee) + all 20 nested modules green.
185 lines
4.6 KiB
Go
185 lines
4.6 KiB
Go
// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
|
|
package components
|
|
|
|
import (
|
|
"github.com/hanzo-fi/payments/pkg/client/internal/utils"
|
|
"math/big"
|
|
"time"
|
|
)
|
|
|
|
// V3Conversion - A currency or asset conversion executed on a PSP (e.g. Coinbase Prime
|
|
// transfer between a USD and USDC wallet). Conversions are read-only in
|
|
// the Formance API: they are fetched from the underlying connector.
|
|
// Unlike orders, conversions do not carry an adjustment history —
|
|
// Formance records the final state only.
|
|
type V3Conversion struct {
|
|
// Formance-assigned unique conversion ID.
|
|
ID string `json:"id"`
|
|
// ID of the Formance connector this conversion was fetched from.
|
|
ConnectorID string `json:"connectorID"`
|
|
// Provider name of the connector (e.g. `coinbaseprime`).
|
|
Provider string `json:"provider"`
|
|
// PSP-assigned conversion reference. Unique within the connector.
|
|
Reference string `json:"reference"`
|
|
// When the conversion was initiated on the PSP.
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
// When Formance last observed a state change on the conversion.
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
// Asset being converted from, in `SYMBOL/precision` form (e.g. `USD/2`).
|
|
SourceAsset string `json:"sourceAsset"`
|
|
// Asset being converted to, in `SYMBOL/precision` form (e.g. `USDC/6`).
|
|
DestinationAsset string `json:"destinationAsset"`
|
|
// Amount of source asset debited, as an integer at `sourceAsset` precision.
|
|
SourceAmount *big.Int `json:"sourceAmount"`
|
|
// Amount of destination asset credited, at `destinationAsset` precision. Null until the conversion completes.
|
|
DestinationAmount *big.Int `json:"destinationAmount,omitempty"`
|
|
// PSP fee for the conversion, at `feeAsset` precision.
|
|
Fee *big.Int `json:"fee,omitempty"`
|
|
// Currency the fee is denominated in, in `SYMBOL/precision` form.
|
|
FeeAsset *string `json:"feeAsset,omitempty"`
|
|
// Lifecycle of a conversion.
|
|
// `PENDING` — accepted by the PSP, not yet settled.
|
|
// `COMPLETED` — settled, terminal.
|
|
// `FAILED` — rejected or reverted, terminal. See `error`.
|
|
//
|
|
Status V3ConversionStatusEnum `json:"status"`
|
|
// Formance account ID of the wallet the source asset was debited from.
|
|
SourceAccountID *string `json:"sourceAccountID,omitempty"`
|
|
// Formance account ID of the wallet the destination asset was credited to.
|
|
DestinationAccountID *string `json:"destinationAccountID,omitempty"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
// Human-readable error from the PSP when `status` is `FAILED`. Null otherwise.
|
|
Error *string `json:"error,omitempty"`
|
|
}
|
|
|
|
func (v V3Conversion) MarshalJSON() ([]byte, error) {
|
|
return utils.MarshalJSON(v, "", false)
|
|
}
|
|
|
|
func (v *V3Conversion) UnmarshalJSON(data []byte) error {
|
|
if err := utils.UnmarshalJSON(data, &v, "", false, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *V3Conversion) GetID() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ID
|
|
}
|
|
|
|
func (o *V3Conversion) GetConnectorID() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.ConnectorID
|
|
}
|
|
|
|
func (o *V3Conversion) GetProvider() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Provider
|
|
}
|
|
|
|
func (o *V3Conversion) GetReference() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.Reference
|
|
}
|
|
|
|
func (o *V3Conversion) GetCreatedAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.CreatedAt
|
|
}
|
|
|
|
func (o *V3Conversion) GetUpdatedAt() time.Time {
|
|
if o == nil {
|
|
return time.Time{}
|
|
}
|
|
return o.UpdatedAt
|
|
}
|
|
|
|
func (o *V3Conversion) GetSourceAsset() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.SourceAsset
|
|
}
|
|
|
|
func (o *V3Conversion) GetDestinationAsset() string {
|
|
if o == nil {
|
|
return ""
|
|
}
|
|
return o.DestinationAsset
|
|
}
|
|
|
|
func (o *V3Conversion) GetSourceAmount() *big.Int {
|
|
if o == nil {
|
|
return big.NewInt(0)
|
|
}
|
|
return o.SourceAmount
|
|
}
|
|
|
|
func (o *V3Conversion) GetDestinationAmount() *big.Int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.DestinationAmount
|
|
}
|
|
|
|
func (o *V3Conversion) GetFee() *big.Int {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Fee
|
|
}
|
|
|
|
func (o *V3Conversion) GetFeeAsset() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.FeeAsset
|
|
}
|
|
|
|
func (o *V3Conversion) GetStatus() V3ConversionStatusEnum {
|
|
if o == nil {
|
|
return V3ConversionStatusEnum("")
|
|
}
|
|
return o.Status
|
|
}
|
|
|
|
func (o *V3Conversion) GetSourceAccountID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.SourceAccountID
|
|
}
|
|
|
|
func (o *V3Conversion) GetDestinationAccountID() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.DestinationAccountID
|
|
}
|
|
|
|
func (o *V3Conversion) GetMetadata() map[string]string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Metadata
|
|
}
|
|
|
|
func (o *V3Conversion) GetError() *string {
|
|
if o == nil {
|
|
return nil
|
|
}
|
|
return o.Error
|
|
}
|