Coder Social home page Coder Social logo

dharmaprotocol / dharma.js Goto Github PK

View Code? Open in Web Editor NEW
55.0 55.0 24.0 8.78 MB

DEPRECATED: Javascript Developer library for interacting with Dharma Protocol

Home Page: https://dharma.io

License: MIT License

TypeScript 99.77% Shell 0.11% JavaScript 0.12%
blockchain ethereum javascript

dharma.js's People

Contributors

chrismin avatar cstrangedk avatar dmitryvolkovtulaco avatar graemecode avatar nadavhollander avatar saturnial avatar sidrmsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dharma.js's Issues

TypeError this.provider.sendAsync

Hello,

I was working through the tutorial https://developer.dharma.io/tutorials/create

dharma-chain running on 8545

const { Dharma, Web3 } = require("@dharmaprotocol/dharma.js");
const BigNumber = require("bignumber.js");

const host = "http://localhost:8545";
const dharma = new Dharma(host);

async function loanreq() {

    const { LoanRequest } = Dharma.Types;

    const loanRequest = await LoanRequest.create(dharma, {
        principalAmount: new BigNumber(1),
        principalToken: "WETH",
        collateralAmount: new BigNumber(20),
        collateralToken: "REP",
        interestRate: new BigNumber(3),
        termDuration: new BigNumber(3),
        termUnit: "months",
        expiresInDuration: new BigNumber(1),
        expiresInUnit: "weeks"
    });
    console.log(loanRequest);
}

loanreq()

Output

(node:8362) UnhandledPromiseRejectionWarning: TypeError: this.provider.sendAsync is not a function
    at RequestManager.sendAsync (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:88601:19)
    at Object.send (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:14677:42)
    at /xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:5610:10
    at new Promise (<anonymous>)
    at new F (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:36181:28)
    at /xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:5592:12
    at BlockchainAPI.<anonymous> (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:301244:72)
    at step (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:301081:23)
    at Object.next (/xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:301062:53)
    at /xyz/xyz/xyz/projects/dharma/dharmajs/node_modules/@dharmaprotocol/dharma.js/dist/dharma.umd.js:301056:71
(node:8362) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:8362) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled wil terminate the Node.js process with a non-zero exit code.

Was simply trying to print the loanRequest

Vue.js await is a reserved word

Is this Vue.js issue? is Dharmajs compatible with Vue ?

25 | methods: {
26 | createLoanRequest: function() {

27 | const loanRequest = await LoanRequest.create(dharma, {
| ^
28 | principalAmount: 5,
29 | principalToken: "WETH",
....

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.