still not working
small update. I used the address from
const { walletAddress, chainId} = useMoralisDapp();
it is requesting to sign now. However I have problems with others
this is NativeBalance hook
import { getNativeByChain } from âhelpers/networksâ;
import { useMoralisDapp } from âproviders/MoralisDappProvider/MoralisDappProviderâ;
import { useEffect, useMemo, useState } from âreactâ;
import { useMoralis, useMoralisWeb3Api, useMoralisWeb3ApiCall } from âreact-moralisâ;
export const useNativeBalance = (options) => {
const { account } = useMoralisWeb3Api();
const { Moralis } = useMoralis();
const { chainId, walletAddress } = useMoralisDapp();
const [balance, setBalance] = useState({ inWei: 0, formatted: 0 });
const nativeName = useMemo(() => getNativeByChain(options?.chain || chainId), [options, chainId]);
const {
fetch: getBalance,
data,
error,
isLoading,
} = useMoralisWeb3ApiCall(account.getNativeBalance, {
chain: chainId,
address: walletAddress,
...options,
});
useEffect(() => {
if (data?.balance) {
const balances = {
inWei: data.balance,
// missing second argument (decimals) in FromWei function,
formatted: Moralis.Units.FromWei(data.balance),
};
setBalance(balances);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [data]);
return { getBalance, balance, nativeName, error, isLoading };
};
does this code need to be modified too?
Youâre getting these errors after you authenticate?
If itâs before, it may be related to this issue.
can you explain what âx-parse-application-idâ and âappidhereâ are? I will try to see if that fixes it
in my .env for self server app id =001
Yes you would put in your own serverâs appId. x-parse-application-id
is the name of the header that is needed to get past the unauthorized (403 Forbidden) issue if you are not authenticated.
I am not sure if that issue is related to yours exactly but you can try it.
it worked! thanks for the help! I am having another issue a bit unrelated I created another issue
Hello,
In my cloud functions, there is a param which is array of string. (request.params.pendingSlots)
Parse.Cloud.define(âstartBattleâ, async (request: { user: { get: (arg0: string) => any; }; params: { wallet: string; mainOwner: any; lang: string; roosterId: string; pendingSlots: string[]; }; }) âŚ
however, when I read it in the function, it becomes string. For example (I used Postman):
request.params.pendingSlots = [â142218â, â0â, â0â, â0â,â0â, â0â, â0â]
â> it returns request.params.pendingSlots[2] = 1 which is the second character, not the second item in the array
Am I sending Post request incorrectly via Postman? or how should I modify the cloud function declaration?
Thanks
I donât know about the function declaration, all parameters are found in request, you can use console.log(JSON.stringify(request))
to see how it looks
all the parameters should be in a json format that you can parse in order to extract the data
maybe you have to do a json parse for that request.params.pendingSlots
in order to get the list
Hi Team, I have my dApp on the free plan and looking to self host the server and migrate all functionalities currently we are using in the application. Will there be any issues in working on the migration past Dec 1st?
the server will be archived on 1 December, you can do a backup of the database before that, and for all the settings that you have or cloud code
I got âParse.bulkUpdateMany is not a functionâ in the cloud functions. How should I update this function?
Thanks
you could connect directly to mongo db now too from cloud code in order to run a bulk update
Thanks.
So, there isnât a equivalent function to do bulkUpdateMany in the Parse object?
- And how to âconnect directly to mongodb from cloud codeâ? Do you have an example?
Thanks
there isnât an equivalent for that in the Parse sdk, you connect directly by importing mongo db and using it
similar to how it is used here
https://v1docs.moralis.io/moralis-dapp/database/direct_access#node.js
Some wallets is receiving this error message while logging in âinvalid session tokenâ, while most of the wallets can login successfully.
If the error wallet logs in to the current Moralis Server, it works normally.
What should be the problem?
Thanks
is anything specific to those wallets? did you delete anything from user table and from ethAddress table before?
those wallets that donât work, do they have data in ethAddress table or in User table?
if you try to delete a user you have to delete from both User table and from ethAddress table
Hi,
I havenât imported ethAddress table to the new database yet. Those wallets that work, they can login without the ethAddress table
Do we really need to import ethAddress table? I donât see it is generated in the self-hosted server.
you donât need to import it
any difference between a wallet that works and one that doesnât work?
if you look in network tab do you see any difference?
bro please can you help me im having the exact same issue
please