-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIL-248 - double-check allowance with Glif
- Loading branch information
1 parent
82509c6
commit aa3a170
Showing
4 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import axios from "axios"; | ||
import { config } from "../config"; | ||
import { logDebug } from "../utils/consoleLogger"; | ||
import { type GetVerifiedClientStatusReturn } from "types"; | ||
|
||
export const getVerifiedClientStatus = async ( | ||
clientId: string, | ||
): Promise<GetVerifiedClientStatusReturn> => { | ||
logDebug(`Requesting allocators from backend`); | ||
try { | ||
const response = await axios.post(config.glifApi, { | ||
jsonrpc: "2.0", | ||
method: "Filecoin.StateVerifiedClientStatus", | ||
params: [clientId, null], | ||
id: 0, | ||
}); | ||
return { | ||
data: response.data.result, | ||
error: "", | ||
success: true, | ||
}; | ||
} catch (error) { | ||
const errMessage = `Error accessing Glif API Filecoin.StateVerifiedClientStatus: ${error.message}`; | ||
return { | ||
data: "", | ||
error: errMessage, | ||
success: false, | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters