More ergonomic contracts interfaces (RxJs only initial) (#1015)

* More ergnomic contracts interfaces

* extend SubmittableResult

* Allow creation of contract from blueprint

* "decorate" Contract (just playing with interfaces)

* Make actual messages calls

* Rename to Rx{Blueprint, Cond, Contract}

* Add exports

* Support contract & contracts endpoints

* Remove unneeded ApiType generics (may return)

* Comment 2.x/1.x detection
This commit is contained in:
Jaco Greeff
2019-06-21 16:48:00 +02:00
committed by GitHub
parent 5e5bb9984b
commit f30c516099
10 changed files with 288 additions and 45 deletions
+3 -3
View File
@@ -2,17 +2,17 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { ContractABI, ContractABIFn } from './types';
import { ContractABI, ContractABIFn, IAbi, IAbi$Messages } from './types';
import { stringCamelCase } from '@polkadot/util';
import { createMethod } from './method';
import { validateAbi } from './validation';
export default class ContractAbi {
export default class ContractAbi implements IAbi {
readonly abi: ContractABI;
readonly deploy: ContractABIFn;
readonly messages: { [index: string]: ContractABIFn } = {};
readonly messages: IAbi$Messages = {};
constructor (abi: ContractABI) {
validateAbi(abi);