Documentation ¶
Index ¶
- Constants
- Variables
- func AddMemoAndSign(txBase64 string, privateKey solana.PrivateKey) (string, error)
- func CreateSampleTx(privateKey solana.PrivateKey, recentBlockHash solana.Hash, lamports uint64) (*solana.Transaction, error)
- func CreateTraderAPIMemoInstruction(msg string) solana.Instruction
- func LoadPrivateKeyFromEnv() (solana.PrivateKey, error)
- func PartialSign(tx *solana.Transaction, ownerPk solana.PublicKey, ...) error
- func SignTx(unsignedTxBase64 string) (string, error)
- func SignTxWithPrivateKey(unsignedTxBase64 string, privateKey solana.PrivateKey) (string, error)
Constants ¶
const BxMemoMarkerMsg = "Powered by bloXroute Trader Api"
const ReceipientAddress = "5wiGAqf4BX23XU6jc3MDDZAFoNV5pz61thsUuSgpsAxS"
Variables ¶
var TraderAPIMemoProgram = solana.MustPublicKeyFromBase58("HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx")
Functions ¶
func AddMemoAndSign ¶ added in v1.8.0
AddMemoAndSign adds memo instruction to a serialized transaction, it's primarily used if the user doesn't want to interact with Trader-API directly
func CreateSampleTx ¶ added in v1.9.3
func CreateTraderAPIMemoInstruction ¶ added in v1.2.0
func CreateTraderAPIMemoInstruction(msg string) solana.Instruction
CreateTraderAPIMemoInstruction generates a transaction instruction that places a memo in the transaction log Having a memo instruction with signals Trader-API usage is required
func LoadPrivateKeyFromEnv ¶
func LoadPrivateKeyFromEnv() (solana.PrivateKey, error)
LoadPrivateKeyFromEnv looks up private key from the `PRIVATE_KEY` environment variable
func PartialSign ¶ added in v1.9.5
func PartialSign(tx *solana.Transaction, ownerPk solana.PublicKey, privateKeys map[solana.PublicKey]solana.PrivateKey) error
PartialSign heavily derived from `solana-go/transaction.go`. Signs the transaction with all available private keys, except the main Solana address's
func SignTx ¶
SignTx uses the environment variable for `PRIVATE_KEY` to sign the message content and replace the zero signature
func SignTxWithPrivateKey ¶
SignTxWithPrivateKey uses the provided private key to sign the message content and replace the zero signature
Types ¶
This section is empty.