-
Notifications
You must be signed in to change notification settings - Fork 6
Get Transactions info
Alexander Popov edited this page Jun 11, 2019
·
7 revisions
- Following parameters required:
-
Transaction ID or hash - identifier of transaction to get info about
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
Transaction ID or hash - identifier of transaction to get info about
package main
import (
"fmt"
"github.com/proximax-storage/go-xpx-catapult-sdk/sdk"
"context"
)
const (
// Catapult-api-rest server.
baseUrl = "http://localhost:3000"
// Types of network.
networkType = sdk.MijinTest
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(baseUrl, networkType, time.Second * 10)
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(), "5BB4D6E2415CD84B7971BBAA")
if err != nil {
fmt.Printf("Transaction.GetTransaction returned error: %s", err)
return
}
fmt.Printf("%s\n\n", transaction.String())
}
- Following parameters required:
-
[]Transaction ID or hash - identifiers of transaction to get info about
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
[]Transaction ID or hash - identifiers of transaction to get info about
package main
import (
"fmt"
"github.com/proximax-storage/go-xpx-catapult-sdk/sdk"
"context"
)
const (
// Catapult-api-rest server.
baseUrl = "http://localhost:3000"
// Types of network.
networkType = sdk.MijinTest
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(baseUrl, networkType, time.Second * 10)
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
transactions, err := client.Transaction.GetTransactions(context.Background(), []string{"C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6", "463FDEC912FC4BA3D84FEC31E8293FAE6D142FC271A71E464FDA563F056A6151"})
if err != nil {
fmt.Printf("Transaction.GetTransactions returned error: %s", err)
return
}
for _, transaction := range transactions {
fmt.Printf("%s\n\n", transaction.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 (
"fmt"
"github.com/proximax-storage/go-xpx-catapult-sdk/sdk"
"context"
)
const (
// Catapult-api-rest server.
baseUrl = "http://localhost:3000"
// Types of network.
networkType = sdk.MijinTest
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(baseUrl, networkType, time.Second * 10)
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.Printf("%s\n\n", transactionStatus.String())
}
- Following parameters required:
-
[]Transaction ID or hash - identifier of transaction to get their statuses
- Example transaction id: "5BB4D6E2415CD84B7971BBAA"
- Example transaction hash: "C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6"
-
[]Transaction ID or hash - identifier of transaction to get their statuses
package main
import (
"fmt"
"github.com/proximax-storage/go-xpx-catapult-sdk/sdk"
"context"
)
const (
// Catapult-api-rest server.
baseUrl = "http://localhost:3000"
// Types of network.
networkType = sdk.MijinTest
)
// Simple Transaction API request
func main() {
conf, err := sdk.NewConfig(baseUrl, networkType, time.Second * 10)
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.GetTransactionStatus(context.Background(), []string{"C95B61BF128BF8D7ED12B997197F2CC220BF33A19BBCF10C67B22086BED85ED6", "463FDEC912FC4BA3D84FEC31E8293FAE6D142FC271A71E464FDA563F056A6151"})
if err != nil {
fmt.Printf("Transaction.GetTransactionStatuses returned error: %s", err)
return
}
for _, transactionStatus := range transactionStatuses {
fmt.Printf("%s\n\n", transactionStatus.String())
}
}
- 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