Documentation
¶
Index ¶
- Constants
- Variables
- func SendInvitationMessage(ctx context.Context, messengerClient message.MessengerClient, ...) error
- func SetupAssetsForProperNetwork(ctx context.Context, dbConnectionPool db.DBConnectionPool, ...) error
- func SetupWalletsForProperNetwork(ctx context.Context, dbConnectionPool db.DBConnectionPool, ...) error
- type AccountNotFoundError
- type AmbiguousReferenceError
- type AssetNotSupportedByWalletError
- type AssetReference
- type AssetResolver
- type AssetsNetworkByPlatformMapType
- type AssetsNetworkMapType
- type ChallengeRequest
- type ChallengeResponse
- type ChallengeValidationResult
- type CircleAccountNotActivatedError
- type CircleAssetNotSupportedError
- type CircleDistributionAccountService
- func (s *CircleDistributionAccountService) GetBalance(ctx context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
- func (s *CircleDistributionAccountService) GetBalances(ctx context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
- type CircleReconciliationService
- type CircleReconciliationServiceInterface
- type CreateDirectPaymentRequest
- type DirectPaymentService
- type DisbursementManagementService
- func (s *DisbursementManagementService) AppendUserMetadata(ctx context.Context, disbursements []*data.Disbursement) ([]*DisbursementWithUserMetadata, error)
- func (s *DisbursementManagementService) GetDisbursementReceiversWithCount(ctx context.Context, disbursementID string, queryParams *data.QueryParams) (*utils.ResultWithTotal, error)
- func (s *DisbursementManagementService) GetDisbursementsWithCount(ctx context.Context, queryParams *data.QueryParams) (*utils.ResultWithTotal, error)
- func (s *DisbursementManagementService) PauseDisbursement(ctx context.Context, disbursementID string, user *auth.User) error
- func (s *DisbursementManagementService) StartDisbursement(ctx context.Context, disbursementID string, user *auth.User, ...) error
- type DisbursementWithUserMetadata
- type DistributionAccountService
- type DistributionAccountServiceInterface
- type DistributionAccountServiceOptions
- type EntityResolver
- type InsufficientBalanceError
- type InsufficientBalanceForDirectPaymentError
- type MockSEP10Service
- type NotFoundError
- type PaymentFromSubmitterService
- type PaymentFromSubmitterServiceInterface
- type PaymentManagementService
- type PaymentToSubmitterService
- type PaymentToSubmitterServiceInterface
- type PaymentToSubmitterServiceOptions
- type ReadyPaymentsCancellationService
- type ReadyPaymentsCancellationServiceInterface
- type ReceiverReference
- type ReceiverResolver
- type ReceiverWalletNotFoundError
- type ReceiverWalletNotReadyForPaymentError
- type ResolverFactory
- type SEP10Service
- type SendInvitationMessageOptions
- type SendReceiverWalletInviteService
- type SendReceiverWalletInviteServiceInterface
- type StellarDistributionAccountService
- func (s *StellarDistributionAccountService) GetBalance(ctx context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
- func (s *StellarDistributionAccountService) GetBalances(_ context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
- type TrustlineNotFoundError
- type UnsupportedError
- type UserReference
- type ValidationError
- type ValidationRequest
- type ValidationResponse
- type WalletAssetResolver
- type WalletDeepLink
- type WalletNotEnabledError
- type WalletReference
- type WalletResolver
- type WalletsNetworkMapType
Constants ¶
const ( EntityTypeAsset = "asset" EntityTypeReceiver = "receiver" EntityTypeWallet = "wallet" )
Entity type constants
const ( FieldReference = "reference" FieldType = "type" FieldCode = "code" FieldIssuer = "issuer" FieldContractID = "contract_id" FieldEmail = "email" FieldPhoneNumber = "phone_number" FieldWalletAddress = "wallet_address" FieldAddress = "address" )
Field name constants
const ( AssetTypeNative = "native" AssetTypeClassic = "classic" AssetTypeContract = "contract" AssetTypeFiat = "fiat" )
Asset type constants
Variables ¶
var ( ErrDisbursementNotFound = errors.New("disbursement not found") ErrDisbursementNotReadyToStart = errors.New("disbursement is not ready to be started") ErrDisbursementNotReadyToPause = errors.New("disbursement is not ready to be paused") ErrDisbursementWalletDisabled = errors.New("disbursement wallet is disabled") ErrDisbursementStatusCantBeChanged = errors.New("disbursement status can't be changed to the requested status") ErrDisbursementStartedByCreator = errors.New("disbursement can't be started by its creator") )
var ( ErrPaymentNotFound = errors.New("payment not found") ErrPaymentNotReadyToCancel = errors.New("payment is not ready to be canceled") ErrPaymentStatusCantBeChanged = errors.New("payment status can't be changed to the requested status") )
var AssetsNetworkByPlatformMap = AssetsNetworkByPlatformMapType{ schema.StellarPlatform: StellarAssetsNetworkMap, schema.CirclePlatform: CircleAssetsNetworkMap, }
var CircleAssetsNetworkMap = AssetsNetworkMapType{ utils.PubnetNetworkType: []data.Asset{assets.EURCAssetPubnet, assets.USDCAssetPubnet}, utils.TestnetNetworkType: []data.Asset{assets.EURCAssetTestnet, assets.USDCAssetTestnet}, utils.FuturenetNetworkType: []data.Asset{assets.USDCAssetTestnet}, }
var DefaultWalletsNetworkMap = WalletsNetworkMapType{ utils.PubnetNetworkType: wallets.PubnetWallets, utils.TestnetNetworkType: wallets.TestnetWallets, utils.FuturenetNetworkType: wallets.FuturenetWallets, }
var ErrNoBalanceForAsset = errors.New("no balance for asset")
ErrNoBalanceForAsset signals that the distribution account has no balance for the requested asset.
var StellarAssetsNetworkMap = AssetsNetworkMapType{ utils.PubnetNetworkType: []data.Asset{assets.EURCAssetPubnet, assets.USDCAssetPubnet, assets.XLMAsset}, utils.TestnetNetworkType: []data.Asset{assets.EURCAssetTestnet, assets.USDCAssetTestnet, assets.XLMAsset}, utils.FuturenetNetworkType: []data.Asset{assets.XLMAsset}, }
Functions ¶
func SendInvitationMessage ¶
func SendInvitationMessage(ctx context.Context, messengerClient message.MessengerClient, models *data.Models, opts SendInvitationMessageOptions) error
func SetupAssetsForProperNetwork ¶
func SetupAssetsForProperNetwork(ctx context.Context, dbConnectionPool db.DBConnectionPool, network utils.NetworkType, distAccPlatform schema.Platform) error
SetupAssetsForProperNetwork updates and inserts assets for the given Network Passphrase (`network`). So it avoids the application having same asset code with multiple issuers.
func SetupWalletsForProperNetwork ¶
func SetupWalletsForProperNetwork(ctx context.Context, dbConnectionPool db.DBConnectionPool, network utils.NetworkType, walletsNetworkMap WalletsNetworkMapType) error
SetupWalletsForProperNetwork updates and inserts wallets for the given Network Passphrase (`network`). So it avoids the application having wallets that doesn't support the given network.
Types ¶
type AccountNotFoundError ¶
type AccountNotFoundError struct {
Address string
}
func (AccountNotFoundError) Error ¶
func (e AccountNotFoundError) Error() string
type AmbiguousReferenceError ¶
func (AmbiguousReferenceError) Error ¶
func (e AmbiguousReferenceError) Error() string
type AssetNotSupportedByWalletError ¶
func (AssetNotSupportedByWalletError) Error ¶
func (e AssetNotSupportedByWalletError) Error() string
type AssetReference ¶
type AssetReference struct {
ID *string `json:"id,omitempty"`
Type *string `json:"type,omitempty"` // "native", "classic", "contract", "fiat"
Code *string `json:"code,omitempty"`
Issuer *string `json:"issuer,omitempty"`
ContractID *string `json:"contract_id,omitempty"` // For future implementation
}
type AssetResolver ¶
type AssetResolver struct {
// contains filtered or unexported fields
}
func NewAssetResolver ¶
func NewAssetResolver(models *data.Models) *AssetResolver
func (*AssetResolver) Resolve ¶
func (ar *AssetResolver) Resolve(ctx context.Context, _ db.SQLExecuter, ref AssetReference) (*data.Asset, error)
func (*AssetResolver) Validate ¶
func (ar *AssetResolver) Validate(ref AssetReference) error
type AssetsNetworkByPlatformMapType ¶
type AssetsNetworkByPlatformMapType map[schema.Platform]AssetsNetworkMapType
type AssetsNetworkMapType ¶
type AssetsNetworkMapType map[utils.NetworkType][]data.Asset
type ChallengeRequest ¶
type ChallengeRequest struct {
Account string `json:"account" query:"account"`
Memo string `json:"memo,omitempty" query:"memo"`
HomeDomain string `json:"home_domain,omitempty" query:"home_domain"`
ClientDomain string `json:"client_domain,omitempty" query:"client_domain"`
}
func (*ChallengeRequest) Validate ¶
func (req *ChallengeRequest) Validate() error
type ChallengeResponse ¶
type CircleAccountNotActivatedError ¶
func (CircleAccountNotActivatedError) Error ¶
func (e CircleAccountNotActivatedError) Error() string
type CircleAssetNotSupportedError ¶
func (CircleAssetNotSupportedError) Error ¶
func (e CircleAssetNotSupportedError) Error() string
type CircleDistributionAccountService ¶
type CircleDistributionAccountService struct {
CircleService circle.ServiceInterface
NetworkType utils.NetworkType
}
func (*CircleDistributionAccountService) GetBalance ¶
func (s *CircleDistributionAccountService) GetBalance(ctx context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
func (*CircleDistributionAccountService) GetBalances ¶
func (s *CircleDistributionAccountService) GetBalances(ctx context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
type CircleReconciliationService ¶
type CircleReconciliationService struct {
Models *data.Models
CircleService circle.ServiceInterface
DistAccountResolver signing.DistributionAccountResolver
}
func (*CircleReconciliationService) Reconcile ¶
func (s *CircleReconciliationService) Reconcile(ctx context.Context) error
Reconcile reconciles the pending Circle transfer requests for the tenant in the context. It fetches the rows from circle_transfer_request where status is set to pending, and then fetches the transfer details from Circle API. It updates the status of the transfer request in the DB based on the status of the transfer in Circle. If the transfer reached a successful/failure status, it updates the payment status in the DB as well to reflect that.
type CreateDirectPaymentRequest ¶
type CreateDirectPaymentRequest struct {
Amount string `json:"amount"`
Asset AssetReference `json:"asset" validate:"required"`
Receiver ReceiverReference `json:"receiver" validate:"required"`
Wallet WalletReference `json:"wallet" validate:"required"`
ExternalPaymentID *string `json:"external_payment_id,omitempty"`
}
CreateDirectPaymentRequest represents service-level request for creating direct payment
type DirectPaymentService ¶
type DirectPaymentService struct {
Models *data.Models
DistributionAccountService DistributionAccountServiceInterface
Resolvers *ResolverFactory
SubmitterEngine engine.SubmitterEngine
}
func NewDirectPaymentService ¶
func NewDirectPaymentService( models *data.Models, distributionAccount DistributionAccountServiceInterface, submitterEngine engine.SubmitterEngine, ) *DirectPaymentService
func (*DirectPaymentService) CreateDirectPayment ¶
func (s *DirectPaymentService) CreateDirectPayment( ctx context.Context, req CreateDirectPaymentRequest, user *auth.User, distributionAccount *schema.TransactionAccount, ) (*data.Payment, error)
type DisbursementManagementService ¶
type DisbursementManagementService struct {
Models *data.Models
AuthManager auth.AuthManager
CrashTrackerClient crashtracker.CrashTrackerClient
DistributionAccountService DistributionAccountServiceInterface
}
DisbursementManagementService is a service for managing disbursements.
func (*DisbursementManagementService) AppendUserMetadata ¶
func (s *DisbursementManagementService) AppendUserMetadata(ctx context.Context, disbursements []*data.Disbursement) ([]*DisbursementWithUserMetadata, error)
func (*DisbursementManagementService) GetDisbursementReceiversWithCount ¶
func (s *DisbursementManagementService) GetDisbursementReceiversWithCount(ctx context.Context, disbursementID string, queryParams *data.QueryParams) (*utils.ResultWithTotal, error)
func (*DisbursementManagementService) GetDisbursementsWithCount ¶
func (s *DisbursementManagementService) GetDisbursementsWithCount(ctx context.Context, queryParams *data.QueryParams) (*utils.ResultWithTotal, error)
func (*DisbursementManagementService) PauseDisbursement ¶
func (s *DisbursementManagementService) PauseDisbursement(ctx context.Context, disbursementID string, user *auth.User) error
PauseDisbursement pauses a disbursement and all its payments.
func (*DisbursementManagementService) StartDisbursement ¶
func (s *DisbursementManagementService) StartDisbursement(ctx context.Context, disbursementID string, user *auth.User, distributionAccount *schema.TransactionAccount) error
StartDisbursement starts a disbursement and all its payments and receivers wallets.
type DisbursementWithUserMetadata ¶
type DisbursementWithUserMetadata struct {
data.Disbursement
CreatedBy UserReference `json:"created_by"`
StartedBy UserReference `json:"started_by"`
}
type DistributionAccountService ¶
type DistributionAccountService struct {
// contains filtered or unexported fields
}
func NewDistributionAccountService ¶
func NewDistributionAccountService(opts DistributionAccountServiceOptions) (*DistributionAccountService, error)
func (*DistributionAccountService) GetBalance ¶
func (s *DistributionAccountService) GetBalance(ctx context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
func (*DistributionAccountService) GetBalances ¶
func (s *DistributionAccountService) GetBalances(ctx context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
type DistributionAccountServiceInterface ¶
type DistributionAccountServiceInterface interface {
GetBalances(context context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
GetBalance(context context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
}
func NewStellarDistributionAccountService ¶
func NewStellarDistributionAccountService(horizonClient horizonclient.ClientInterface) (DistributionAccountServiceInterface, error)
type DistributionAccountServiceOptions ¶
type DistributionAccountServiceOptions struct {
HorizonClient horizonclient.ClientInterface
CircleService circle.ServiceInterface
NetworkType utils.NetworkType
}
func (DistributionAccountServiceOptions) Validate ¶
func (opts DistributionAccountServiceOptions) Validate() error
type EntityResolver ¶
type InsufficientBalanceError ¶
type InsufficientBalanceError struct {
DistributionAddress string
DisbursementID string
DisbursementAsset data.Asset
AvailableBalance decimal.Decimal
DisbursementAmount decimal.Decimal
TotalPendingAmount decimal.Decimal
}
func (InsufficientBalanceError) Error ¶
func (e InsufficientBalanceError) Error() string
type InsufficientBalanceForDirectPaymentError ¶
type InsufficientBalanceForDirectPaymentError struct {
Asset data.Asset
RequestedAmount decimal.Decimal
AvailableBalance decimal.Decimal
TotalPendingAmount decimal.Decimal
}
func (InsufficientBalanceForDirectPaymentError) Error ¶
func (e InsufficientBalanceForDirectPaymentError) Error() string
type MockSEP10Service ¶
MockSEP10Service is an autogenerated mock type for the SEP10Service type
func NewMockSEP10Service ¶
func NewMockSEP10Service(t interface {
mock.TestingT
Cleanup(func())
}) *MockSEP10Service
NewMockSEP10Service creates a new instance of MockSEP10Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockSEP10Service) CreateChallenge ¶
func (_m *MockSEP10Service) CreateChallenge(ctx context.Context, req ChallengeRequest) (*ChallengeResponse, error)
CreateChallenge provides a mock function with given fields: ctx, req
func (*MockSEP10Service) ValidateChallenge ¶
func (_m *MockSEP10Service) ValidateChallenge(ctx context.Context, req ValidationRequest) (*ValidationResponse, error)
ValidateChallenge provides a mock function with given fields: ctx, req
type NotFoundError ¶
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type PaymentFromSubmitterService ¶
type PaymentFromSubmitterService struct {
// contains filtered or unexported fields
}
PaymentFromSubmitterService is a service that monitors TSS transactions that were complete and sync their completion state with the SDP payments.
func NewPaymentFromSubmitterService ¶
func NewPaymentFromSubmitterService(models *data.Models, tssDBConnectionPool db.DBConnectionPool) *PaymentFromSubmitterService
NewPaymentFromSubmitterService is a PaymentFromSubmitterService constructor.
func (PaymentFromSubmitterService) SyncBatchTransactions ¶
func (s PaymentFromSubmitterService) SyncBatchTransactions(ctx context.Context, batchSize int, tenantID string) error
SyncBatchTransactions monitors TSS transactions that were complete and sync their completion state with the SDP payments.
type PaymentManagementService ¶
type PaymentManagementService struct {
// contains filtered or unexported fields
}
PaymentManagementService is a service for managing disbursements.
func NewPaymentManagementService ¶
func NewPaymentManagementService(models *data.Models, dbConnectionPool db.DBConnectionPool) *PaymentManagementService
NewPaymentManagementService is a factory function for creating a new PaymentManagementService.
func (*PaymentManagementService) CancelPayment ¶
func (s *PaymentManagementService) CancelPayment(ctx context.Context, paymentID string) error
CancelPayment update payment to status 'canceled'
type PaymentToSubmitterService ¶
type PaymentToSubmitterService struct {
// contains filtered or unexported fields
}
PaymentToSubmitterService is a service that pushes SDP's ready-to-pay payments to the transaction submission service.
func NewPaymentToSubmitterService ¶
func NewPaymentToSubmitterService(opts PaymentToSubmitterServiceOptions) *PaymentToSubmitterService
func (PaymentToSubmitterService) SendBatchPayments ¶
func (s PaymentToSubmitterService) SendBatchPayments(ctx context.Context, batchSize int) error
SendBatchPayments sends SDP's ready-to-pay payments (in batches) to the transaction submission service.
type PaymentToSubmitterServiceOptions ¶
type PaymentToSubmitterServiceOptions struct {
Models *data.Models
DistAccountResolver signing.DistributionAccountResolver
PaymentDispatcher paymentdispatchers.PaymentDispatcherInterface
}
type ReadyPaymentsCancellationService ¶
type ReadyPaymentsCancellationService struct {
// contains filtered or unexported fields
}
func NewReadyPaymentsCancellationService ¶
func NewReadyPaymentsCancellationService(models *data.Models) *ReadyPaymentsCancellationService
func (ReadyPaymentsCancellationService) CancelReadyPayments ¶
func (s ReadyPaymentsCancellationService) CancelReadyPayments(ctx context.Context) error
CancelReadyPayments cancels SDP's ready-to-pay payments that are older than the specified period.
type ReceiverReference ¶
type ReceiverReference struct {
ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
PhoneNumber *string `json:"phone_number,omitempty"`
WalletAddress *string `json:"wallet_address,omitempty"`
}
func (ReceiverReference) GetContactInfo ¶
func (r ReceiverReference) GetContactInfo() string
type ReceiverResolver ¶
type ReceiverResolver struct {
// contains filtered or unexported fields
}
func NewReceiverResolver ¶
func NewReceiverResolver(models *data.Models) *ReceiverResolver
func (*ReceiverResolver) Resolve ¶
func (r *ReceiverResolver) Resolve(ctx context.Context, sqlExec db.SQLExecuter, ref ReceiverReference) (*data.Receiver, error)
func (*ReceiverResolver) Validate ¶
func (r *ReceiverResolver) Validate(ref ReceiverReference) error
type ReceiverWalletNotFoundError ¶
func (ReceiverWalletNotFoundError) Error ¶
func (e ReceiverWalletNotFoundError) Error() string
type ReceiverWalletNotReadyForPaymentError ¶
type ReceiverWalletNotReadyForPaymentError struct {
CurrentStatus data.ReceiversWalletStatus
}
func (ReceiverWalletNotReadyForPaymentError) Error ¶
func (e ReceiverWalletNotReadyForPaymentError) Error() string
type ResolverFactory ¶
type ResolverFactory struct {
// contains filtered or unexported fields
}
func NewResolverFactory ¶
func NewResolverFactory(models *data.Models) *ResolverFactory
func (*ResolverFactory) Asset ¶
func (rf *ResolverFactory) Asset() *AssetResolver
func (*ResolverFactory) Receiver ¶
func (rf *ResolverFactory) Receiver() *ReceiverResolver
func (*ResolverFactory) Wallet ¶
func (rf *ResolverFactory) Wallet() *WalletResolver
type SEP10Service ¶
type SEP10Service interface {
CreateChallenge(ctx context.Context, req ChallengeRequest) (*ChallengeResponse, error)
ValidateChallenge(ctx context.Context, req ValidationRequest) (*ValidationResponse, error)
}
func NewSEP10Service ¶
func NewSEP10Service( jwtManager *sepauth.JWTManager, networkPassphrase string, sep10SigningPrivateKey string, baseURL string, allowHTTPRetry bool, horizonClient horizonclient.ClientInterface, clientAttributionRequired bool, ) (SEP10Service, error)
type SendInvitationMessageOptions ¶
type SendInvitationMessageOptions struct {
FirstName string
Email string
Role string
UIBaseURL string
}
func (SendInvitationMessageOptions) Validate ¶
func (o SendInvitationMessageOptions) Validate() error
type SendReceiverWalletInviteService ¶
type SendReceiverWalletInviteService struct {
Models *data.Models
// contains filtered or unexported fields
}
func NewSendReceiverWalletInviteService ¶
func NewSendReceiverWalletInviteService(models *data.Models, messageDispatcher message.MessageDispatcherInterface, sep10SigningPrivateKey string, maxInvitationResendAttempts int64, crashTrackerClient crashtracker.CrashTrackerClient) (*SendReceiverWalletInviteService, error)
func (SendReceiverWalletInviteService) GetRegistrationLink ¶
func (s SendReceiverWalletInviteService) GetRegistrationLink(ctx context.Context, wdl WalletDeepLink, isLinkShortenerEnabled bool) (string, error)
func (SendReceiverWalletInviteService) SendInvite ¶
func (s SendReceiverWalletInviteService) SendInvite(ctx context.Context) error
SendInvite sends the invitation’s deep link to the wallet’s application. The approach to sending the invitation is to send the deep link for each asset the wallet will pay based on the payment. For instance, the Wallet Foo is in two Ready Payments, one with USDC and the other with EUROC. So the receiver who has a Stellar Address pending registration (status:READY) in this wallet will receive both invites for USDC and EUROC. This would not impact the user receiving both token amounts. It's only for the registration process.
type StellarDistributionAccountService ¶
type StellarDistributionAccountService struct {
// contains filtered or unexported fields
}
func (*StellarDistributionAccountService) GetBalance ¶
func (s *StellarDistributionAccountService) GetBalance(ctx context.Context, account *schema.TransactionAccount, asset data.Asset) (decimal.Decimal, error)
func (*StellarDistributionAccountService) GetBalances ¶
func (s *StellarDistributionAccountService) GetBalances(_ context.Context, account *schema.TransactionAccount) (map[data.Asset]decimal.Decimal, error)
type TrustlineNotFoundError ¶
func (TrustlineNotFoundError) Error ¶
func (e TrustlineNotFoundError) Error() string
type UnsupportedError ¶
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string
type UserReference ¶
type ValidationError ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type ValidationRequest ¶
type ValidationRequest struct {
Transaction string `json:"transaction" form:"transaction"`
}
func (*ValidationRequest) Validate ¶
func (req *ValidationRequest) Validate() error
type ValidationResponse ¶
type ValidationResponse struct {
Token string `json:"token"`
}
type WalletAssetResolver ¶
type WalletAssetResolver struct {
// contains filtered or unexported fields
}
func NewWalletAssetResolver ¶
func NewWalletAssetResolver(assetModel *data.AssetModel) *WalletAssetResolver
func (*WalletAssetResolver) ResolveAssetReferences ¶
func (ar *WalletAssetResolver) ResolveAssetReferences(ctx context.Context, references []validators.AssetReference) ([]string, error)
func (*WalletAssetResolver) ValidateAssetIDs ¶
func (ar *WalletAssetResolver) ValidateAssetIDs(ctx context.Context, assetIDs []string) error
type WalletDeepLink ¶
type WalletDeepLink struct {
// DeepLink is the deep link used to open the wallet invitation link.
DeepLink string
// Route is an optional parameter that can be used to specify the route to open in the wallet, in case it's not already present in the DeepLink.
Route string // (optional)
// OrganizationName is the name of the organization that is sending the invitation.
OrganizationName string
// AssetCode is the code of the Stellar asset that the receiver will be able to receive.
AssetCode string
// AssetIssuer is the issuer of the Stellar asset that the receiver will be able to receive.
AssetIssuer string
// TenantBaseURL is the base URL for the tenant that the receiver wallet belongs to.
TenantBaseURL string
}
func (WalletDeepLink) BaseURLWithRoute ¶
func (wdl WalletDeepLink) BaseURLWithRoute() (string, error)
BaseURLWithRoute returns the base URL of the deep link with the route appended.
func (WalletDeepLink) GetSignedRegistrationLink ¶
func (wdl WalletDeepLink) GetSignedRegistrationLink(stellarSecretKey string) (string, error)
GetSignedRegistrationLink will return the registration link accompanied with an extra query parameter containing the signature of the registration link, where the signature is created using the stellarSecretKey with the unsigned link as the message, keeping in mind that the insigned link query parameters were sorted in alphabetical order to generate the signature.
func (WalletDeepLink) GetUnsignedRegistrationLink ¶
func (wdl WalletDeepLink) GetUnsignedRegistrationLink() (string, error)
GetUnsignedRegistrationLink creates a deep link for the wallet registration using the format below: <deep_link></route>?<domain>&<name>&<asset>.
func (WalletDeepLink) TomlFileDomain ¶
func (wdl WalletDeepLink) TomlFileDomain() (string, error)
type WalletNotEnabledError ¶
type WalletNotEnabledError struct {
WalletName string
}
func (WalletNotEnabledError) Error ¶
func (e WalletNotEnabledError) Error() string
type WalletReference ¶
type WalletResolver ¶
type WalletResolver struct {
// contains filtered or unexported fields
}
func NewWalletResolver ¶
func NewWalletResolver(models *data.Models) *WalletResolver
func (*WalletResolver) Resolve ¶
func (r *WalletResolver) Resolve(ctx context.Context, dbTx db.SQLExecuter, ref WalletReference) (*data.Wallet, error)
func (*WalletResolver) Validate ¶
func (r *WalletResolver) Validate(ref WalletReference) error
type WalletsNetworkMapType ¶
type WalletsNetworkMapType map[utils.NetworkType][]data.Wallet
Source Files
¶
- asset_resolver.go
- circle_reconciliation_service.go
- direct_payment_resolvers.go
- direct_payment_service.go
- disbursement_management_service.go
- distribution_account_service.go
- payment_from_submitter_service.go
- payment_management_service.go
- payment_to_submitter_service.go
- ready_payments_cancellation_service.go
- send_invitation_message.go
- send_receiver_wallets_invite_service.go
- sep10_service.go
- sep10_service_mock.go
- setup_assets_for_network_service.go
- setup_wallets_for_network_service.go