Griptape Update 2021-08-20
Agenda
- Current Development
- Next release
Current development
WARNING
Any figures and code in this document are in development and therefore, not final.
- Introducing Event Driven API
- Introducing Viewing Keys API
- Contracts API changes and base contract definitions
- griptape-vue.js & griptape-react.js scafffold
Introducing Event Driven API
The Event Driven APIs let you listen to relevant events by using a callback based API.
import {
onConnect, // When there's an address available
onAccountChange, // When the account change, e.g. Keplr change
onViewingKeyCreated // When a new viewing key has been created for a contract
} from '@stakeordie/griptape.js';
onConnect(() => {});
onAccountChange(() => {});
onViewingKeyCreated(() => {});
...
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Introducing Viewing Keys API
New API for managing viewing keys.
import {
createViewingKey,
updateViewingKey,
deleteViewingKey,
onViewingKeyCreated
} from '@stakeordie/griptape.js';
...
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
We might add a helper class for creating viewing keys using Keplr:
import { getKeplrViewingKeyManager } from '@stakeordie/griptape.js';
const vkManager = getKeplrViewingKeyManager();
vkManager.createViewingKey(...);
1
2
3
4
2
3
4
Contracts API changes and base contract definitions
Adding base contracts, like SNIP-20:
import { snip20Def } from '@stakeordie/griptape.js/contracts';
createContract({
id: 'sefi',
at: '...',
definitions: [snip20Def]
});
1
2
3
4
5
6
7
2
3
4
5
6
7
You can extend multiple contracts; order matters to handle function overriding:
import { snip20Def } from '@stakeordie/griptape.js/contracts';
import { stkdDef } from './contracts';
createContract({
id: 'stkd',
at: '...',
definitions: [snip20Def, stkdDef]
});
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
griptape-vue.js & griptape-react.js scafffold
Project scafffold for:
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