Documentation ¶
Index ¶
- func SignEVMTransactionWithSigner(unsignedHexTx string, privKey *ecdsa.PrivateKey, signer types.Signer) (txHash string, signedTx []byte, err error)
- func SignEthereumLegacyTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
- func SignEthereumTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
- func SignPolkadotTransaction(seedPhrase, rawTx, rawSigningPayload string, network PolkadotNetwork) (string, error)
- func SignPolygonTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
- func SignSolanaTransaction(unsignedRawTx string, privateKey solana.PrivateKey) (signedRawTx string, err error)
- type BitcoinTransaction
- type EthereumTransaction
- type PolkadotNetwork
- type PolkadotTransaction
- type PolygonTransaction
- type SendTxResult
- type SolanaTransaction
- type TxInput
- type TxOutput
- type UbiquityTransactionService
- func (s UbiquityTransactionService) SendBTC(ctx context.Context, tx *BitcoinTransaction) (*SendTxResult, error)
- func (s UbiquityTransactionService) SendDOT(ctx context.Context, tx *PolkadotTransaction) (*SendTxResult, error)
- func (s UbiquityTransactionService) SendETH(ctx context.Context, tx *EthereumTransaction) (*SendTxResult, error)
- func (s UbiquityTransactionService) SendMATIC(ctx context.Context, tx *PolygonTransaction) (*SendTxResult, error)
- func (s UbiquityTransactionService) SendSOL(ctx context.Context, tx *SolanaTransaction) (*SendTxResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignEVMTransactionWithSigner ¶ added in v1.7.0
func SignEVMTransactionWithSigner(unsignedHexTx string, privKey *ecdsa.PrivateKey, signer types.Signer) (txHash string, signedTx []byte, err error)
SignEVMTransactionWithSigner signs an unsigned hex transaction using the provided private key and signer This will work for all Ethereum Virtual Machine (EVM) compliant blockchains, including Ethereum and Polygon This function allows more control. For higher level functions use 'SignEthereumTransaction' and 'SignPolygonTransaction'
func SignEthereumLegacyTransaction ¶ added in v1.7.0
func SignEthereumLegacyTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
SignEthereumLegacyTransaction signs an unsigned hex encoded transaction for the desired 'network'. This function signs a legacy transaction, these are transactions commonly used before the London hard fork
func SignEthereumTransaction ¶ added in v1.7.0
func SignEthereumTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
SignEthereumTransaction signs an unsigned hex encoded transaction for the desired 'network'. This function signs a post London hard fork transaction, als referred to as an EIP1559 transaction.
func SignPolkadotTransaction ¶ added in v1.3.0
func SignPolkadotTransaction(seedPhrase, rawTx, rawSigningPayload string, network PolkadotNetwork) (string, error)
func SignPolygonTransaction ¶ added in v1.7.0
func SignPolygonTransaction(unsignedHexTx string, network string, privKey *ecdsa.PrivateKey) (txHash string, signedTx []byte, err error)
SignPolygonTransaction signs an unsigned hex encoded transaction for the desired 'network'. This function signs a post London hard fork transaction, als referred to as an EIP1559 transaction.
func SignSolanaTransaction ¶ added in v1.4.0
Types ¶
type BitcoinTransaction ¶
type BitcoinTransaction struct { Network string From []TxInput To []TxOutput // Fee int64 // ChangeAddr string PrivateKey string }
BitcoinTransaction *Important* make sure to properly calculate the difference between INs and OUTs since it will be automatically payed as a Fee. In the future we may include UTXO and Fee calculation into the service.
type EthereumTransaction ¶
type PolkadotNetwork ¶ added in v1.3.0
type PolkadotNetwork uint8
const ( PolkadotMainnet PolkadotNetwork = 0 PolkadotWestend PolkadotNetwork = 42 )
type PolkadotTransaction ¶ added in v1.3.0
type PolygonTransaction ¶ added in v1.7.0
type SendTxResult ¶ added in v1.3.0
type SolanaTransaction ¶ added in v1.4.0
type UbiquityTransactionService ¶
type UbiquityTransactionService struct {
// contains filtered or unexported fields
}
UbiquityTransactionService provides API to send various protocol transactions. So far it supports BTC and ETH.
func NewService ¶
func NewService(txAPI ubiquity.TransactionsAPI, feesAPI ubiquity.FeeEstimatorAPI) *UbiquityTransactionService
func (UbiquityTransactionService) SendBTC ¶
func (s UbiquityTransactionService) SendBTC(ctx context.Context, tx *BitcoinTransaction) (*SendTxResult, error)
SendBTC creates, signs and sends BTC transaction. Under the hood it uses Ubiquity TxSend API.
func (UbiquityTransactionService) SendDOT ¶ added in v1.3.0
func (s UbiquityTransactionService) SendDOT(ctx context.Context, tx *PolkadotTransaction) (*SendTxResult, error)
SendDOT creates, signs and sends DOT transaction. Under the hood it uses Ubiquity TxCreate and TxSend API.
func (UbiquityTransactionService) SendETH ¶
func (s UbiquityTransactionService) SendETH(ctx context.Context, tx *EthereumTransaction) (*SendTxResult, error)
SendETH creates, signs and sends ETH transaction. Under the hood it uses Ubiquity TxSend API.
func (UbiquityTransactionService) SendMATIC ¶ added in v1.7.0
func (s UbiquityTransactionService) SendMATIC(ctx context.Context, tx *PolygonTransaction) (*SendTxResult, error)
SendMATIC creates, signs and sends MATIC transaction. Under the hood it uses Ubiquity TxCreate and TxSend API.
func (UbiquityTransactionService) SendSOL ¶ added in v1.4.0
func (s UbiquityTransactionService) SendSOL(ctx context.Context, tx *SolanaTransaction) (*SendTxResult, error)
SendSOL creates, signs and sends SOL transaction. Under the hood it uses Ubiquity TxCreate and TxSend API.