-
Notifications
You must be signed in to change notification settings - Fork 6
Get Transactions info
Yevhen edited this page Jun 22, 2021
·
7 revisions
- Following parameters required:
- TransactionGroup - group of transaction (Confirmed, Partial, Unconfirmed)
-
TransactionID - ID of transaction
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
transaction, err := client.Transaction.GetAnyTransaction(context.Background(), "5BB4D6E2415CD84B7971BBAA")
if err != nil {
fmt.Printf("Transaction.GetTransactionStatuses returned error: %s", err)
return
}
fmt.Println(transaction)
}
- Following parameters required:
- TransactionGroup - group of transaction (Confirmed, Partial, Unconfirmed)
-
TransactionID - ID of transaction
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
transaction, err := client.Transaction.GetTransaction(context.Background(), sdk.Confirmed, "5BB4D6E2415CD84B7971BBAA")
if err != nil {
fmt.Printf("Transaction.GetTransaction returned error: %s", err)
return
}
fmt.Println(transaction.String())
}
- Following parameters required:
- TransactionGroup - group of transaction (Confirmed, Partial, Unconfirmed)
-
TransactionsPageOptions - options for obtained page
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
// Get transaction informations for transactionIds or transactionHashes
transactionPage, err := client.Transaction.GetTransactionsByGroup(context.Background(), sdk.Confirmed, nil)
if err != nil {
fmt.Printf("Transaction.GetTransactions returned error: %s", err)
return
}
for _, transaction := range transactionPage.Transactions {
fmt.Printf("%s\n\n", transaction.String())
}
}
- Following parameters required:
- TransactionGroup - group of transaction (Confirmed, Partial, Unconfirmed)
- []TransactionsIDs - IDs or hashes of transactions
-
TransactionsPageOptions - options for obtained page
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
transactions, err := client.Transaction.GetTransactionsByIds(
context.Background(),
sdk.Confirmed,
[]string{"C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6", "463FDEC912FC4BA3D84FEC31E8293FAE6D142FC271A71E464FDA563F056A6151"},
nil,
)
if err != nil {
fmt.Printf("Transaction.GetTransactionStatuses returned error: %s", err)
return
}
for _, trx := range transactions {
fmt.Println(trx.String())
}
}
- Following parameters required:
-
Transaction ID or hash - identifier of transaction to get its status
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
Transaction ID or hash - identifier of transaction to get its status
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
// Types of network.
networkType = sdk.MijinTest
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
transactionStatus, err := client.Transaction.GetTransactionStatus(context.Background(), "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6")
if err != nil {
fmt.Printf("Transaction.GetTransactionStatus returned error: %s", err)
return
}
fmt.Println(transactionStatus.String())
}
- Following parameters required:
-
[]TransactionsIDs - IDs or hashes of transactions:
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
[]TransactionsIDs - IDs or hashes of transactions:
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
transactionStatuses, err := client.Transaction.GetTransactionsStatuses(context.Background(), []string{"C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6", "463FDEC912FC4BA3D84FEC31E8293FAE6D142FC271A71E464FDA563F056A6151"})
if err != nil {
fmt.Printf("Transaction.GetTransactionStatuses returned error: %s", err)
return
}
for _, transactionStatus := range transactionStatuses {
fmt.Println(transactionStatus.String())
}
}
- Following parameters required:
-
TransactionID - ID of transaction
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
TransactionID - ID of transaction
package main
import (
"context"
"fmt"
"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)
const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}
// Use the default http client
client := sdk.NewClient(nil, conf)
trxEffectiveFee, err := client.Transaction.GetTransactionEffectiveFee(context.Background(), "5BB4D6E2415CD84B7971BBAA")
if err != nil {
fmt.Printf("Transaction.GetTransactionStatuses returned error: %s", err)
return
}
fmt.Println(trxEffectiveFee)
}
- Home
- Installation
-
Examples
- Basic functions
- Get Accounts info
- Get Transactions info
- Get Mosaic info
- Get Mosaic Levy info
- Get Namespace info
- Get BlockChain info
- Get Network info
- Get Metadata info
- Get Nem Metadata info
- Get Account Properties info
- Get Exchange info
- Get SDA-SDA Exchange info
- Get Secret lock info
- Get Storage info
- Announces a transaction
- Websocket