with MEXC and APImage?
import { axios } from "@pipedream/platform";
import crypto from "crypto";
export default defineComponent({
props: {
mexc: {
type: "app",
app: "mexc",
}
},
async run({ steps, $ }) {
// Build query string
const timestamp = Date.now()
const recvWindow = 5000
const queryString = `recvWindow=${recvWindow}×tamp=${timestamp}`
// Generate signature
const signature = crypto
.createHmac('sha256', this.mexc.$auth.secret_key)
.update(queryString)
.digest('hex')
// Make authenticated request
return await axios($, {
method: 'GET',
url: 'https://api.mexc.com/api/v3/account',
headers: {
'X-MEXC-APIKEY': this.mexc.$auth.access_key
},
params: {
recvWindow,
timestamp,
signature
}
})
},
})
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
apimage: {
type: "app",
app: "apimage",
}
},
async run({steps, $}) {
const data = {
"prompt": `Generate an image depicting a modern workspace with clean design elements. Include a laptop, coffee mug, and subtle ambient lighting. `,
}
return await axios($, {
method: "post",
url: `https://apimage.org/api/ai-image-generate`,
headers: {
Authorization: `Bearer ${this.apimage.$auth.api_key}`,
"accept": `application/json`,
},
data,
})
},
})