Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eba3b3
commit 2335ac3
Showing
3 changed files
with
77 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,75 @@ | ||
import { MethodMetadata, Parameter } from '..'; | ||
|
||
import { Headers } from '../../helpers/axios'; | ||
import { useMasaMutation, useRestCall } from '../../helpers/rest-calls'; | ||
|
||
const path = 'contracts/credit-score/mint'; | ||
export function useMethod({ body }: any) { | ||
const { data, error, loading, getData } = useRestCall({ | ||
headers: Headers, | ||
metadata, | ||
body, | ||
}); | ||
|
||
return { data, error, loading, getData }; | ||
} | ||
|
||
export function useSimpleMethod({ pathParameters, body, settings }: any) { | ||
const masaQuery = useMasaMutation( | ||
'mint-soulname', | ||
{ | ||
pathParameters, | ||
headers: Headers, | ||
body, | ||
metadata, | ||
}, | ||
settings | ||
); | ||
return masaQuery; | ||
} | ||
|
||
|
||
const parameters: Parameter[] = [ | ||
{ | ||
key: 1, | ||
name: 'operation', | ||
description: 'The Soul Bound Token type to Mint', | ||
required: 'yes', | ||
default: 'Identity', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 2, | ||
name: 'name', | ||
description: 'The name of the Soul Bound Identity', | ||
required: 'yes', | ||
default: 'MyName', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 3, | ||
name: 'address', | ||
description: 'The receiver address of the Soul Bound Token', | ||
required: 'yes', | ||
default: '0x8ba2D360323e3cA85b94c6F7720B70aAc8D37a7a', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 4, | ||
name: 'signature', | ||
description: 'The signature of the Users wallet', | ||
required: 'yes', | ||
default: | ||
'0x2e3d358b8f61064f7b998f9bb629fed0bcea2883192b1690a56b5c8bc978d4bb3f9ae4b7bccab04a786bd85157fbb2c261c5bfe5f0dd588c9ed7983f0f3fc8231b', | ||
dataType: 'string', | ||
}, | ||
]; | ||
export const metadata: MethodMetadata = { | ||
author: 'Aaron Knott', | ||
authorPicture: '', | ||
description: | ||
'Mint a credit score from Cred Protocol based on a wallet and store on the backend ( minted in the middleware )', | ||
name: path, | ||
method: 'POST', | ||
parameters, | ||
}; |