Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
carina-akaia committed Jan 22, 2025
1 parent fd24c6b commit 45f4ce0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/features/profile-setup/hooks/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useProfileSetupForm = ({
.parseAsync(values)
.then(() => setCrossFieldErrors({}))
.catch((error: ZodError) =>
// TODO: Consider using `setErrors`
// TODO: Consider using `setError` in forEach ( in the future )
setCrossFieldErrors(
error?.issues.reduce((errors, { code, message, path }) => {
const fieldPath = path.at(0);
Expand Down
17 changes: 11 additions & 6 deletions src/features/profile-setup/models/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { parseNearAmount } from "near-api-js/lib/utils/format";

import { LISTS_CONTRACT_ACCOUNT_ID, SOCIAL_DB_CONTRACT_ACCOUNT_ID } from "@/common/_config";
import { naxiosInstance } from "@/common/api/near/client";
import { FIFTY_TGAS, FULL_TGAS, MIN_PROPOSAL_DEPOSIT_FALLBACK } from "@/common/constants";
import {
FIFTY_TGAS,
FULL_TGAS,
MIN_PROPOSAL_DEPOSIT_FALLBACK,
PUBLIC_GOODS_REGISTRY_LIST_ID,
} from "@/common/constants";
import { socialDbContractClient } from "@/common/contracts/social";
import { getDaoPolicy } from "@/common/contracts/sputnik-dao";
import deepObjectDiff from "@/common/lib/deepObjectDiff";
Expand Down Expand Up @@ -58,10 +63,6 @@ export const save = async ({ isDaoRepresentative, accountId, mode, data }: Profi
},
};

const potlockRegistryArgs = {
list_id: 1, // hardcoding to potlock registry list for now
};

// First, we have to check the account from social.near to see if it exists. If it doesn't, we need to add 0.1N to the deposit
try {
const account = await socialDbContractClient.getAccount({ accountId });
Expand All @@ -88,7 +89,11 @@ export const save = async ({ isDaoRepresentative, accountId, mode, data }: Profi
// lists.potlock.near
buildTransaction("register_batch", {
receiverId: LISTS_CONTRACT_ACCOUNT_ID,
args: potlockRegistryArgs,

args: {
list_id: PUBLIC_GOODS_REGISTRY_LIST_ID,
},

deposit: parseNearAmount("0.05")!,
gas: FULL_TGAS,
}),
Expand Down

0 comments on commit 45f4ce0

Please sign in to comment.