-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added inistial work on unstable api https://paritytech.github.io/json…
- Loading branch information
1 parent
feb1d8b
commit a903b09
Showing
9 changed files
with
387 additions
and
100 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Substrate.NetApi.Model.Types.Base; | ||
|
||
namespace Substrate.NetApi.Model.Rpc | ||
{ | ||
public enum TransactionEvent | ||
{ | ||
Validated, | ||
|
||
Broadcasted, | ||
|
||
BestChainBlockIncluded, | ||
|
||
Finalized, | ||
|
||
Error, | ||
|
||
Invalid, | ||
|
||
Dropped | ||
} | ||
|
||
public sealed class TransactionEventInfo | ||
{ | ||
public TransactionEvent TransactionEvent { get; set; } | ||
|
||
public uint? NumPeers { get; set; } | ||
|
||
public Hash Hash { get; set; } | ||
|
||
public uint? Index { get; set; } | ||
|
||
public bool? Broadcasted { get; set; } | ||
|
||
public string Error { get; set; } | ||
} | ||
} |
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,68 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Substrate.NetApi.Model.Extrinsics; | ||
using Substrate.NetApi.Model.Rpc; | ||
using Substrate.NetApi.Model.Types; | ||
using Substrate.NetApi.Model.Types.Base; | ||
|
||
namespace Substrate.NetApi.Modules.Contracts | ||
{ | ||
public interface IUnstableCalls | ||
{ | ||
/// <summary> | ||
/// Submit and subscribe to watch an extrinsic until unsubscribed | ||
/// </summary> | ||
/// <param name="callback"></param> | ||
/// <param name="method"></param> | ||
/// <param name="account"></param> | ||
/// <param name="charge"></param> | ||
/// <param name="lifeTime"></param> | ||
/// <returns></returns> | ||
Task<string> TransactionUnstableSubmitAndWatchAsync(Action<string, TransactionEventInfo> callback, Method method, Account account, ChargeType charge, uint lifeTime); | ||
|
||
/// <summary> | ||
/// Submit and subscribe to watch an extrinsic until unsubscribed | ||
/// </summary> | ||
/// <param name="callback"></param> | ||
/// <param name="method"></param> | ||
/// <param name="account"></param> | ||
/// <param name="charge"></param> | ||
/// <param name="lifeTime"></param> | ||
/// <param name="token"></param> | ||
/// <returns></returns> | ||
Task<string> TransactionUnstableSubmitAndWatchAsync(Action<string, TransactionEventInfo> callback, Method method, Account account, ChargeType charge, uint lifeTime, CancellationToken token); | ||
|
||
/// <summary> | ||
/// Submit and subscribe to watch an extrinsic until unsubscribed | ||
/// </summary> | ||
/// <param name="callback"></param> | ||
/// <param name="parameters"></param> | ||
/// <returns></returns> | ||
Task<string> TransactionUnstableSubmitAndWatchAsync(Action<string, TransactionEventInfo> callback, string parameters); | ||
|
||
/// <summary> | ||
/// Submit and subscribe to watch an extrinsic until unsubscribed | ||
/// </summary> | ||
/// <param name="callback"></param> | ||
/// <param name="parameters"></param> | ||
/// <param name="token"></param> | ||
/// <returns></returns> | ||
Task<string> TransactionUnstableSubmitAndWatchAsync(Action<string, TransactionEventInfo> callback, string parameters, CancellationToken token); | ||
|
||
/// <summary> | ||
/// Unsuscribe to given subscription id | ||
/// </summary> | ||
/// <param name="subscriptionId"></param> | ||
/// <returns></returns> | ||
Task<bool> TransactionUnstableUnwatchAsync(string subscriptionId); | ||
|
||
/// <summary> | ||
/// Unsuscribe to given subscription id | ||
/// </summary> | ||
/// <param name="subscriptionId"></param> | ||
/// <param name="token"></param> | ||
/// <returns></returns> | ||
Task<bool> TransactionUnstableUnwatchAsync(string subscriptionId, CancellationToken token); | ||
} | ||
} |
Oops, something went wrong.