Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Approve = cldfops.NewOperation( "sac-token:approve", stellarops.ContractDeploymentVersion, "Approves a SAC token spender up to expiration_ledger", func(b cldfops.Bundle, d stellardeps.StellarDeps, in ApproveInput) (stellarops.Void, error) { args := []xdr.ScVal{ scval.AddressToScVal(in.From), scval.AddressToScVal(in.Spender), scval.I128ToScVal(in.Amount), scval.Uint32ToScVal(in.ExpirationLedger), } _, err := d.Invoker.InvokeContract(b.GetContext(), in.ContractID, "approve", args) if err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Approve calls `approve` on a SAC token contract.
View Source
var Transfer = cldfops.NewOperation( "sac-token:transfer", stellarops.ContractDeploymentVersion, "Transfers SAC tokens between Stellar accounts/contracts", func(b cldfops.Bundle, d stellardeps.StellarDeps, in TransferInput) (stellarops.Void, error) { args := []xdr.ScVal{ scval.AddressToScVal(in.From), scval.AddressToScVal(in.To), scval.I128ToScVal(in.Amount), } _, err := d.Invoker.InvokeContract(b.GetContext(), in.ContractID, "transfer", args) if err != nil { return stellarops.Void{}, err } return stellarops.Void{}, nil }, )
Transfer calls `transfer` on a SAC token contract (e.g. for funding lock-release pools).
Functions ¶
This section is empty.
Types ¶
type ApproveInput ¶
type ApproveInput struct {
ContractID string `json:"contract_id"`
From string `json:"from"`
Spender string `json:"spender"`
Amount int64 `json:"amount"`
ExpirationLedger uint32 `json:"expiration_ledger"`
}
ApproveInput is the input for a Soroban Asset Contract (SAC) `approve` call.
Click to show internal directories.
Click to hide internal directories.