From d14e49988a05777b24dcec0ddcfdf11ce3e01a79 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske <13647606+H34D@users.noreply.github.com> Date: Fri, 22 Jul 2022 11:03:14 +0200 Subject: [PATCH] adding api mint functionality --- src/common/rest/contracts-mint/index.ts | 50 +++++++++++++++++++++++++ src/common/rest/index.ts | 3 ++ 2 files changed, 53 insertions(+) create mode 100644 src/common/rest/contracts-mint/index.ts diff --git a/src/common/rest/contracts-mint/index.ts b/src/common/rest/contracts-mint/index.ts new file mode 100644 index 00000000..e6db3cf7 --- /dev/null +++ b/src/common/rest/contracts-mint/index.ts @@ -0,0 +1,50 @@ +import { MethodMetadata, Parameter } from '..'; +import { useRestCall } from '../../helpers/rest-calls'; + +const path = 'contracts/mint'; + +export function useMethod({ body }: any) { + const { data, error, loading, getData } = useRestCall({ + headers: Headers, + metadata, + body, + }); + + return { data, error, loading, getData }; +} + +const parameters: Parameter[] = [ + { + key: 1, + name: 'operation', + description: 'The Soul Bound Token type to Mint', + required: 'yes', + default: 'Identity', + dataType: 'string', + }, + { + key: 2, + name: 'address', + description: 'The receiver address of the Soul Bound Token', + required: 'yes', + default: '', + dataType: 'string', + }, + { + key: 3, + name: 'signature', + description: 'The signature of the Users wallet', + required: 'yes', + default: '', + dataType: 'string', + }, +]; + +export const metadata: MethodMetadata = { + author: 'Sebastian Gerske', + authorPicture: '', + description: 'Mints an Soul Bound Token to a users Wallet', + name: path, + method: 'POST', + parameters: parameters, +}; diff --git a/src/common/rest/index.ts b/src/common/rest/index.ts index 5e533cde..f4c167b7 100644 --- a/src/common/rest/index.ts +++ b/src/common/rest/index.ts @@ -6,6 +6,8 @@ import * as getCountries from './get-countries'; import * as postCountry from './post-country'; import * as farming from './farming'; +import * as contractsMint from './contracts-mint'; + import * as getVezgoLink from './vezgo/get-link'; import * as listVezgoProviders from './vezgo/list-providers'; import * as listVezgoAccounts from './vezgo/list-accounts'; @@ -51,6 +53,7 @@ export const masaRestClient = { farming, getClient, postClient, + contractsMint, getVezgoLink, listVezgoProviders, listVezgoAccounts,