Magic Labs | The fastest way to build onchain

1 min read Original article ↗

01const getOrCreateWallet = async () => {

02 const res = await fetch("https://tee.express.magiclabs.com/v1/wallet", {

03 method: "POST",

04 headers: {

05 "Content-Type": "application/json",

06 Authorization: `Bearer ${"YOUR-AUTH-PROVIDER-JWT"}`,

07 "X-Magic-API-Key": "YOUR-MAGIC-API-KEY",

08 "X-OIDC-Provider-ID": "YOUR-MAGIC-PROVIDER-ID",

09 "X-Magic-Chain": "ETH",

10 },

11 });

12 const data = await res.json();

13 return data.public_address;

14};