TypeScript SDK for the Maestro Dapp Platform
npm install @maestro-org/typescript-sdkbash
npm i @maestro-org/typescript-sdk
`Usage
`ts
import { MaestroClient, Configuration } from "@maestro-org/typescript-sdk";let maestroClient = new MaestroClient(
new Configuration({
apiKey: "",
network: "Preprod",
})
);
`
* To generate an API key, create a free account here!
* Network options: Preview, Preprod, Mainnet, SanchonetExample
`ts
import { MaestroClient, Configuration } from "@maestro-org/typescript-sdk";let maestroClient = new MaestroClient(
new Configuration({
apiKey: "",
network: "Preprod",
})
);
maestroClient.addresses
.utxosByAddress(
"adaddr_test1wpgexmeunzsykesf42d4eqet5yvzeap6trjnflxqtkcf66g0kpnxt"
)
.then((x) => console.log(x.data))
.catch((error) => {
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
// The request was made but no response was received
//
error.request is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
} else {
// Something happened in setting up the request that triggered an Error
console.log("Error", error.message);
}
});
maestroClient.addresses
.utxosByAddresses([
"addr_test1wpgexmeunzsykesf42d4eqet5yvzeap6trjnflxqtkcf66g0kpnxt",
])
.then((x) => console.log(x.data));``Meastro welcomes all contributors! Please see our contributing guidelines and code of conduct.