v1

package
v0.0.0-...-45ef346 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(jwtSecretKey string) gin.HandlerFunc

func CORSMiddleware

func CORSMiddleware(cfg config.HTTP, l *logger.Logger) gin.HandlerFunc

func CORSMiddlewareAllowAllOrigins

func CORSMiddlewareAllowAllOrigins(l *logger.Logger) gin.HandlerFunc

func GenerateJWT

func GenerateJWT(user entity.User, jwtSecretKey string) (tokenString string, err error)

func NewRouter

func NewRouter(
	handler *gin.Engine,
	pKp, pHor, pEnv, pSub, pSig entity.ProducerInterface,
	authUseCase usecase.AuthUseCase,
	userUseCase usecase.UserUseCase,
	walletUseCase usecase.WalletUseCase,
	assetUseCase usecase.AssetUseCase,
	roleUseCase usecase.RoleUseCase,
	rolePermissionUc usecase.RolePermissionUseCase,
	vaultCategoryUc usecase.VaultCategoryUseCase,
	vaultUc usecase.VaultUseCase,
	contractUc usecase.ContractUseCase,
	logUc usecase.LogTransactionUseCase,
	cfg config.HTTP,
	logger *logger.Logger,
	profanityF profanity.ProfanityFilter,
)

Swagger spec: @title Token Factory API @version 1.0 @BasePath /

func ValidateToken

func ValidateToken(signedToken string, jwtSecretKey string) (err error)

Types

type AddContractHistoryRequest

type AddContractHistoryRequest struct {
	DepositAmount float64 `json:"deposit_amount"   binding:"required"  example:"100"`
	ContractId    int     `json:"contract_id"   binding:"required"  example:"GSDSC..."`
}

type BurnAssetRequest

type BurnAssetRequest struct {
	Id               string  `json:"id"       binding:"required"  example:"001"`
	SponsorId        int     `json:"sponsor_id"        example:"2"`
	Amount           string  `json:"amount"       binding:"required"  example:"1000"`
	CurrentSupply    float64 `json:"current_supply"       example:"1000"`
	CurrentMainVault float64 `json:"current_main_vault"       example:"1000"`
}

type ClawbackAssetRequest

type ClawbackAssetRequest struct {
	SponsorId        int     `json:"sponsor_id"   example:"2"`
	Code             string  `json:"code"       binding:"required"  example:"USDC"`
	Amount           string  `json:"amount"       binding:"required"  example:"1000"`
	From             string  `json:"from"       binding:"required"  example:"GDKIJJIKXLOM2NRMPNQZUUYK24ZPVFC6426GZAICZ6E5PQG2MIPIMB2L"`
	CurrentSupply    float64 `json:"current_supply"       example:"1000"`
	CurrentMainVault float64 `json:"current_main_vault"       example:"1000"`
}

type CreateAssetRequest

type CreateAssetRequest struct {
	SponsorId int      `json:"sponsor_id"    example:"2"`
	Name      string   `json:"name"       binding:"required"  example:"USDC"`
	AssetType string   `json:"asset_type"       binding:"required"  example:"security_token"`
	Code      string   `json:"code"       binding:"required"  example:"USDC"`
	Limit     *int     `json:"limit"         example:"1000"`
	Amount    string   `json:"amount"        example:"1000"`
	SetFlags  []string `json:"set_flags"       example:"[\"AUTH_REQUIRED_FLAGS\", \"AUTH_REVOCABLE_FLAGS\",\"AUTH_CLAWBACK_ENABLED\"]"`
	Image     string   `json:"image"        example:"iVBORw0KGgoAAAANSUhEUgAACqoAAAMMCAMAAAAWqpRaAAADAFBMVEX///..."`
}

type CreateContractRequest

type CreateContractRequest struct {
	Name        string `json:"name" binding:"required" example:"Treasury"`
	AssetId     string `json:"asset_id"   binding:"required"  example:"1"`
	VaultId     string `json:"vault_id"   binding:"required"  example:"1"`
	Address     string `json:"address"   binding:"required"  example:"GSDSC..."`
	YieldRate   int    `json:"yield_rate"   binding:"required"  example:"1"`
	Term        int    `json:"term"   binding:"required"  example:"60"`
	MinDeposit  int    `json:"min_deposit"   binding:"required"  example:"1"`
	PenaltyRate int    `json:"penalty_rate"   binding:"required"  example:"1"`
	Compound    int    `json:"compound"  example:"1"`
}

type CreateVaultCategoryRequest

type CreateVaultCategoryRequest struct {
	Name  string `json:"name"       binding:"required"  example:"Treasury"`
	Theme string `json:"theme"      example:"blue"`
}

type CreateVaultRequest

type CreateVaultRequest struct {
	Name            string `json:"name" binding:"required" example:"Treasury"`
	VaultCategoryId *int   `json:"vault_category_id" example:"1"`
	AssetsId        []int  `json:"assets_id" binding:"required"`
	OwnerId         *int   `json:"owner_id"`
}

type CreateWalletRequest

type CreateWalletRequest struct {
	Type string `json:"type"       binding:"required"  example:"sponsor"`
}

type FiltersRequest

type FiltersRequest struct {
	TimeRange     string `json:"time_range"        example:"hour"`
	PeriodInitial string `json:"period_initial"        example:"24 hours"`
	Interval      string `json:"interval"        example:"1 hour"`
}

type FundWalletRequest

type FundWalletRequest struct {
	Id int `json:"id"       binding:"required"  example:"1"`
}

type HTTPControllerMessenger

type HTTPControllerMessenger struct {
	// contains filtered or unexported fields
}

func (*HTTPControllerMessenger) SendMessage

func (m *HTTPControllerMessenger) SendMessage(chanName string, value interface{}) (*entity.NotifyData, error)

type JWTClaim

type JWTClaim struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
	jwt.StandardClaims
}

type MintAssetRequest

type MintAssetRequest struct {
	Id               string  `json:"id"       binding:"required"  example:"12"`
	SponsorId        int     `json:"sponsor_id"       example:"2"`
	Code             string  `json:"code"       binding:"required"  example:"USDC"`
	Amount           string  `json:"amount"       binding:"required"  example:"1000"`
	CurrentSupply    float64 `json:"current_supply"       example:"1000"`
	CurrentMainVault float64 `json:"current_main_vault"       example:"1000"`
}

type PaginatedAssetsResponse

type PaginatedAssetsResponse struct {
	Assets     []entity.Asset `json:"assets"`
	TotalPages int            `json:"totalPages"`
}

type PaginatedContractsResponse

type PaginatedContractsResponse struct {
	Contracts  []entity.Contract `json:"contracts"`
	TotalPages int               `json:"totalPages"`
}

type PaginatedVaultsResponse

type PaginatedVaultsResponse struct {
	Vaults     []entity.Vault `json:"vaults"`
	TotalPages int            `json:"totalPages"`
}

type PriceConversionResponse

type PriceConversionResponse struct {
	Status string  `json:"status"`
	XLM    float64 `json:"XLM"`
	USD    float64 `json:"USD"`
}

type RolePermissionRequest

type RolePermissionRequest struct {
	RoleId       int  `json:"role_id" example:"1"`
	PermissionId int  `json:"permission_id" example:"1"`
	IsAdd        bool `json:"is_add" example:"false"`
}

type SignedTransactionRequest

type SignedTransactionRequest struct {
	Envelope string `json:"envelope"       binding:"required"  example:"KJDSKD..."`
	WalletPk string `json:"wallet_pk"       example:"GDSKJG..."`
}

type SubmitTransactionRequest

type SubmitTransactionRequest struct {
	Envelope string `json:"envelope"       binding:"required"  example:"KJDSKD..."`
}

type TransferAssetRequest

type TransferAssetRequest struct {
	SourceWalletID      int     `json:"source_wallet_id" binding:"required" example:"1"`
	SponsorId           int     `json:"sponsor_id" example:"2"`
	DestinationWalletPK string  `json:"destination_wallet_pk" binding:"required" example:"GABCD...."`
	AssetID             string  `json:"asset_id" binding:"required" example:"12"`
	Amount              string  `json:"amount" binding:"required" example:"12"`
	CurrentSupply       float64 `json:"current_supply"       example:"1000"`
	CurrentMainVault    float64 `json:"current_main_vault"       example:"1000"`
}

type UpdateAuthFlagsRequest

type UpdateAuthFlagsRequest struct {
	TrustorId  int      `json:"trustor_id"  example:"2"`
	Issuer     int      `json:"issuer"       binding:"required"  example:"2"`
	Code       string   `json:"code"       binding:"required"  example:"USDC"`
	SetFlags   []string `` /* 139-byte string literal not displayed */
	ClearFlags []string `json:"clear_flags"  example:"[\"TRUST_LINE_CLAWBACK_ENABLED\"]"`
	TrustorPK  string   `json:"trustor_pk"   example:"2"`
}

type UpdateContractHistoryRequest

type UpdateContractHistoryRequest struct {
	WithdrawAmount float64 `json:"withdraw_amount"   binding:"required"  example:"100"`
	ContractId     int     `json:"contract_id"   binding:"required"  example:"GSDSC..."`
}

type UpdateContractIdRequest

type UpdateContractIdRequest struct {
	ContractId string `json:"contract_id" example:"iVBORw0KGgoAAAANSUhEUgAACqoAAAMMCAMAAAAWqpRaAAADAFBMVEX///..."`
}

type UpdateNameRequest

type UpdateNameRequest struct {
	Name string `json:"name" binding:"required" example:"USD Coin"`
	Code string `json:"code" binding:"required" example:"USDC"`
}

type UpdateVaultAssetRequest

type UpdateVaultAssetRequest struct {
	AssetCode     string `json:"asset_code"   binding:"required"  example:"1"`
	AssetIssuerPK string `json:"asset_issuer_pk"   binding:"required"  example:"1"`
	IsAdd         bool   `json:"is_add"   example:"true"`
	IsRemove      bool   `json:"is_remove"   example:"false"`
}

type UpdateVaultCategoryRequest

type UpdateVaultCategoryRequest struct {
	Name            string `json:"name" example:"Vault 2"`
	VaultCategoryId int    `json:"vault_category_id"   binding:"required"  example:"1"`
}

type UploadAssetImageRequest

type UploadAssetImageRequest struct {
	Image string `json:"image"        example:"iVBORw0KGgoAAAANSUhEUgAACqoAAAMMCAMAAAAWqpRaAAADAFBMVEX///..."`
}

type UserPermissionsResponse

type UserPermissionsResponse struct {
	Permissions []entity.UserPermissionResponse `json:"permissions"`
	Admin       bool                            `json:"admin" example:"true"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL