Skip to content

Commit

Permalink
new call
Browse files Browse the repository at this point in the history
  • Loading branch information
0xk0stas committed Oct 12, 2023
1 parent 4684ebd commit 9afb828
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/utils/types/sc.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface IScPayment {
}

export interface IScUserInfo {
username: string;
address: string;
secretWords: string[];
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home/components/NewUserForm/CreateWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function CreateWallet({formData, email, platform, handleReset}: {
}

const handleSubmit = () => {
createUser(formData.username || "", email, platform, walletInfo.address, walletInfo.words);
createUser(email, walletInfo.address, walletInfo.words);

const password = 'password';
const addressIndex = 0;
Expand Down
6 changes: 2 additions & 4 deletions src/views/Home/services/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ import { ChainId } from "../../../api/net.config";
import { ApiNetworkProvider } from "@multiversx/sdk-network-providers";
import { useGetSignedTransactions } from "@multiversx/sdk-dapp/hooks";

export const createUser = async (username: string, emailEncrypted: string, platform: string, address: string, secretWords: string) => {
export const createUser = async (email: string, address: string, secretWords: string) => {

const words = secretWords.split('.').filter((value) => value !== "").map((value) => BytesValue.fromUTF8(value));
const args = [
BytesValue.fromUTF8(username),
BytesValue.fromUTF8(emailEncrypted),
BytesValue.fromUTF8(platform),
BytesValue.fromUTF8(email),
new AddressValue(new Address(address)),
...words
];
Expand Down

0 comments on commit 9afb828

Please sign in to comment.