This open-source library allows you to integrate VAULT into your app. Learn more about about the provided samples, documentation, integrating the SDK into your app, and more at deck slide
In a browser:
// Add dependency packages
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
// Mithril VAULT SDK
<script src="mith-vault-sdk.min.js"></script>
In Node.js
const MithVaultSDK = require('mith-vault-sdk.min.js')
With your application CLIENT ID, CLIENT KEY and MINING KEY, create a MithVaultSDK instance and your application can execute VAULT API. For example
const clientId = 'ba6cabfb4de8d9f4f388124b1afe82b1'
const clientSecret = 'aefd2b59d780eb29bc95b6cf8f3503233ad702141b20f53c8a645afbb8c6616048c5e9cc741e0ebee1a2469c68364e57e29dbeeabadc0b67958b9c3da7eabab9'
const miningKey = 'demo'
const userToken = '1668ff50dca1a85086b558e9e5abc521f14f2317712cb7725d8a9b0f670afe04ea61e091f1060e7845e16e55e300995cb79340782ce34ba683ec9e37e856ff95'
const sdk = new MithVaultSDK({ clientID, clientSecret, miningKey })
sdk.getUserMiningAction({ token: userToken }).then(data => {
...
}).catch(error => {
...
})
Please report bugs or issues to hackathon@mith.io