Griptape Update 2021-08-26

Agenda

  • API Design Ideas
  • Next release

API Ideas


Accesing Secret Network modules

This APIs will be designed to access the different Secret Network modules.

Item 1:

import {
  useGovernance,
  useStaking,
  useTokenSwap
} from '@stakeordie/griptape.js';

const gov = useGovernance();

...
1
2
3
4
5
6
7
8
9

Item 2:

import { useBlockchain } from '@stakeordie/griptape.js';

const { governance, staking } = useBlockchain();

...
1
2
3
4
5

Error handling wrapper API

The error handling API enables applications to properly give accurate feedback to their users:

Item 1:

import { OutOfGas, KeplrRejected } from '@stakeordie/griptape.js';
import { contract } from './contracts';

try {
  contract.doTx();
} catch (e) {
  if (e instanceof OutOfGas) {
    // handle this error
  } else if (e instanceof KeplrRejected) {
    console.error(e.msg);
  }
}
...
1
2
3
4
5
6
7
8
9
10
11
12
13

Item 2:

import { KeplrRejected } from '@stakeordie/griptape.js';
import { contract } from './contracts';

const { res, error } = contract.doTx();

if (error instanceof KeplrRejected) {

}

// Use `res`
1
2
3
4
5
6
7
8
9
10

Next Release

griptape.js:0.4.X

  • Introducing Event Driven API
  • Introducing Viewing Keys API
  • Contracts API changes and base contract definitions
  • griptape-vue.js & griptape-react.js scafffold