Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added functions for confirm,verify 2fa and mint 2fa
- Loading branch information
1 parent
105ea50
commit 9648aa5
Showing
4 changed files
with
181 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { MethodMetadata, Parameter } from '..'; | ||
|
||
import { Headers } from '../../helpers/axios'; | ||
import { useMasaMutation, useRestCall } from '../../helpers/rest-calls'; | ||
|
||
const path = 'session/confirm2FA'; | ||
|
||
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( | ||
'confirm-2fa', | ||
{ | ||
pathParameters, | ||
headers: Headers, | ||
body, | ||
metadata, | ||
}, | ||
settings | ||
); | ||
return masaQuery; | ||
} | ||
|
||
const parameters: Parameter[] = [ | ||
{ | ||
key: 1, | ||
name: 'Phone Number', | ||
description: 'Phone number used for 2FA', | ||
required: 'yes', | ||
default: 'Identity', | ||
dataType: 'string', | ||
}, | ||
]; | ||
|
||
export const metadata: MethodMetadata = { | ||
author: 'Aaron Knott', | ||
authorPicture: '', | ||
description: | ||
'Confirm 2FA using a phonenumber', | ||
name: path, | ||
method: 'POST', | ||
parameters, | ||
}; |
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,67 @@ | ||
import { MethodMetadata, Parameter } from '..'; | ||
|
||
import { Headers } from '../../helpers/axios'; | ||
import { useMasaMutation, useRestCall } from '../../helpers/rest-calls'; | ||
|
||
const path = 'contracts/2fa/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-2fa', | ||
{ | ||
pathParameters, | ||
headers: Headers, | ||
body, | ||
metadata, | ||
}, | ||
settings | ||
); | ||
return masaQuery; | ||
} | ||
|
||
const parameters: Parameter[] = [ | ||
{ | ||
key: 1, | ||
name: 'address', | ||
description: 'The receiver address of the Soul Bound Token', | ||
required: 'yes', | ||
default: '0x8ba2D360323e3cA85b94c6F7720B70aAc8D37a7a', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 2, | ||
name: 'phone number', | ||
description: 'Phone number that has been verified with 2FA', | ||
required: 'yes', | ||
default: '5551234567', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 3, | ||
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 2FA SBT', | ||
name: path, | ||
method: 'POST', | ||
parameters, | ||
}; |
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,59 @@ | ||
import { MethodMetadata, Parameter } from '..'; | ||
|
||
import { Headers } from '../../helpers/axios'; | ||
import { useMasaMutation, useRestCall } from '../../helpers/rest-calls'; | ||
|
||
const path = 'session/verify2FA'; | ||
|
||
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( | ||
'verify-2fa', | ||
{ | ||
pathParameters, | ||
headers: Headers, | ||
body, | ||
metadata, | ||
}, | ||
settings | ||
); | ||
return masaQuery; | ||
} | ||
|
||
const parameters: Parameter[] = [ | ||
{ | ||
key: 1, | ||
name: 'Code', | ||
description: 'The 2FA code sent to the user', | ||
required: 'yes', | ||
default: 'Identity', | ||
dataType: 'string', | ||
}, | ||
{ | ||
key: 2, | ||
name: 'Phone Number', | ||
description: 'Phone number used for 2FA', | ||
required: 'yes', | ||
default: 'Identity', | ||
dataType: 'string', | ||
}, | ||
]; | ||
|
||
export const metadata: MethodMetadata = { | ||
author: 'Aaron Knott', | ||
authorPicture: '', | ||
description: | ||
'Verify 2FA using a code and associated phonenumber', | ||
name: path, | ||
method: 'POST', | ||
parameters, | ||
}; |