New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cityofzion/dora-ts

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cityofzion/dora-ts - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

dist/interfaces/rest.d.ts

0

.mocharc.json

@@ -0,0 +0,0 @@ {

export * from './neo';
export * from './neo_legacy';

@@ -0,0 +0,0 @@ "use strict";

export * from './rest';

@@ -0,0 +0,0 @@ "use strict";

54

dist/api/neo_legacy/rest.d.ts
import type { AddressStatsResponse, AssetResponse, AssetsResponse, BalanceResponse, BlockResponse, BlocksResponse, ContractResponse, ContractsResponse, ContractTransfersResponse, GetAddressAbstractsResponse, GetAllNodesResponse, GetClaimableResponse, GetUnclaimedResponse, HeightResponse, InvocationStatsResponse, LogResponse, StorageResponse, TransactionAbstractsResponse, TransactionResponse, TransactionsResponse, TransferHistoryResponse } from '../../interfaces/api/neo_legacy';
export declare class NeoLegacyREST {
static axios: import("axios").AxiosInstance;
static addressStats(address: string, network?: string): Promise<AddressStatsResponse>;
static asset(assetHash: string, network?: string): Promise<AssetResponse>;
static assets(page?: number, network?: string): Promise<AssetsResponse>;
static balance(address: string, network?: string): Promise<BalanceResponse>;
static block(blockHash: string, network?: string): Promise<BlockResponse>;
static blocks(page?: number, network?: string): Promise<BlocksResponse>;
static contract(contractHash: string, network?: string): Promise<ContractResponse>;
static contracts(page: number, network?: string): Promise<ContractsResponse>;
static contractStats(contractHash: string, network?: string): Promise<Object>;
static contractTransfers(contractHash: string, page?: number, network?: string): Promise<ContractTransfersResponse>;
static getAddressAbstracts(address: string, page?: number, network?: string): Promise<GetAddressAbstractsResponse>;
static getAllNodes(network?: string): Promise<GetAllNodesResponse>;
static getClaimable(address: string, network?: string): Promise<GetClaimableResponse>;
static getUnclaimed(address: string, network?: string): Promise<GetUnclaimedResponse>;
static height(network?: string): Promise<HeightResponse>;
static invocationStats(network?: string): Promise<InvocationStatsResponse>;
static log(contractHash: string, network?: string): Promise<LogResponse>;
static storage(blockHash: string, network?: string): Promise<StorageResponse>;
static transaction(txid: string, network?: string): Promise<TransactionResponse>;
static transactions(page?: number, network?: string): Promise<TransactionsResponse>;
static transactionAbstracts(txid: string, network?: string): Promise<TransactionAbstractsResponse>;
static transferHistory(address: string, page?: number, network?: string): Promise<TransferHistoryResponse>;
private static get;
import type { RestConfig } from "../../interfaces";
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
export declare class NeoLegacyRESTApi {
protected axios: AxiosInstance;
constructor(restConfig?: RestConfig, axiosConfig?: AxiosRequestConfig);
addressStats(address: string, network?: string): Promise<AddressStatsResponse>;
asset(assetHash: string, network?: string): Promise<AssetResponse>;
assets(page?: number, network?: string): Promise<AssetsResponse>;
balance(address: string, network?: string): Promise<BalanceResponse>;
block(blockHash: string, network?: string): Promise<BlockResponse>;
blocks(page?: number, network?: string): Promise<BlocksResponse>;
contract(contractHash: string, network?: string): Promise<ContractResponse>;
contracts(page: number, network?: string): Promise<ContractsResponse>;
contractStats(contractHash: string, network?: string): Promise<Object>;
contractTransfers(contractHash: string, page?: number, network?: string): Promise<ContractTransfersResponse>;
getAddressAbstracts(address: string, page?: number, network?: string): Promise<GetAddressAbstractsResponse>;
getAllNodes(network?: string): Promise<GetAllNodesResponse>;
getClaimable(address: string, network?: string): Promise<GetClaimableResponse>;
getUnclaimed(address: string, network?: string): Promise<GetUnclaimedResponse>;
height(network?: string): Promise<HeightResponse>;
invocationStats(network?: string): Promise<InvocationStatsResponse>;
log(contractHash: string, network?: string): Promise<LogResponse>;
storage(blockHash: string, network?: string): Promise<StorageResponse>;
transaction(txid: string, network?: string): Promise<TransactionResponse>;
transactions(page?: number, network?: string): Promise<TransactionsResponse>;
transactionAbstracts(txid: string, network?: string): Promise<TransactionAbstractsResponse>;
transferHistory(address: string, page?: number, network?: string): Promise<TransferHistoryResponse>;
private get;
}
export declare const NeoLegacyREST: NeoLegacyRESTApi;

@@ -38,9 +38,25 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.NeoLegacyREST = void 0;
exports.NeoLegacyREST = exports.NeoLegacyRESTApi = void 0;
var constants_1 = require("../../constants");
var NeoLegacyREST = (function () {
function NeoLegacyREST() {
var axios_1 = __importDefault(require("axios"));
var DefaultLegacyRestConfig = {
doraUrl: constants_1.DORA_URL,
endpoint: '/api/v1/neo2'
};
var NeoLegacyRESTApi = (function () {
function NeoLegacyRESTApi(restConfig, axiosConfig) {
if (restConfig === void 0) { restConfig = DefaultLegacyRestConfig; }
if (typeof axiosConfig === 'undefined') {
axiosConfig = { baseURL: restConfig.doraUrl + restConfig.endpoint };
}
else {
axiosConfig["baseURL"] = restConfig.doraUrl + restConfig.endpoint;
}
this.axios = axios_1["default"].create(axiosConfig);
}
NeoLegacyREST.addressStats = function (address, network) {
NeoLegacyRESTApi.prototype.addressStats = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -59,3 +75,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.asset = function (assetHash, network) {
NeoLegacyRESTApi.prototype.asset = function (assetHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -74,3 +90,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.assets = function (page, network) {
NeoLegacyRESTApi.prototype.assets = function (page, network) {
if (page === void 0) { page = 1; }

@@ -90,3 +106,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.balance = function (address, network) {
NeoLegacyRESTApi.prototype.balance = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -105,3 +121,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.block = function (blockHash, network) {
NeoLegacyRESTApi.prototype.block = function (blockHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -120,3 +136,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.blocks = function (page, network) {
NeoLegacyRESTApi.prototype.blocks = function (page, network) {
if (page === void 0) { page = 1; }

@@ -136,3 +152,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.contract = function (contractHash, network) {
NeoLegacyRESTApi.prototype.contract = function (contractHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -151,3 +167,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.contracts = function (page, network) {
NeoLegacyRESTApi.prototype.contracts = function (page, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -166,3 +182,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.contractStats = function (contractHash, network) {
NeoLegacyRESTApi.prototype.contractStats = function (contractHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -181,3 +197,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.contractTransfers = function (contractHash, page, network) {
NeoLegacyRESTApi.prototype.contractTransfers = function (contractHash, page, network) {
if (page === void 0) { page = 1; }

@@ -197,3 +213,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.getAddressAbstracts = function (address, page, network) {
NeoLegacyRESTApi.prototype.getAddressAbstracts = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -213,3 +229,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.getAllNodes = function (network) {
NeoLegacyRESTApi.prototype.getAllNodes = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -228,3 +244,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.getClaimable = function (address, network) {
NeoLegacyRESTApi.prototype.getClaimable = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -243,3 +259,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.getUnclaimed = function (address, network) {
NeoLegacyRESTApi.prototype.getUnclaimed = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -258,3 +274,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.height = function (network) {
NeoLegacyRESTApi.prototype.height = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -273,3 +289,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.invocationStats = function (network) {
NeoLegacyRESTApi.prototype.invocationStats = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -288,3 +304,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.log = function (contractHash, network) {
NeoLegacyRESTApi.prototype.log = function (contractHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -303,3 +319,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.storage = function (blockHash, network) {
NeoLegacyRESTApi.prototype.storage = function (blockHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -318,3 +334,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.transaction = function (txid, network) {
NeoLegacyRESTApi.prototype.transaction = function (txid, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -333,3 +349,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.transactions = function (page, network) {
NeoLegacyRESTApi.prototype.transactions = function (page, network) {
if (page === void 0) { page = 1; }

@@ -349,3 +365,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.transactionAbstracts = function (txid, network) {
NeoLegacyRESTApi.prototype.transactionAbstracts = function (txid, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -364,3 +380,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoLegacyREST.transferHistory = function (address, page, network) {
NeoLegacyRESTApi.prototype.transferHistory = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -380,3 +396,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoLegacyREST.get = function () {
NeoLegacyRESTApi.prototype.get = function () {
var args = [];

@@ -400,6 +416,6 @@ for (var _i = 0; _i < arguments.length; _i++) {

};
NeoLegacyREST.axios = constants_1.AXIOS_DORA('neoLegacy');
return NeoLegacyREST;
return NeoLegacyRESTApi;
}());
exports.NeoLegacyREST = NeoLegacyREST;
exports.NeoLegacyRESTApi = NeoLegacyRESTApi;
exports.NeoLegacyREST = new NeoLegacyRESTApi();
//# sourceMappingURL=rest.js.map
export * from './rest';

@@ -0,0 +0,0 @@ "use strict";

import type { AddressTransactionsResponse, AddressTXFullResponse, AssetResponse, BalanceResponse, BlockResponse, BlocksResponse, ContractResponse, ContractsResponse, GetAddressAbstractsResponse, GetAllNodesResponse, HeightResponse, InvocationStatsResponse, LogResponse, TransactionResponse, TransactionsResponse, TransferHistoryResponse, VoterResponse } from '../../interfaces/api/neo';
export declare class NeoRest {
static axios: import("axios").AxiosInstance;
static addressTransactions(address: string, page?: number, network?: string): Promise<AddressTransactionsResponse>;
static addressTXFull(address: string, page?: number, network?: string): Promise<AddressTXFullResponse>;
static asset(assetHash: string, network?: string): Promise<AssetResponse>;
static assets(page?: number, network?: string): Promise<any>;
static balance(address: string, network?: string): Promise<BalanceResponse>;
static block(blockHeight: number, network?: string): Promise<BlockResponse>;
static blocks(page?: number, network?: string): Promise<BlocksResponse>;
static committee(network?: string): Promise<BalanceResponse>;
static contract(contractHash: string, network?: string): Promise<ContractResponse>;
static contracts(page: number, network?: string): Promise<ContractsResponse>;
static contractStats(contractHash: string, network?: string): Promise<Object>;
static getAddressAbstracts(address: string, page?: number, network?: string): Promise<GetAddressAbstractsResponse>;
static getAllNodes(network?: string): Promise<GetAllNodesResponse>;
static height(network?: string): Promise<HeightResponse>;
static invocationStats(network?: string): Promise<InvocationStatsResponse>;
static log(txid: string, network?: string): Promise<LogResponse>;
static transaction(txid: string, network?: string): Promise<TransactionResponse>;
static transactions(page?: number, network?: string): Promise<TransactionsResponse>;
static transferHistory(address: string, page?: number, network?: string): Promise<TransferHistoryResponse>;
static voter(address: string, network?: string): Promise<VoterResponse>;
private static get;
import type { RestConfig } from "../../interfaces";
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
export declare class NeoRESTApi {
protected axios: AxiosInstance;
constructor(restConfig?: RestConfig, axiosConfig?: AxiosRequestConfig);
addressTransactions(address: string, page?: number, network?: string): Promise<AddressTransactionsResponse>;
addressTXFull(address: string, page?: number, network?: string): Promise<AddressTXFullResponse>;
asset(assetHash: string, network?: string): Promise<AssetResponse>;
assets(page?: number, network?: string): Promise<any>;
balance(address: string, network?: string): Promise<BalanceResponse>;
block(blockHeight: number, network?: string): Promise<BlockResponse>;
blocks(page?: number, network?: string): Promise<BlocksResponse>;
committee(network?: string): Promise<BalanceResponse>;
contract(contractHash: string, network?: string): Promise<ContractResponse>;
contracts(page: number, network?: string): Promise<ContractsResponse>;
contractStats(contractHash: string, network?: string): Promise<Object>;
getAddressAbstracts(address: string, page?: number, network?: string): Promise<GetAddressAbstractsResponse>;
getAllNodes(network?: string): Promise<GetAllNodesResponse>;
height(network?: string): Promise<HeightResponse>;
invocationStats(network?: string): Promise<InvocationStatsResponse>;
log(txid: string, network?: string): Promise<LogResponse>;
transaction(txid: string, network?: string): Promise<TransactionResponse>;
transactions(page?: number, network?: string): Promise<TransactionsResponse>;
transferHistory(address: string, page?: number, network?: string): Promise<TransferHistoryResponse>;
voter(address: string, network?: string): Promise<VoterResponse>;
private get;
}
export declare const NeoRest: NeoRESTApi;

@@ -38,9 +38,25 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.NeoRest = void 0;
exports.NeoRest = exports.NeoRESTApi = void 0;
var constants_1 = require("../../constants");
var NeoRest = (function () {
function NeoRest() {
var axios_1 = __importDefault(require("axios"));
var DefaultRestConfig = {
doraUrl: constants_1.DORA_URL,
endpoint: '/api/v1/neo3'
};
var NeoRESTApi = (function () {
function NeoRESTApi(restConfig, axiosConfig) {
if (restConfig === void 0) { restConfig = DefaultRestConfig; }
if (typeof axiosConfig === 'undefined') {
axiosConfig = { baseURL: restConfig.doraUrl + restConfig.endpoint };
}
else {
axiosConfig["baseURL"] = restConfig.doraUrl + restConfig.endpoint;
}
this.axios = axios_1["default"].create(axiosConfig);
}
NeoRest.addressTransactions = function (address, page, network) {
NeoRESTApi.prototype.addressTransactions = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -60,3 +76,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.addressTXFull = function (address, page, network) {
NeoRESTApi.prototype.addressTXFull = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -76,3 +92,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.asset = function (assetHash, network) {
NeoRESTApi.prototype.asset = function (assetHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -91,3 +107,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.assets = function (page, network) {
NeoRESTApi.prototype.assets = function (page, network) {
if (page === void 0) { page = 1; }

@@ -107,3 +123,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.balance = function (address, network) {
NeoRESTApi.prototype.balance = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -122,3 +138,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.block = function (blockHeight, network) {
NeoRESTApi.prototype.block = function (blockHeight, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -137,3 +153,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.blocks = function (page, network) {
NeoRESTApi.prototype.blocks = function (page, network) {
if (page === void 0) { page = 1; }

@@ -153,3 +169,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.committee = function (network) {
NeoRESTApi.prototype.committee = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -168,3 +184,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.contract = function (contractHash, network) {
NeoRESTApi.prototype.contract = function (contractHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -183,3 +199,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.contracts = function (page, network) {
NeoRESTApi.prototype.contracts = function (page, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -198,3 +214,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.contractStats = function (contractHash, network) {
NeoRESTApi.prototype.contractStats = function (contractHash, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -213,3 +229,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.getAddressAbstracts = function (address, page, network) {
NeoRESTApi.prototype.getAddressAbstracts = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -229,3 +245,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.getAllNodes = function (network) {
NeoRESTApi.prototype.getAllNodes = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -244,3 +260,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.height = function (network) {
NeoRESTApi.prototype.height = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -259,3 +275,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.invocationStats = function (network) {
NeoRESTApi.prototype.invocationStats = function (network) {
if (network === void 0) { network = 'mainnet'; }

@@ -274,3 +290,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.log = function (txid, network) {
NeoRESTApi.prototype.log = function (txid, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -289,3 +305,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.transaction = function (txid, network) {
NeoRESTApi.prototype.transaction = function (txid, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -304,3 +320,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.transactions = function (page, network) {
NeoRESTApi.prototype.transactions = function (page, network) {
if (page === void 0) { page = 1; }

@@ -320,3 +336,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.transferHistory = function (address, page, network) {
NeoRESTApi.prototype.transferHistory = function (address, page, network) {
if (page === void 0) { page = 1; }

@@ -336,3 +352,3 @@ if (network === void 0) { network = 'mainnet'; }

};
NeoRest.voter = function (address, network) {
NeoRESTApi.prototype.voter = function (address, network) {
if (network === void 0) { network = 'mainnet'; }

@@ -351,3 +367,3 @@ return __awaiter(this, void 0, void 0, function () {

};
NeoRest.get = function () {
NeoRESTApi.prototype.get = function () {
var args = [];

@@ -371,6 +387,6 @@ for (var _i = 0; _i < arguments.length; _i++) {

};
NeoRest.axios = constants_1.AXIOS_DORA('neo');
return NeoRest;
return NeoRESTApi;
}());
exports.NeoRest = NeoRest;
exports.NeoRESTApi = NeoRESTApi;
exports.NeoRest = new NeoRESTApi();
//# sourceMappingURL=rest.js.map

@@ -1,3 +0,1 @@

import type { AxiosInstance } from 'axios';
export declare const DORA_URL = "https://dora.coz.io";
export declare const AXIOS_DORA: (version: string) => AxiosInstance;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.AXIOS_DORA = exports.DORA_URL = void 0;
var axios_1 = __importDefault(require("axios"));
exports.DORA_URL = void 0;
exports.DORA_URL = 'https://dora.coz.io';
var AXIOS_DORA = function (version) {
var endpoint = '';
if (version === 'neoLegacy') {
endpoint = '/api/v1/neo2';
}
else if (version === 'neo') {
endpoint = '/api/v1/neo3';
}
return axios_1["default"].create({
baseURL: exports.DORA_URL + endpoint
});
};
exports.AXIOS_DORA = AXIOS_DORA;
//# sourceMappingURL=index.js.map
export * as api from './api';
export * from './interfaces';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export interface AddressAbstractEntry {

"use strict";
exports.__esModule = true;
//# sourceMappingURL=index.js.map
export * as NeoLegacy from './neo_legacy';
export * as Neo from './neo';

@@ -0,0 +0,0 @@ "use strict";

export * from './interface';
export * from './responses';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { TypedResponse, Witness } from '../common';

"use strict";
exports.__esModule = true;
//# sourceMappingURL=interface.js.map

@@ -0,0 +0,0 @@ import { ApplicationLog, Asset, ClaimableEvent, ContractMetaData, ContractState, ContractStorage, ContractTransfer, InputOutput, TimedBalance, Transaction } from './interface';

"use strict";
exports.__esModule = true;
//# sourceMappingURL=responses.js.map
export * from './responses';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { TypedResponse, Witness } from '../common';

"use strict";
exports.__esModule = true;
//# sourceMappingURL=interface.js.map

@@ -0,0 +0,0 @@ import { AddressAbstractEntry, Asset, ContractInvocationStats, Balance, Block, NodeMetaData, TransferAbstract, TypedResponse, Witness } from '../common';

"use strict";
exports.__esModule = true;
//# sourceMappingURL=responses.js.map
export * from './api';
export * from './rest';

@@ -14,2 +14,3 @@ "use strict";

__exportStar(require("./api"), exports);
__exportStar(require("./rest"), exports);
//# sourceMappingURL=index.js.map

@@ -42,28 +42,2 @@ "use strict";

describe('neo legacy', function () {
it('should get address_stats', function () { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, neo_legacy_1.NeoLegacyREST.addressStats('AZ3JaZ9myjiW98hwLvc3F4RQVvVX4Pm83M')];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.length, 14);
return [2];
}
});
}); }).timeout(60000);
it("should get an address' abstract fields", function () { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, neo_legacy_1.NeoLegacyREST.getAddressAbstracts('ANeo2toNeo3MigrationAddressxwPB2Hz')];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.entries.length, 15);
return [2];
}
});
}); });
it('should get the claimable transactions', function () { return __awaiter(void 0, void 0, void 0, function () {

@@ -70,0 +44,0 @@ var res;

@@ -46,8 +46,8 @@ "use strict";

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.asset('0x3466566e4f93d788a7129231b363e7f32fd50f07', 'testnet')];
case 0: return [4, neo_1.NeoRest.asset('0xd2a4cff31913016155e38e474a2c06d08be276cf', 'testnet')];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.name, 'GAS');
chai_1.assert.strictEqual(res.scripthash, '0x3466566e4f93d788a7129231b363e7f32fd50f07');
chai_1.assert.strictEqual(res.name, 'GasToken');
chai_1.assert.strictEqual(res.scripthash, '0xd2a4cff31913016155e38e474a2c06d08be276cf');
return [2];

@@ -74,7 +74,7 @@ }

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.balance('NijmPn3qW7F3rkFXMeL46pL7TJa51bbUgL', 'testnet')];
case 0: return [4, neo_1.NeoRest.balance('Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D', 'testnet')];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.length, 3);
chai_1.assert.isAtLeast(res.length, 2);
return [2];

@@ -88,3 +88,3 @@ }

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.block(315682, 'testnet')];
case 0: return [4, neo_1.NeoRest.block(0, 'testnet')];
case 1:

@@ -94,4 +94,4 @@ res = _a.sent();

chai_1.assert.isObject(res);
chai_1.assert.strictEqual(res.hash, '0x4c1b934d38aa54e678eefda4123299141c83c3c49436b8df8fb56e91f5414827');
chai_1.assert.strictEqual(res.size, 942);
chai_1.assert.strictEqual(res.hash, '0x9d3276785e7306daf59a3f3b9e31912c095598bbfb8a4476b821b0e59be4c57a');
chai_1.assert.strictEqual(res.size, 114);
return [2];

@@ -105,3 +105,3 @@ }

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.block(290939, 'testnet_rc4')];
case 0: return [4, neo_1.NeoRest.block(2486, 'testnet')];
case 1:

@@ -111,4 +111,4 @@ res = _a.sent();

chai_1.assert.isObject(res);
chai_1.assert.strictEqual(res.hash, '0xe91c52d01cf2106ba82fd40c585013c6f4b6a7384cf58ff535262717e3e350fa');
chai_1.assert.strictEqual(res.tx.length, 2);
chai_1.assert.strictEqual(res.hash, '0xe0f8d56fb07b79be5d572ccf0ad7b643e7cbc24d48dede875fd7e041e5debb7f');
chai_1.assert.strictEqual(res.tx.length, 1);
return [2];

@@ -136,3 +136,3 @@ }

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.contract('0xbf2d0fb512ace4cee9ee775b0aa6b9a498055e60', 'testnet')];
case 0: return [4, neo_1.NeoRest.contract('0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92', 'testnet')];
case 1:

@@ -142,4 +142,4 @@ res = _a.sent();

chai_1.assert.isObject(res);
chai_1.assert.strictEqual(res.id, 455);
chai_1.assert.strictEqual(res.hash, '0xbf2d0fb512ace4cee9ee775b0aa6b9a498055e60');
chai_1.assert.strictEqual(res.id, 2);
chai_1.assert.strictEqual(res.hash, '0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92');
chai_1.assert.isObject(res.nef);

@@ -167,3 +167,3 @@ return [2];

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.contractStats('0x5a82be96f042df27d8f37f237805796af6fbbf74', 'testnet_rc4')];
case 0: return [4, neo_1.NeoRest.contractStats('0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92', 'testnet')];
case 1:

@@ -206,9 +206,9 @@ res = (_a.sent());

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.log('0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4', 'testnet')];
case 0: return [4, neo_1.NeoRest.log('0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535', 'testnet')];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.txid, '0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4');
chai_1.assert.strictEqual(res.txid, '0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535');
chai_1.assert.strictEqual(res.trigger, 'Application');
chai_1.assert.strictEqual(res.notifications.length, 2);
chai_1.assert.strictEqual(res.notifications.length, 1);
return [2];

@@ -223,10 +223,10 @@ }

switch (_b.label) {
case 0: return [4, neo_1.NeoRest.transaction('0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4', 'testnet')];
case 0: return [4, neo_1.NeoRest.transaction('0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535', 'testnet')];
case 1:
res = _b.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.strictEqual(res.hash, '0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4');
chai_1.assert.strictEqual(res.sender, 'NgUS1Jd5oPRPCJfaX1UnXdeKNuxLDQg1Vo');
chai_1.assert.strictEqual(res.size, 2295);
chai_1.assert.strictEqual((_a = res.signers) === null || _a === void 0 ? void 0 : _a.length, 1);
chai_1.assert.strictEqual(res.hash, '0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535');
chai_1.assert.strictEqual(res.sender, 'NVfj3vnyBCUb2E2eSFacY3N4Q1UU9ed3FG');
chai_1.assert.strictEqual(res.size, 860);
chai_1.assert.strictEqual((_a = res.signers) === null || _a === void 0 ? void 0 : _a.length, 2);
return [2];

@@ -251,17 +251,2 @@ }

}); });
it('should get the enhanced transactions for an address', function () { return __awaiter(void 0, void 0, void 0, function () {
var res;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, neo_1.NeoRest.addressTransactions('NNtgxn9X4oRG1y7UfxDyjef8aFy6eRpApa', 1)];
case 1:
res = _a.sent();
chai_1.assert.isNotNull(res);
chai_1.assert.isObject(res);
chai_1.assert.isArray(res.items);
chai_1.assert.isAtLeast(res.items.length, 14);
return [2];
}
});
}); });
it('should get transfer history', function () { return __awaiter(void 0, void 0, void 0, function () {

@@ -271,3 +256,3 @@ var res;

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.transferHistory('NeFM2R8bq9c5q9bvsoargVH4MifMrXDikH', 2, 'testnet')];
case 0: return [4, neo_1.NeoRest.transferHistory('Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D', 1, 'testnet')];
case 1:

@@ -278,3 +263,3 @@ res = _a.sent();

chai_1.assert.isArray(res.items);
chai_1.assert.strictEqual(res.items.length, 15);
chai_1.assert.isAtLeast(res.items.length, 2);
return [2];

@@ -288,3 +273,3 @@ }

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.voter('NNtgxn9X4oRG1y7UfxDyjef8aFy6eRpApa')];
case 0: return [4, neo_1.NeoRest.voter('Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D')];
case 1:

@@ -315,3 +300,3 @@ res = _a.sent();

switch (_a.label) {
case 0: return [4, neo_1.NeoRest.addressTXFull('Nf1iww8HZ2V6ZEntvDueDxqVNRUyMtMuRw', 1)];
case 0: return [4, neo_1.NeoRest.addressTXFull('Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D', 1, 'testnet')];
case 1:

@@ -322,3 +307,3 @@ res = _a.sent();

chai_1.assert.isArray(res.items);
chai_1.assert.isAtLeast(res.items.length, 14);
chai_1.assert.isAtLeast(res.items.length, 2);
return [2];

@@ -325,0 +310,0 @@ }

"use strict";
//# sourceMappingURL=http.js.map
"use strict";
//# sourceMappingURL=index.js.map
{
"name": "@cityofzion/dora-ts",
"version": "0.0.10",
"version": "0.0.11",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index",

@@ -0,0 +0,0 @@ <p align="center">

@@ -24,8 +24,24 @@ import type {

} from '../../interfaces/api/neo_legacy'
import { AXIOS_DORA } from '../../constants'
import type { RestConfig } from "../../interfaces";
import {DORA_URL} from '../../constants'
import type { AxiosInstance, AxiosRequestConfig } from 'axios'
import axios from 'axios'
export class NeoLegacyREST {
static axios = AXIOS_DORA('neoLegacy')
const DefaultLegacyRestConfig: RestConfig = {
doraUrl: DORA_URL,
endpoint: '/api/v1/neo2'
}
static async addressStats(
export class NeoLegacyRESTApi {
protected axios: AxiosInstance;
public constructor(restConfig: RestConfig = DefaultLegacyRestConfig, axiosConfig?: AxiosRequestConfig) {
if (typeof axiosConfig === 'undefined') {
axiosConfig = { baseURL: restConfig.doraUrl + restConfig.endpoint };
} else {
axiosConfig["baseURL"] = restConfig.doraUrl + restConfig.endpoint;
}
this.axios = axios.create(axiosConfig)
}
async addressStats(
address: string,

@@ -38,3 +54,3 @@ network = 'mainnet'

static async asset(
async asset(
assetHash: string,

@@ -47,3 +63,3 @@ network = 'mainnet'

static async assets(
async assets(
page: number = 1,

@@ -56,3 +72,3 @@ network = 'mainnet'

static async balance(
async balance(
address: string,

@@ -65,3 +81,3 @@ network = 'mainnet'

static async block(
async block(
blockHash: string,

@@ -74,3 +90,3 @@ network = 'mainnet'

static async blocks(
async blocks(
page: number = 1,

@@ -83,3 +99,3 @@ network = 'mainnet'

static async contract(
async contract(
contractHash: string,

@@ -92,3 +108,3 @@ network = 'mainnet'

static async contracts(
async contracts(
page: number,

@@ -101,3 +117,3 @@ network = 'mainnet'

static async contractStats(
async contractStats(
contractHash: string,

@@ -110,3 +126,3 @@ network = 'mainnet'

static async contractTransfers(
async contractTransfers(
contractHash: string,

@@ -120,3 +136,3 @@ page: number = 1,

static async getAddressAbstracts(
async getAddressAbstracts(
address: string,

@@ -130,3 +146,3 @@ page = 1,

static async getAllNodes(network = 'mainnet'): Promise<GetAllNodesResponse> {
async getAllNodes(network = 'mainnet'): Promise<GetAllNodesResponse> {
const method = 'get_all_nodes'

@@ -136,3 +152,3 @@ return await this.get(network, method)

static async getClaimable(
async getClaimable(
address: string,

@@ -145,3 +161,3 @@ network = 'mainnet'

static async getUnclaimed(
async getUnclaimed(
address: string,

@@ -154,3 +170,3 @@ network = 'mainnet'

static async height(network = 'mainnet'): Promise<HeightResponse> {
async height(network = 'mainnet'): Promise<HeightResponse> {
const method = 'height'

@@ -160,3 +176,3 @@ return await this.get(network, method)

static async invocationStats(
async invocationStats(
network = 'mainnet'

@@ -168,3 +184,3 @@ ): Promise<InvocationStatsResponse> {

static async log(
async log(
contractHash: string,

@@ -177,3 +193,3 @@ network = 'mainnet'

static async storage(
async storage(
blockHash: string,

@@ -186,3 +202,3 @@ network = 'mainnet'

static async transaction(
async transaction(
txid: string,

@@ -195,3 +211,3 @@ network = 'mainnet'

static async transactions(
async transactions(
page: number = 1,

@@ -204,3 +220,3 @@ network = 'mainnet'

static async transactionAbstracts(
async transactionAbstracts(
txid: string,

@@ -213,3 +229,3 @@ network = 'mainnet'

static async transferHistory(
async transferHistory(
address: string,

@@ -223,3 +239,3 @@ page: number = 1,

private static async get(...args: any[]) {
private async get(...args: any[]) {
const endpoint = args.join('/')

@@ -230,1 +246,3 @@ const { data } = await this.axios.get(`/${endpoint}`)

}
export const NeoLegacyREST = new NeoLegacyRESTApi()

@@ -20,8 +20,24 @@ import type {

} from '../../interfaces/api/neo'
import { AXIOS_DORA } from '../../constants'
import type { RestConfig } from "../../interfaces";
import {DORA_URL} from '../../constants'
import type { AxiosInstance, AxiosRequestConfig } from 'axios'
import axios from 'axios'
export class NeoRest {
static axios = AXIOS_DORA('neo')
const DefaultRestConfig: RestConfig = {
doraUrl: DORA_URL,
endpoint: '/api/v1/neo3'
}
static async addressTransactions(
export class NeoRESTApi {
protected axios: AxiosInstance;
public constructor(restConfig: RestConfig = DefaultRestConfig, axiosConfig?: AxiosRequestConfig) {
if (typeof axiosConfig === 'undefined') {
axiosConfig = { baseURL: restConfig.doraUrl + restConfig.endpoint };
} else {
axiosConfig["baseURL"] = restConfig.doraUrl + restConfig.endpoint;
}
this.axios = axios.create(axiosConfig)
}
async addressTransactions(
address: string,

@@ -35,3 +51,3 @@ page = 1,

static async addressTXFull(
async addressTXFull(
address: string,

@@ -45,3 +61,3 @@ page = 1,

static async asset(
async asset(
assetHash: string,

@@ -54,3 +70,3 @@ network = 'mainnet'

static async assets(page: number = 1, network = 'mainnet'): Promise<any> {
async assets(page: number = 1, network = 'mainnet'): Promise<any> {
const method = 'assets'

@@ -60,3 +76,3 @@ return await this.get(network, method, page)

static async balance(
async balance(
address: string,

@@ -69,3 +85,3 @@ network = 'mainnet'

static async block(
async block(
blockHeight: number,

@@ -78,3 +94,3 @@ network = 'mainnet'

static async blocks(
async blocks(
page: number = 1,

@@ -87,3 +103,3 @@ network = 'mainnet'

static async committee(network = 'mainnet'): Promise<BalanceResponse> {
async committee(network = 'mainnet'): Promise<BalanceResponse> {
const method = 'committee'

@@ -93,3 +109,3 @@ return await this.get(network, method)

static async contract(
async contract(
contractHash: string,

@@ -102,3 +118,3 @@ network = 'mainnet'

static async contracts(
async contracts(
page: number,

@@ -111,3 +127,3 @@ network = 'mainnet'

static async contractStats(
async contractStats(
contractHash: string,

@@ -120,3 +136,3 @@ network = 'mainnet'

static async getAddressAbstracts(
async getAddressAbstracts(
address: string,

@@ -130,3 +146,3 @@ page = 1,

static async getAllNodes(network = 'mainnet'): Promise<GetAllNodesResponse> {
async getAllNodes(network = 'mainnet'): Promise<GetAllNodesResponse> {
const method = 'get_all_nodes'

@@ -136,3 +152,3 @@ return await this.get(network, method)

static async height(network = 'mainnet'): Promise<HeightResponse> {
async height(network = 'mainnet'): Promise<HeightResponse> {
const method = 'height'

@@ -142,3 +158,3 @@ return await this.get(network, method)

static async invocationStats(
async invocationStats(
network = 'mainnet'

@@ -150,3 +166,3 @@ ): Promise<InvocationStatsResponse> {

static async log(txid: string, network = 'mainnet'): Promise<LogResponse> {
async log(txid: string, network = 'mainnet'): Promise<LogResponse> {
const method = 'log'

@@ -156,3 +172,3 @@ return await this.get(network, method, txid)

static async transaction(
async transaction(
txid: string,

@@ -165,3 +181,3 @@ network = 'mainnet'

static async transactions(
async transactions(
page: number = 1,

@@ -174,3 +190,3 @@ network = 'mainnet'

static async transferHistory(
async transferHistory(
address: string,

@@ -184,3 +200,3 @@ page: number = 1,

static async voter(
async voter(
address: string,

@@ -193,3 +209,3 @@ network = 'mainnet'

private static async get(...args: any[]) {
private async get(...args: any[]) {
const endpoint = args.join('/')

@@ -200,1 +216,3 @@ const { data } = await this.axios.get(`/${endpoint}`)

}
export const NeoRest = new NeoRESTApi()

@@ -1,18 +0,1 @@

import type { AxiosInstance } from 'axios'
import axios from 'axios'
export const DORA_URL = 'https://dora.coz.io'
export const AXIOS_DORA = (version: string): AxiosInstance => {
let endpoint: string = ''
if (version === 'neoLegacy') {
endpoint = '/api/v1/neo2'
} else if (version === 'neo') {
endpoint = '/api/v1/neo3'
}
return axios.create({
baseURL: DORA_URL + endpoint
})
}
//export * from "./common"
export * from './api'
export * from './rest'

@@ -5,17 +5,19 @@ import { assert } from 'chai'

describe('neo legacy', () => {
it('should get address_stats', async () => {
const res = await NeoLegacyREST.addressStats(
'AZ3JaZ9myjiW98hwLvc3F4RQVvVX4Pm83M'
)
assert.isNotNull(res)
assert.strictEqual(res.length, 14)
}).timeout(60000)
// timeout
// it('should get address_stats', async () => {
// const res = await NeoLegacyREST.addressStats(
// 'AZ3JaZ9myjiW98hwLvc3F4RQVvVX4Pm83M'
// )
// assert.isNotNull(res)
// assert.strictEqual(res.length, 14)
// }).timeout(60000)
it("should get an address' abstract fields", async () => {
const res = await NeoLegacyREST.getAddressAbstracts(
'ANeo2toNeo3MigrationAddressxwPB2Hz'
)
assert.isNotNull(res)
assert.strictEqual(res.entries.length, 15)
})
// timeout
// it("should get an address' abstract fields", async () => {
// const res = await NeoLegacyREST.getAddressAbstracts(
// 'ANeo2toNeo3MigrationAddressxwPB2Hz'
// )
// assert.isNotNull(res)
// assert.strictEqual(res.entries.length, 15)
// })

@@ -22,0 +24,0 @@ it('should get the claimable transactions', async () => {

import { assert } from 'chai'
import { NeoRest } from '../../../api/neo'
describe('neo sdk', () => {
it('should get an asset', async () => {
const res = await NeoRest.asset(
'0x3466566e4f93d788a7129231b363e7f32fd50f07',
'0xd2a4cff31913016155e38e474a2c06d08be276cf',
'testnet'
)
assert.isNotNull(res)
assert.strictEqual(res.name, 'GAS')
assert.strictEqual(res.name, 'GasToken')
assert.strictEqual(
res.scripthash,
'0x3466566e4f93d788a7129231b363e7f32fd50f07'
'0xd2a4cff31913016155e38e474a2c06d08be276cf'
)

@@ -26,11 +27,12 @@ })

const res = await NeoRest.balance(
'NijmPn3qW7F3rkFXMeL46pL7TJa51bbUgL',
'Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D',
'testnet'
)
assert.isNotNull(res)
assert.strictEqual(res.length, 3)
// 2 because of NEO and GAS
assert.isAtLeast(res.length, 2)
})
it('should get a block', async () => {
const res = await NeoRest.block(315682, 'testnet')
const res = await NeoRest.block(0, 'testnet')
assert.isNotNull(res)

@@ -40,9 +42,9 @@ assert.isObject(res)

res.hash,
'0x4c1b934d38aa54e678eefda4123299141c83c3c49436b8df8fb56e91f5414827'
'0x9d3276785e7306daf59a3f3b9e31912c095598bbfb8a4476b821b0e59be4c57a'
)
assert.strictEqual(res.size, 942)
assert.strictEqual(res.size, 114)
})
it('should get a block with transactions', async () => {
const res = await NeoRest.block(290939, 'testnet_rc4')
const res = await NeoRest.block(2486, 'testnet')
assert.isNotNull(res)

@@ -52,5 +54,5 @@ assert.isObject(res)

res.hash,
'0xe91c52d01cf2106ba82fd40c585013c6f4b6a7384cf58ff535262717e3e350fa'
'0xe0f8d56fb07b79be5d572ccf0ad7b643e7cbc24d48dede875fd7e041e5debb7f'
)
assert.strictEqual(res.tx.length, 2)
assert.strictEqual(res.tx.length, 1)
})

@@ -67,3 +69,3 @@

const res = await NeoRest.contract(
'0xbf2d0fb512ace4cee9ee775b0aa6b9a498055e60',
'0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92',
'testnet'

@@ -73,4 +75,4 @@ )

assert.isObject(res)
assert.strictEqual(res.id, 455)
assert.strictEqual(res.hash, '0xbf2d0fb512ace4cee9ee775b0aa6b9a498055e60')
assert.strictEqual(res.id, 2)
assert.strictEqual(res.hash, '0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92')
assert.isObject(res.nef)

@@ -87,4 +89,4 @@ })

const res = (await NeoRest.contractStats(
'0x5a82be96f042df27d8f37f237805796af6fbbf74',
'testnet_rc4'
'0x4625b78c56b7e43e1e6fb4ed0200e9a0a9152c92',
'testnet'
)) as any

@@ -109,3 +111,3 @@ assert.isNotNull(res)

const res = await NeoRest.log(
'0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4',
'0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535',
'testnet'

@@ -116,6 +118,6 @@ )

res.txid,
'0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4'
'0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535'
)
assert.strictEqual(res.trigger, 'Application')
assert.strictEqual(res.notifications.length, 2)
assert.strictEqual(res.notifications.length, 1)
})

@@ -125,3 +127,3 @@

const res = await NeoRest.transaction(
'0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4',
'0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535',
'testnet'

@@ -132,7 +134,7 @@ )

res.hash,
'0xedf5c6e18f5e9f1836b6f8c8ddb4ae4d31e66420098ea778eb533e189a7ef8f4'
'0x7f40e2252fe791b89d60c2cdd9419de7984e5fab6d941d3cf3a8d0c96135c535'
)
assert.strictEqual(res.sender, 'NgUS1Jd5oPRPCJfaX1UnXdeKNuxLDQg1Vo')
assert.strictEqual(res.size, 2295)
assert.strictEqual(res.signers?.length, 1)
assert.strictEqual(res.sender, 'NVfj3vnyBCUb2E2eSFacY3N4Q1UU9ed3FG')
assert.strictEqual(res.size, 860)
assert.strictEqual(res.signers?.length, 2)
})

@@ -148,17 +150,18 @@

it('should get the enhanced transactions for an address', async () => {
const res = await NeoRest.addressTransactions(
'NNtgxn9X4oRG1y7UfxDyjef8aFy6eRpApa',
1
)
assert.isNotNull(res)
assert.isObject(res)
assert.isArray(res.items)
assert.isAtLeast(res.items.length, 14)
})
// TODO: broken on API v1 side, v2 not yet implemented. Skip for now
// it('should get the enhanced transactions for an address', async () => {
// const res = await NeoRest.addressTransactions(
// 'Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D',
// 1
// )
// assert.isNotNull(res)
// assert.isObject(res)
// assert.isArray(res.items)
// assert.isAtLeast(res.items.length, 14)
// })
it('should get transfer history', async () => {
const res = await NeoRest.transferHistory(
'NeFM2R8bq9c5q9bvsoargVH4MifMrXDikH',
2,
'Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D',
1,
'testnet'

@@ -169,7 +172,7 @@ )

assert.isArray(res.items)
assert.strictEqual(res.items.length, 15)
assert.isAtLeast(res.items.length, 2)
})
it('should get the voter information of a user', async () => {
const res = await NeoRest.voter('NNtgxn9X4oRG1y7UfxDyjef8aFy6eRpApa')
const res = await NeoRest.voter('Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D')
assert.isNotNull(res)

@@ -187,4 +190,5 @@ assert.isObject(res)

const res = await NeoRest.addressTXFull(
'Nf1iww8HZ2V6ZEntvDueDxqVNRUyMtMuRw',
1
'Nb9QYTVx8F6j5kKi1k1ERaUTFfSX5JRq2D',
1,
'testnet'
)

@@ -194,4 +198,4 @@ assert.isNotNull(res)

assert.isArray(res.items)
assert.isAtLeast(res.items.length, 14)
assert.isAtLeast(res.items.length, 2)
})
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc