@firefly-exchange/firefly-client
Version:
The Firefly Client Library allows traders to sign, create, retrieve and listen to orders on Firefly Exchange.
30 lines • 1.71 kB
JavaScript
/**
* GenerateReadOnlyToken API
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable no-console */
const index_1 = require("../index");
function main() {
return __awaiter(this, void 0, void 0, function* () {
// ensure that account has enough native gas tokens to perform on-chain USDC.mint() call
const dummyAccountKey = "4d6c9531e0042cc8f7cf13d8c3cf77bfe239a8fed95e198d498ee1ec0b1a7e83";
// using TESTNET network
const client = new index_1.FireflyClient(true, index_1.Networks.TESTNET_ARBITRUM, dummyAccountKey); // passing isTermAccepted = true for compliance and authorizarion
yield client.init();
// generate a read-only token for user which can be used to provide read-only access to data to non-owners
const response = yield client.generateReadOnlyToken();
console.log("Readonly-token for user:", response.data);
});
}
main().then().catch(console.warn);
//# sourceMappingURL=24-generate-readonly-token.js.map
;