@koibanx/algorand-connector-sdk
v0.0.8
Published
Algorand Connector SDK
Downloads
1,251
Readme
Koibanx Algorand Connector SDK
Algorand Connector SDK based in module Algorand Connector
Installation
npm install @koibanx/algorand-connector-sdk
NOTE: you must have the npm token in your .npmrc file
Initialization
Node
Using ES6 import
import AlgoConnectorApi from '@koibanx/algorand-connector-sdk';
const algoConnector = AlgoConnectorApi({
baseURL: 'http://your-url',
});
With require
exports.__esModule = true;
const AlgoConnectorApi = require('@koibanx/algorand-connector-sdk')["default"];
const algoConnector = AlgoConnectorApi({
baseURL: 'http://your-url',
});
Types
- Typescript (
@koibanx/algorand-connector-sdk/dist/index.d.ts
)
Examples
Using ES6 import
import AlgoConnectorApi from "@koibanx/algorand-connector-sdk";
const algoConnector = AlgoConnectorApi({
baseURL: 'http://your-url',
})
const catchError = (err, modulo) => {
console.log('Modulo: ', modulo);
console.log('details: ', err.details);
console.log('shortMessage: ', err.message);
console.log('errorCode: ', err.code);
}
algoConnector.getAccount('76TLMZVS36OWJN7PTM324PKB66HYAXVO4I4HHE6WESKLM53K5RHFDDQGUY')
.then((res) => {
console.log('getAccount: ', res);
}).catch((err) => catchError(err, 'getAccount'));
algoConnector.app.getApp(98684787).then((res) => {
console.log('getApp: ', res);
console.log('getApp -> app: ', res.application.id);
}).catch((err) => catchError(err, 'getApp'));
algoConnector.app.deleteApp({
appId: 98684787,
from: '76TLMZVS36OWJN7PTM324PKB66HYAXVO4I4HHE6WESKLM53K5RHFDDQGUY',
}).then((res) => {
console.log('deleteApp: ', res);
}).catch((err) => catchError(err, 'deleteApp'));
algoConnector.transaction.getTransaction('4VBO6HFFDPOXNEAFCOGGJZIM72LN22HDVCYFEFQ4LHKBIE52QHSA')
.then((res) => {
console.log('getTransaction: ', res.sender);
}).catch((err) => catchError(err, 'getTransaction'));
algoConnector.asa.createASA({
decimals: 0,
from: '76TLMZVS36OWJN7PTM324PKB66HYAXVO4I4HHE6WESKLM53K5RHFDDQGUY',
total: 0,
}).then((res) => {
console.log('createASA: ', res);
}).catch((err) => catchError(err, 'createASA'));