@stellar/stellar-sdk
Version:
A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.
15 lines (14 loc) • 454 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.specFromWasm = specFromWasm;
var _utils = require("./utils");
function specFromWasm(wasm) {
var customData = (0, _utils.parseWasmCustomSections)(wasm);
var xdrSections = customData.get("contractspecv0");
if (!xdrSections || xdrSections.length === 0) {
throw new Error("Could not obtain contract spec from wasm");
}
return Buffer.from(xdrSections[0]);
}