assets

package
v0.0.0-...-1305305 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LOGGER = logging.MustGetLogger("assets")

Functions

This section is empty.

Types

type AssetOperations

type AssetOperations struct {
	PRServiceClient  pr_client.PRServiceClient
	GasServiceClient gasserviceclient.GasServiceClient
	DbSession        *database.MongoClient
	// contains filtered or unexported fields
}

func CreateAssetOperations

func CreateAssetOperations() (AssetOperations, error)

func (AssetOperations) AssetBalance

func (ap AssetOperations) AssetBalance(w http.ResponseWriter, req *http.Request)

func (AssetOperations) AssetBalances

func (ap AssetOperations) AssetBalances(w http.ResponseWriter, req *http.Request)

AssetBalances - Get input parameters (assetCode, assetIssuer) from request

Load issuer from node config and compare it with the issuer in request parameter.
Don't proceed if the issuers are different
Query the stellar db for all accounts with non-zero balance for the asset

func (AssetOperations) CreateOrAllowTrust

func (ap AssetOperations) CreateOrAllowTrust(w http.ResponseWriter, req *http.Request)

CreateOrAllowTrust - create trust for an asset

func (AssetOperations) GetAB

func (ap AssetOperations) GetAB(req *http.Request) (string, string, error)

GetAB : get asset balance

func (AssetOperations) GetOutstandingBalance

func (ap AssetOperations) GetOutstandingBalance(w http.ResponseWriter, req *http.Request)

GetOutstandingBalance : return outstanding balance of an asset issued by the caller

func (AssetOperations) IssueAsset

func (ap AssetOperations) IssueAsset(w http.ResponseWriter, req *http.Request)

IssueAsset - if asset type is DA, reject this request. Only Anchors can issue a Digital Asset

Receives asset_code as the input. "asset_code" is a string parameter (example: USD, CAD, EUR NZD)
Queries Issuing Account from Node Config file
Queries IBM Token Account from Node Config file
Invoke change trust operation using Stellar SDK. This will make the IBM Token Account trust the asset
This asset will have issuing account as the issuer.
After executing this function, results can be verified by invoking the following URL:
https://horizon-testnet.stellar.org/accounts/{IBM_Token_account_id} (For test net)
https://horizon.stellar.org/accounts/{IBM_Token_account_id} (For Pub net)

func (AssetOperations) IssuedAssets

func (ap AssetOperations) IssuedAssets(w http.ResponseWriter, req *http.Request)

IssuedAssets -

Get a list of all the assets that have been issued by this participant on World Wire

func (AssetOperations) SuccessResponse

func (ap AssetOperations) SuccessResponse(code, issuer, AssetType string) *model.Asset

func (AssetOperations) TrustedAssets

func (ap AssetOperations) TrustedAssets(accountAddress string) ([]*model.Asset, error)

TrustedAssets - return trusted assets for the given accountAddres

func (AssetOperations) TrustedAssetsForAccount

func (ap AssetOperations) TrustedAssetsForAccount(w http.ResponseWriter, req *http.Request)

TrustedAssetsForAccount : get trusted assets for a operating account.

func (AssetOperations) TrustedAssetsForIA

func (ap AssetOperations) TrustedAssetsForIA(w http.ResponseWriter, req *http.Request)

TrustedAssetsForIA - get trusted assets for a issuing account.

func (AssetOperations) WorldWireAssets

func (ap AssetOperations) WorldWireAssets(w http.ResponseWriter, req *http.Request)

WorldWireAssets : handler to process WorldWireAssets

type Trustline

type Trustline struct {
	// Log for successful trust operation
	ID             *string `json:"id" bson:"id"`
	TimeUpdated    *int64  `json:"time_updated" bson:"time_updated"`
	RequestorID    *string `json:"requestor_id" bson:"requestor_id"`
	IssuerID       *string `json:"issuer_id" bson:"issuer_id"`
	AccountName    *string `json:"account_name" bson:"account_name"`
	AssetCode      *string `json:"asset_code" bson:"asset_code"`
	Limit          int64   `json:"limit" bson:"limit"`
	Status         *string `json:"status" bson:"status"`
	ReasonRejected *string `json:"reason_rejected" bson:"reason_rejected"`
}

Jump to

Keyboard shortcuts

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