-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merges the wallet protocol and behaviour into behaviour.
- Loading branch information
1 parent
9d98caa
commit 9c53b3a
Showing
7 changed files
with
95 additions
and
107 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
defmodule TTEth.Behaviours.WalletAdapter do | ||
@moduledoc """ | ||
Defines a shared behaviour for wallet adapters. | ||
""" | ||
|
||
@typedoc """ | ||
This represents the config for a wallet adapter. | ||
Check the documentation for the adapter for specific configuration options. | ||
""" | ||
@type config :: map() | binary() | ||
|
||
@typedoc """ | ||
Represents a wallet adapter. | ||
""" | ||
@type wallet_adapter :: struct() | ||
|
||
@doc """ | ||
Returns a new populated wallet adapter struct. | ||
""" | ||
@callback new(config) :: wallet_adapter | ||
|
||
@doc """ | ||
Provides the attributes needed to build a `Wallet.t` using the passed `wallet_adapter`. | ||
""" | ||
@callback wallet_attrs(wallet_adapter) :: map() | ||
|
||
@doc """ | ||
Signs `digest` using the given `wallet_adapter`. | ||
""" | ||
@callback sign(wallet_adapter, digest :: binary()) :: {:ok, binary()} | {:error, any()} | ||
end |
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
This file was deleted.
Oops, something went wrong.
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
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
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