Git Product home page Git Product logo

plug-api-types's People

Contributors

andrewhaslampf avatar dependabot[bot] avatar hoani avatar jordy25519 avatar karishmabothara avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

plug-api-types's Issues

Remove Option monkey patch

Upstream fix merged: polkadot-js/api#1611
Can remove this temporary fix after updating to the new @polkadot/types version

// Monkey patch [[Option]] to encode `None` as a `0` byte
// Remove when https://github.com/polkadot-js/api/issues/1542 is sorted upstream
Option.prototype.toU8a = function toU8a(isBare?: boolean): Uint8Array {
// Hack to always encode `0` for None (ignores `isBare`)
if (this.isNone) return new Uint8Array([0]);
if (this.isSome && isBare) {
return this.unwrap().toU8a(isBare)
} else {
let buf = new Uint8Array([1]);
buf.set(this.unwrap().toU8a(isBare), 1);
return buf;
}
}

API Warnings unknown extensions and types

When running the api-template against the latest plug-api-types, we get the following warnings:

hoani@Hoani-MBP api-template % node index.js
Connecting to ws://localhost:9944
2020-06-22 14:42:40        API/INIT: RPC methods not decorated: genericAsset_registeredAssets, state_queryStorageAt}
Unable to resolve type AssetInfo, it will fail on constrution
Unknown signed extensions [OptionSignedExtension] found, treating them as no-efect
Unknown signed extensions [OptionSignedExtension] found, treating them as no-efect
Unknown types found, no types for AssetInfo,schnorrkel::Randomness,schnorrkel::RawVRFOutput
Unknown signed extensions [OptionSignedExtension] found, treating them as no-efect
Unknown signed extensions [OptionSignedExtension] found, treating them as no-efect
You are connected to chain Development using Plug Node v2.0.0-alpha.5

First mentioned in PR #15

These warnings should be addressed.

MultiSignature issue with submitting extrinsics using PlugTypes

Following:

When trying to do a balances.transfer, get:

2020-04-28 10:10:44        RPC-CORE: submitExtrinsic(extrinsic: Extrinsic): Hash:: 1002: Verification Error: Execution(ApiError("Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature")): RuntimeApi("Execution(ApiError(\"Could not convert parameter `tx` between node and runtime: No such 
Error: Error: submitExtrinsic(extrinsic: Extrinsic): Hash:: 1002: Verification Error: Execution(ApiError("Could not convert parameter `tx` between node and runtime: No such variant in enum MultiSignature")): RuntimeApi("Execution(ApiError(\"Could not convert parameter `tx` between node and runtime: No such 
    at CatchSubscriber.selector (/Users/hoani/git/plugblockchain/api-template/node_modules/@polkadot/rpc-core/index.js:195:38)
    at CatchSubscriber.error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/operators/catchError.js:48:31)
    at MapSubscriber.Subscriber._error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/Subscriber.js:92:26)
    at MapSubscriber.Subscriber.error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/Subscriber.js:72:18)
    at SwitchMapSubscriber.OuterSubscriber.notifyError (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/OuterSubscriber.js:26:26)
    at InnerSubscriber._error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/InnerSubscriber.js:31:21)
    at InnerSubscriber.Subscriber.error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/Subscriber.js:72:18)
    at CombineLatestSubscriber.OuterSubscriber.notifyError (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/OuterSubscriber.js:26:26)
    at InnerSubscriber._error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/InnerSubscriber.js:31:21)
    at InnerSubscriber.Subscriber.error (/Users/hoani/git/plugblockchain/api-template/node_modules/rxjs/internal/Subscriber.js:72:18)

API initialisation:

  const provider = new WsProvider(address);
  const api = await ApiPromise.create({
    provider,
    types: PlugRuntimeTypes.default
  });

Package.json details:

  "resolutions": {
    "@polkadot/types": "1.2.1",
    "@polkadot/metadata": "1.2.1",
    "@polkadot/api": "1.2.1",
    "@polkadot/api-derive": "1.2.1",
    "@polkadot/rpc-core": "1.2.1"
  },
  "dependencies": {
    "@plugnet/plug-api-types": "git+https://github.com/plugblockchain/plug-api-types.git#develop",
    "@polkadot/api": "1.2.1"
  }

Running plug from develop (24 April 2020).

Add Attestation Types

Attestation types are missing. We should add them since Attestation belongs to Pl^g

It works if I add:

const api = await ApiPromise.create({
  provider,
  types: {
    ...PlugRuntimeTypes.default,
    AttestationTopic: 'U256',
    AttestationValue: 'U256',
  }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.