-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common interface for tx interactions
- Loading branch information
1 parent
f812014
commit f784450
Showing
3 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package common | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/multiversx/mx-chain-core-go/data/transaction" | ||
"github.com/multiversx/mx-sdk-go/core" | ||
"github.com/multiversx/mx-sdk-go/data" | ||
) | ||
|
||
// TxInteractor defines a tx interactor with multiversx blockchain | ||
type TxInteractor interface { | ||
ApplyUserSignature(cryptoHolder core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error | ||
IsInterfaceNil() bool | ||
} | ||
|
||
// Proxy defines the proxy to interact with MultiversX blockchain | ||
type Proxy interface { | ||
GetAccount(ctx context.Context, address core.AddressHandler) (*data.Account, error) | ||
GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error) | ||
IsInterfaceNil() bool | ||
} | ||
|
||
// TxNonceSenderHandler should handle nonce management and tx interactions | ||
type TxNonceSenderHandler interface { | ||
ApplyNonceAndGasPrice(ctx context.Context, address core.AddressHandler, tx *transaction.FrontendTransaction) error | ||
SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error) | ||
IsInterfaceNil() bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,11 @@ | ||
package txSender | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/multiversx/mx-chain-core-go/data/sovereign" | ||
"github.com/multiversx/mx-chain-core-go/data/transaction" | ||
"github.com/multiversx/mx-sdk-go/core" | ||
"github.com/multiversx/mx-sdk-go/data" | ||
) | ||
|
||
// TxInteractor defines a tx interactor with multiversx blockchain | ||
type TxInteractor interface { | ||
ApplyUserSignature(cryptoHolder core.CryptoComponentsHolder, tx *transaction.FrontendTransaction) error | ||
IsInterfaceNil() bool | ||
} | ||
|
||
// Proxy defines the proxy to interact with MultiversX blockchain | ||
type Proxy interface { | ||
GetAccount(ctx context.Context, address core.AddressHandler) (*data.Account, error) | ||
GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error) | ||
IsInterfaceNil() bool | ||
} | ||
|
||
// DataFormatter should format txs data for bridge operations | ||
type DataFormatter interface { | ||
CreateTxsData(data *sovereign.BridgeOperations) [][]byte | ||
IsInterfaceNil() bool | ||
} | ||
|
||
// TxNonceSenderHandler should handle nonce management and tx interactions | ||
type TxNonceSenderHandler interface { | ||
ApplyNonceAndGasPrice(ctx context.Context, address core.AddressHandler, tx *transaction.FrontendTransaction) error | ||
SendTransaction(ctx context.Context, tx *transaction.FrontendTransaction) (string, error) | ||
IsInterfaceNil() bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters