with Microsoft Graph API (daemon app) and MEXC?
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
microsoft_graph_api_daemon_app: {
type: "app",
app: "microsoft_graph_api_daemon_app",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://graph.microsoft.com/v1.0/users`,
headers: {
Authorization: `Bearer ${this.microsoft_graph_api_daemon_app.$auth.oauth_access_token}`,
},
})
},
})
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
}
})
},
})