Skip to content

Commit 0927d9c

Browse files
committed
Fix crossmint api calls
1 parent 9d12cb6 commit 0927d9c

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@goat-sdk/crossmint": patch
3+
---
4+
5+
Add content type to API calls

typescript/packages/wallets/crossmint/src/plugins/faucet.service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ export class CrossmintFaucetService {
3535

3636
const options = {
3737
method: "POST",
38-
headers: this.client.authHeaders,
38+
headers: {
39+
...this.client.authHeaders,
40+
"Content-Type": "application/json",
41+
},
3942
body: JSON.stringify({
40-
amount: parameters.amount,
43+
amount: 10,
4144
currency: "usdc",
4245
chain,
4346
}),
4447
};
4548

49+
console.log("options", options);
50+
4651
const response = await fetch(
4752
`${this.client.baseUrl}/api/v1-alpha2/wallets/${resolvedWalletAddress}/balances`,
4853
options,

typescript/packages/wallets/crossmint/src/plugins/mint.service.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export class CrossmintMintService {
1717
...parameters,
1818
chain: getCrossmintChainString(walletClient.getChain()),
1919
}),
20-
headers: this.client.authHeaders,
20+
headers: {
21+
...this.client.authHeaders,
22+
"Content-Type": "application/json",
23+
},
2124
});
2225

2326
const result = await response.json();
@@ -44,7 +47,10 @@ export class CrossmintMintService {
4447
})
4548
async getAllCollections(walletClient: EVMWalletClient, parameters: GetAllCollectionsParameters) {
4649
const response = await fetch(`${this.client.baseUrl}/collections/`, {
47-
headers: this.client.authHeaders,
50+
headers: {
51+
...this.client.authHeaders,
52+
"Content-Type": "application/json",
53+
},
4854
});
4955

5056
return await response.json();
@@ -101,7 +107,10 @@ export class CrossmintMintService {
101107
while (true) {
102108
attempts++;
103109
const response = await fetch(`${this.client.baseUrl}/api/2022-06-09/actions/${actionId}`, {
104-
headers: this.client.authHeaders,
110+
headers: {
111+
...this.client.authHeaders,
112+
"Content-Type": "application/json",
113+
},
105114
});
106115

107116
const body = await response.json();

0 commit comments

Comments
 (0)