#🚀・dev-support
1 messages · Page 10 of 1
they're python and go only, but they also don't explain what the quantity and such should be.
Well the quantity should be the amount you are trying to trade
Hey hey! Where can I read more about the RWA module exactly? Can't find on the repo or in the docs
well the number seemed pretty arbitrary, lol.
Would it be usdt deposit * inj price = order quantity in inj?
no, quantity refers to the base token. But that is basic orderbook trading, it is not Injective specific
well, when i placed a short order the quantity was pretty arbitrary. 6.464000000000000000
but the margin was the same as the usdt deposit amount
soooo
but it is you, the trader, that configures quantity and price (and margin in perp markets) when creating an order. If you made the values arbitrary I guess that is up to you
not rly sure
this is referenced from helix, i'm asking what helix parameters corespond to which parameters in the Msg
hi @topaz seal , I can't run MsgInstantPerpetualMarketLaunch in git@github.com:InjectiveLabs/sdk-go.git, so I don't know the response, but my question is after calling MsgInstantPerpetualMarketLaunch method, will we get the market ID for the new pair and we can use this id in create limit order, right?
the second question is I see quote and base token is a symbol, why not address?
thank you
if I require api access to data from say October 2023, do I need a entire archival node, or can I run something like a full node that dates back longer than the standard full node?
You don't receive a response to the message, what you receive is the response for the TX broadcast, since you don't send a message, you send a TX with the message in it.
If the TX is succesfully processed in a block, you will find an event in that TX with the market creation results. That event includes de market id for the new market.
There is an example on how to use this message in the Go SDK, both in the API documentation page and in the Go SDK repo, in the examples folder
I don't think I am following you with the second question
Nodes will in general contain information up to the point where they have been prunned. If you are the node manager, then it depends on you
I have deployed new smart contract on injective network and need to index all events from the contract.
What's the best solution? Please give me example code.
Hello checking on the RWA module
i see that InjectiveLabs/wasmd has ContractAddrLen = 32 (https://github.com/InjectiveLabs/wasmd/blob/4fe0380f00866027d650f5e2132ac6058aa51775/x/wasm/types/types.go#L21C1-L22C1), but contract addresses are actually 20 bytes. where is that conversion happening?
@frosty kiln
Where can i find the message to burn cw20 tokens
That depends on each contract implementation
Hello, looking for dev on injective! Website, token etc.
Hello. You should create a post in #1189372652561895475 . Your post will be lost in between newer messages pretty fast in this channel
Hello
Ninjas and builders 🥷
We are proud to present the smart contract console.
A useful tool that will help non coders to connect with smart contracts on @Injective with ease and a slick UI!
Give it a try now!
Only on Discoverinj https://t.co/OPkM4qclLH
#BUIDL #Injective #INJ
for all new builders of inj discoverinj made a A useful tool that will help non coders to connect with smart contracts on Injective with ease and a slick UI!
Hi guys !
How to navigate through all pages when using https://sentry.exchange.grpc-web.injective.network/api/explorer/v1/contractTxs/address ?
when I ping the wallet I want to read, I have the following pagination information:
{
"paging": {
"total": 10462,
"from": 1,
"to": 100
},
Is there any example of NFT contract on injective chain?
cc: @soft dome @topaz seal
Is there any dev here?
Well, it is called dev-chat right?
please check the pagination details in the API documentation page
Basically I'm trying to connect Injective chain through python and facing some ENS issues how to directly connect to injective??
No official example, no. Remember that Injective chain goal has nothing to do with NFTs. Anyone wanting to deploy NFTs projectsin the chain has all the right to do so, but those are third party projects
What are the issues? Are you using the Python SDK?
No where can I get that basically my goal is to get number of tokens of particular project address is holding through python
Please refer to the API documentation page before posting questions. The fact that you don't konw there is a Python SDK is an indication that you haven't even checked the docs
Can you share API doc pls?
You can find all the links in the Injective page. Also the doc page is the first result shown when you look for it in Google
https://letmegooglethat.com/?q=injective+api+documentation
What do you mean with API provider? Are you looking for a node provider?
I'm looking to run this code but facing error with injective provider url
"from web3 import Web3, HTTPProvider
Replace with your Injective node provider URL
injective_provider_url = ""
Injective address to check balance
injective_address = ""
def check_injective_balance(address):
"""Fetches and prints the balance of an Injective Chain address.
Args:
address: The Injective Chain address (starting with "inj").
"""
try:
# Connect to the Injective node
web3 = Web3(HTTPProvider(injective_provider_url))
# Fetch the balance
balance = web3.eth.getBalance(address)
# Print the balance
print(f"Balance of {address}: {balance}")
except Exception as e:
print(f"Error fetching balance: {e}")
if name == "main":
check_injective_balance(injective_address)
"
basically yes I think so
Not sure what is that code you are using there, but you are trying to use web3. Please check the API documentation and use the Python SDK instead
would you mind to share the link of the API documentation you refer to?
Try this bro:
url = f"https://lcd.injective.network/cosmos/bank/v1beta1/balances/{wallet}"
response = requests.get(url)
https://injective.notion.site/Injective-Exchange-Service-Setup-Guide-7e59980634d54991862300670583d46a
can i download and sync only Indexer, without Exchange and Chronos?
Also is there possibility to get block data, do smth with that data and then delete this block?
Hey guys! I subscribed on web socket on 'Tx' type and I'm receiving transactions. I successfully retrieved hash and got a transaction object from Tendermint37Client. Response is https://cosmos.github.io/cosmjs/latest/tendermint-rpc/interfaces/TxResponse.html.
How can I get messages and data from this object? It has "tx" and "result.data", but I don't know how to decode it
@topaz seal
That is cosmos general functioanlity, not Injective specific. You should refer to the cosmos documentation
I have 2 questions.
1: ) I got 403 error from https://sentry.tm.injective.network/
when I requested the URL
{ https://sentry.tm.injective.network/tx_search?query="tx.height>1 AND coin_spent.spender='inj192td8artyrr36fgnufulued3yjwp55kad28v77'" }
2: ) why can't get all trancsations specify an address by rpc api.
I tried get all transactions of an address.
However, they were not aware of all past transactions.
For anyone curious on the Instantiate2 issue, this is the recommended solution for now: https://github.com/CosmWasm/cosmwasm/issues/2155#issuecomment-2135238514
@quick shard for question 1, you can use https://injective-1-public-rpc.mesa.ec1-prod.newmetric.xyz/
Hello, after i set up node following by this guide Injective Exchange Service Setup Guidehttps://injective.notion.site/Injective-Exchange-Service-Setup-Guide-7e59980634d54991862300670583d46a, what kind of data i will be able to get from this node? Will i be able to to fetch all transactions for specified addresses?
@frosty kiln
I’m looking for a ws connection to my runned node. I want to subscribe for new transactions for specified addresses and get data from them. Also, I must have an opportunity to call getters functions on contracts and send transactions to contracts through my node. Is this possible?
I have question about wasmd.
Which version of wasmd is used in injective chain?
Where can I query this info?
You can get an idea of all the interactions available with a node by reading the API documentation page
I haven't found this in docs. Please give link to page where i can read about this
The cw20 token we are trying to burn was created on dojoswap.
We would like to do a true burn instead of sending to a dead wallet?
Has dojoswap created a way to burn tokens made on their dapp?
You will have to ask dojoswap's tech team. I am not sure if their team is actively participating in this channel
I get this error,when sending transaction from a new wallet, pubKey does not match signer address inj12zd4wvdln9ksnq3czu6kn0fj3zu4ar2lh4aymv with signer index: 0: invalid pubkey
@topaz seal
Check the docs https://docs.ts.injective.network on examples. Also, do not tag Admins. Thanks
I have read all the docs
I could debug it myself...if I know the repo the error message is from
I found where the error message is coming from but, the transaction only go when sequence number is greater than 0
I have found the solution...thanks
hi sorry for stupid question, trying to send an rpc request using cw-injective for QueryAllContractStateRequest (types/cosmwasm/wasm/v1) anyone knows how to do this? looks like it should be something simple but i cant find any docs.
i see WasmQuerier.all_contract_state exists, but not sure how to create one
Hello, hope you are doing well.
How to import NFT in Keplr wallet? Who knows?
It seems like it's possible to import cw20 token, but impossible to import NFT contract. Can you please help me guys?
This should be scam. @viscid hound
Login to injective.talis.art to view your NFT
But I need to see my nft on injective testnet. This website supports testnet as well?
Yes
What's the url of testnet version? or how to switch to testnet?
Be careful with the links you received in DMs @velvet hollow
Thanks for letting me know. Can you please let me know how to check my nft in injective testnet?
I just wanna make LP token Locker on INJ, How can I do this?
Any online doc here?
that depends on the NFT project you are using. Remember that Injective chain does not have native support for NFTs. They are implemented using smart contracts. You need to use the smart contracts to check that information
Injective team I've been looking on the docs where can i find what contract is being used here.
https://www.tokenstation.app/distribution
on the injective docs
Please get in touch with the token station project team
where can i do this ser
Try their web page, or Google. This is not an Injective dev related question, you should not be asking here
Our Validator Slashboard now tracks more slashing events than before!
We’ve added tracking of 👾 **missing_valset_confirm **and 🎃 **missing_batch_confirm **events on
Injective network.
@worthy crown @mortal kelp @lime ruin this user is sending spam. We should block him
hello, TEAM!
im an independent blockchain & frontend developer and am currently looking for a developer position on an ongoing project.
is there any chance i can work with you?
Hi, feel free to check https://injectivelabs.org/careers
thx
INJ Testnet is working? Cant send the tx
Make sure to always provide more details about what exactly you're trying such as what message you're trying to execute, what SDK you're using and the node endpoint which you're connecting to also any errors if you're getting any so that your question gets answered faster.
I just did a testnet transaction and it works fine btw.
hi @topaz seal , we want to build a new perpeptual exchange using INJ, and I have a few questions:
- we want to create new pair (like BTC/USDT), is this possible? If possible, could we use customized token or should be the token in the specified list that INJ support?
- could we create the pair that already existed on INJ (like BTC/USDT on helix), is one pair will has one marketID?
- can we use shared order on INJ (like we created new own BTC/USDT pair, and can get and match order from Helix BTC/USDT)?
- What is the strategy for liquidate and funding fee? Did INJ use oracle for liquidate? Could you send me some documents for this, thank you
Hey guys! Can I somehow fetch market info (https://api.injective.exchange/#injectivespotexchangerpc-market) directly through the node? Not through indexer api. And how can I get tokens amount in Helix pools for swap (i.e. tokens reserved amount)? @topaz seal
Hello
| + we want to create new pair (like BTC/USDT), is this possible? If possible, could we use customized token or should be the token in the specified list that INJ support?
You can launch new markets through governance, or usin the instant market launch (only available for spot markets)
| + could we create the pair that already existed on INJ (like BTC/USDT on helix), is one pair will has one marketID?
Only if the market details are different. It would not make sense to have more than one instance of the exact same market
| + can we use shared order on INJ (like we created new own BTC/USDT pair, and can get and match order from Helix BTC/USDT)?
Each market has its own order book. Order matching happens in the context of the order book.
| + What is the strategy for liquidate and funding fee? Did INJ use oracle for liquidate? Could you send me some documents for this, thank you
Please check the docs, that is all explained there
Yes, you can get markets info directly from the node. That is all explained in the API documentation.
Helix swap uses Injective orderbooks. You can get the info you need from the orderbooks directly
Has some C++ documentation for work with transactions? or C++ usseles for that
We have only implemented SDKs for Python, Go and TS. You can use C++, you just need to implement the requests using gRPC yourself
okey, ty, i read about it
I thought Injective Protocol was built using Substrate SDK?
Are you asking us whether you thought that or not?
check doc
Im asking for confirmation from dev team, whether Injective was built using Substrate SDK - a tool made by Polkadot
what do u reccomend learn after C++ for crypto? Solidity or just learn Js/Python?
Please, just visit Injective web page. That is one of the first things explained there. If you are not willing to even go and read about the chain, then you are not honestly considering Injective for your project
I have a question about tokenstation. a launch market option is like creating a liquidity for trading? is this option for this?
can anyone help me with pagination on the python api lol
I swear it isnt behaving properly
do I need to transform the nextKey before using it in the next request?
what is the issue? Could you provide an example script to reproduce the problem you are having?
sure thing
Tokenstation is not a project implemented by InjectiveLabs. You should contact their development or support teams
next_key = ""
while next_key is not None:
pagination_option = PaginationOption(key=next_key, limit=100, count_total=True)
response = await self.client.fetch_denom_owners(
denom=address, pagination=pagination_option
)
if response and "denomOwners" in response:
all_balances.extend(response["denomOwners"])
print(f"extended all balances {len(response['denomOwners'])}")
else:
print("No balances found for the provided denom.")
break
next_key = response["pagination"].get("nextKey")
if not next_key:
next_key = None
print(len(all_balances))```
`self.network = Network.mainnet()`
`self.client = AsyncClient(self.network)`
the first query returns 100 balances and a pagination object like
{'nextKey': 'FBx6l7swhudRAKHTFfrh1u49Ched', 'total': '946'}
but when I use the key for the next iteration, its returns nothing
{'pagination': {'nextKey': '', 'total': '0'}, 'denomOwners': []}
so I only end up with the first 100
let me know if you need any more info
this has been my experience with every api call that uses pagination. same for fetch_smart_contract_state
it seems to skip data
I was able to reproduce the error. We will work on a fix for it. Thank you for the details
awesome, means im not going crazy 🙂
No, you are not. It is related to some pagination keys not supporting to be decoded from bytes to string. We need to fix the pagination definition in the Python SDK
How can I get buy and sell liquidity of pair tokens from here?
https://api.injective.exchange/?python#injectivespotexchangerpc-orderbooksv2
It's exactly as the website says. It creates a market that can be traded by users in the Injective orderbook. It's different that adding liquidity, as this would have to be made manually, through some mm bot, for now.
An orderbook by definition is the representation of all the buy orders and all the sell orders for a market. By inspecting the orderbook, thus, you are actually seeing the liquidity for the market
Okay, got you. By the way, is there any any chance to get transactions' messages and logs from CosmWasmClient 'getBlock()' function? I used "injectived tx decode" for decoding txs from "NewBlock" event, but as I understood, txs from "getBlock" are raw
I am not sure about that. We always suggest using the Injective TS SDK
I just connected to injective rpc through tendermint and cosmwasm clients and I'm trying to get messages and logs of transaction of block
thank you
Any eta on this
@woeful moon
hi
Version v1.5.3 has been published
Awesome ! Back to building today
Hi community how are you doing?
Hi @topaz seal I need some assistance to develop with nextjs about injective network for now.
I created a new token using https://www.tokenstation.app/launch. And I have to get detail infos about the token. so, I already got the token name, description, icon, token price, total supply, etc. But I didn't get some info such as launch date and market state yet.
please let me know how to get the launch date or mint date of the token.
And another question:
I am going to sell the token i created. Users connect own wallet and can buy the token. At this time, user will pay me the token price. For this, should I develop the smart contract? or Injective network can provide modules for these transactions?
Hello @Flynn. Unfortunately I don't know how Tokenstation works, or how long it takes for them to create the tokens. That is a third party project. You should check their documentation or ask their support team
you can launch a spot market to do that, with your token being the base token and USDT being the quote token (USDT or any other token you choose)
then, how can i get the detail infos of the token in Injective network?
when user buy the token, how can i move the funds from user's wallet to admin wallet? Please let me know about api for this...
for this, I dont think I have to develop the smart contract. Injective network will provide the api like this, i guess.
how about you?
if so, please let me know in more detail about this api.
hello. i am a passionate blockchain engineer and now looking for an opportunity to work with you.
Hello, how are you doing?
so, can you help me for now?
If the token was created as a native token, using the TokenFactory, you can get the details using any of the token endpoints in the bank module
You will find all the details, including code examples, in the API documentation page
yeah, sure, I already got the token name, description, icon, token price, total supply, etc. But I didn't get some info such as launch date and market state yet.
I can't find the section for this in the API documentation. Could you please send me the detail link?
Hello, I'm working on my token and I managed to connect it to my website so that everything displays nicely.
I have a question about implementing transactions for custom token. Should I use a launch market on tokenstation or is there any docs where is it written down somehow how to do that?
should I use this? https://docs.injective.network/develop/guides/swap-contract/
Please check the docs page. You will find information on how to launch markets
Im struggling to launch a permissionless spot market on token station. not sure what params to use
what resolution does min_price_tick_size need to be in? 18 for INJ as quote?
min_price_tick_size for spot markets should depend on both base and quote assets decimals. For perpetual markets only the quote asset decimals has impact
Could you give a brief outline of how to decide it. The asset I am trying to pair also has 18 decimals
The mod that was helping me made FIO on testnet. He set price tick size to 0.00001 but the tx has
min_price_tick_size: 10000000.000000000000000000
And FIO has 6 decimals where INJ as 18. So it's 18-6 =12 ? Then the above value makes sense
What if both are 18
For spot markets you just need to make the calculation (for the value to send in the market creation message) of min_price_tick_size * (10^(quote_token_decimals - base_token_decimals))
Hi, I'm trying to send a transaction on Inj but get the error invalid Bech32 prefix; expected inj, got injpub
let privateKey = PrivateKey.fromHex("0x...")
let message = MsgExecuteContractCompat.fromJSON({
contractAddress,
sender: privateKey.toBech32(),
funds: [
{
amount,
denom: 'inj',
},
],
msg: {...},
})
return new MsgBroadcasterWithPk({
privateKey,
network: Network.Mainnet,
}).simulate({ msgs: message })
This is the code I'm using.
Hi, I was wondering if anyone could point me which proposal enabled the storing of this code? https://explorer.injective.network/code/788/
Do you mean the transaction that created the code on-chain?
https://explorer.injective.network/transaction/0xa58b5f619b0a1d45ba21816cff5cd538aa6a66c75ffab4c9e972e367a9465068/
Na, the proposal that allowed the storing of the code originally. Because wasm is permissioned, correct? Every contract that gets stored must pass governance?
Sorry I'm not familiar enough with inj to answer that 😅
But I thought anyone could deploy a contract on chain?
Can anyone explain to me what the uri_hash should be set to for tokenfactory denoms?
I can't find any explanation in any docs on any network 😄
Or more in general, do you guys have any examples of creating denoms and setting metadata from the cosmwasm side?
Can be blank
At this point I'm looking for the protobuf definitions of the tokenfactory msg types
because I can find no such code example of creating new denoms on the contract side. Everything is typescript client so far
Anyone happen to know where I can find the SetDenomMetadata protobuf def?
Hm
Getting this error with any tx I try execute on the exchange module on the testnet. Same error message. Can't create spot orders or create new spot markets.
Try in an incognito window
You have to enable the extension to run in a private window, though
Happens on different devices even
ah
what wallet are you using?
Keplr
hmm yea not sure....
I've gotten similar in other contexts
But it's intermittant and I also have no idea where it's originating from
I don't even own the pub key that's in the error msg
Please check the docs before asking questions in this channel https://api.injective.exchange/#clients-for-other-languages
All apologies, but to be honest, all I've been doing all day is searching through docs to figure out how injective's implementation differs from the supposed standard tokenfactory spec. I'm sorry for not seeing this minuscule link in a section of the docs I wouldn't have thought to look in, since in my mind, protobuf definitions aren't client specific.
What would be truly useful is an example of creating new denoms, specifically on injective, from the CW side, since it seems like injective, along with a whole host of other cosmos blockchains, decided to do their own thing and use non-standard Message namespaces etc., so at this point, my eyeballs are spinning in my head from trying to keep everything straight.
Thanks for the link though
There are currently no CW examples on how to do that. Maybe you can use the TS example as a guide https://api.injective.exchange/#clients-for-other-languages
still confused on this. why does token station say inj has 6 decimals
Unfortunately I can't really answer that question, we did not implement TokenStation. You will have to reach the team that implemented it.
What I know for sure is that INJ uses 18 decimals in Injective chain
I tested creating a spot market with a token with 6 decimals. price tick size 0.00001 and quantity tick size 1
here is the tx token station produced
does this not contradict
min_price_tick_size * (10^(quote_token_decimals - base_token_decimals))
if base decimals 6 and quote 18
Again, I think you will have to reach for TokenStation team. If you want to see how it is supposed to be a correct configuration, check any of the already existing markets in Injective chain (the ones created using gov proposals or instant market launches, not using TokenStation)
ok thats fine. When I do use the correct decimals, I managed to launch this market
https://testnet.helixapp.com/spot/?marketId=0x65aec98d4cfc51c18d84de1c13a80d21b6b40073ef0d99bfdb4ba2fa6cbdcd79
and in the "info" tab the parameters matched what I wanted... yay
but the mito vault I made with default settings seems to act funny. it is trying to sell the entire vault balance at a single price
That sounds weird. Could you post the details in the Support channel in Mito Discord Server?
ok ill post details there. I have a susspission its because my token denomUnits may be set wrong
so I made a fresh wallet, got some funds from faucet and was able to make a spot market once, now getting
pubKey does not match signer address inj18q7dkdajtydljze4tgemgplupxuaxks6q4ctrr with signer index: 0: invalid pubkey
again
Any chance you can provide more context? Like maybe the actual code you are running or a description of the steps you took if you are using the web tools?
I am making another user interface for launching a spot market, alternative to token station.
keplr wallet, chrome browser, ubuntu machine
it seems that on all of my wallets / accounts (made with fresh seed phrases), I cannot get a MsgInstantSpotMarketLaunch tx to go through. I always get the same error message
You are working in a new web tool. Are you sure you are using Injective TS SDK?
yes
I actually managed to get one MsgInstantSpotMarketLaunch tx through on a fresh wallet. Now when I try again it fails
In that case now please check you are pointing to the correct network (mainnet, testnet or the one you are trying to work with), and that the account you are trying to use exists on chain and has INJ deposited (enough to pay for the TX fees)
wallet and code are fine. I did manage to get it to work once this morning. you can see here
https://testnet.explorer.injective.network/account/inj1u0lamqk0qggn5cxqn53t79jsthcpen9w754ayc/transactions/
but on second try with a new token, it fails
it actually worked twice
is there a limit on spot market launches you can do from an IP address or wallet
no, no limit on market launches per IP. There are limits in the public nodes for request, yes, but not limits on how many market launches you can perform
very strange
dosnt matter what device or browser I use
pubKey does not match signer address inj18q7dkdajtydljze4tgemgplupxuaxks6q4ctrr with signer index: 0: invalid pubkey
I have no connecton to that pub key
I got Lahn the community manager to send me some testnet INJ yesterday, not sure if that has anything to do with it. I cant imagine it does
iv been sending it between wallets because the faucet has 6 hr timelimit
maybe a keplr bug
You mentioned you are creating a new web tool. Can you provide a TS script that could be used to reproduce the error? Without the code is difficult to validate you are doing everything correctly
but it has already worked
i get the exact same error trying to trade on testnet helix
ahhhh ok I found the issue
is proposer in the MsgInstantSpotMarketLaunch msg the wallet that is sending the tx?
They don't mention that field because MsgInstantSpotMarketLaunch does not have a proposer field
proposer: "",
market: {
sender: injectiveAddress,
ticker: `${props.token.metadata.symbol}/INJ`,
baseDenom: props.token.token,
quoteDenom: 'inj',
minPriceTickSize: minPriceTick.toString(),
minQuantityTickSize: minQuantityTick.toString()
}
});```
Where did you get that code from? I don't see it in the TS documentation page
its in the injective ts sdk source
import {MsgInstantSpotMarketLaunch} from "@injectivelabs/sdk-ts";
it works if I set it to sender address
You must be seeing some SDK internal MsgInstantSpotMarketLaunch class, but not the real proto message
still bizzare that I cannot trade on testnet helix
I tried installing leap wallet, same thing
bumping this
Check the sender in your script. It is supposed to be a public injective address, no t a private key transformed to bech32 representation
Hey guys -- Just a heads up that the example for the denomUnits in https://docs.ts.injective.network/core-modules/token-factory#full-example doesn't seem to work. When I construct the exact values used in the example, creating a denom with symbol "TEST" , it complains: metadata must contain a denomination unit with display denom 'TEST'
However, the example code only creates two DenomUnit entries with the denom field being equal to the full denom factory/{addr}/u*{subdenom}
I'm pretty sure that if I change to code to configure the DenomUnits the same way that it works for Osmosis (as shown in the cw-token-issuer contract), it'll work. About to try
Yep, that worked. Instead of what is shown in the example, this works instead:
denom_units: vec![
DenomUnit {
denom: full_denom.clone(), // factory/...
exponent: 0,
aliases: vec![],
},
DenomUnit {
denom: symbol.clone(),
exponent: decimals,
aliases: vec![],
},
]
Hi, thanks for the reply.
The PrivateKey.toBech32() returns inj1rn3g429a2fdtmkftc9c7tgspa00drz7mw96cd6 which looks like a public key to me.
Please don't use that private key after publishing it here, anyone has access to it now
Is that a private key?
A private key is just a key in the end. It has an hexadecimal representation that can be turned into a "inj..." format without problems. But representing it as "inj...." does not turn it into a public key.
Again, consider that address already compromissed and do not use it
Yes of course I do understand that, but it was also my understanding that private keys need to be 32 bytes in length.
While converting inj1rn3g429a2fdtmkftc9c7tgspa00drz7mw96cd6 to an eth address with getEthereumAddress() returns a 20 byte address.
Am I missing something?
The PrivateKey.toBech32() docs state:
Return the Injective address associated with this private key.
https://injectivelabs.github.io/injective-ts/classes/_injectivelabs_sdk_ts.PrivateKey.html#toBech32
Documentation for API Reference | Injective - Powering the future of decentralized finance.
You can test that yourself. Please check the 'toPublicKey` method to get the public key. Compare the result with your private key, and if the result is the same, then you were right
But won't that return the public key instead of the address?
check the methods the PublicKey class offers
privateKey.toPublicKey().toAddress().address does return the same string.
But that's besides the point I think.
Can you see the reason for the transaction failing?
According to your original message, the TX failed because the address you provided started with "injpub"
invalid Bech32 prefix; expected inj, got injpub
Yes, but I tried manually specifying the address too.
The address for the sender that is.
Did that work? Did the error message change?
No, it was the same.
Are you saying that even when hardcoding an address that starts with "inj" instead of "injpub", the TX failed saying the address starts with "injpub"?
Correct, this is what my code looks like.
If that is the case, then you are doing something really wrong in the code, I can't imagine any other reason
let privateKey = PrivateKey.fromHex("0x...")
let message = MsgExecuteContractCompat.fromJSON({
contractAddress,
sender: "inj1rn3g429a2fdtmkftc9c7tgspa00drz7mw96cd6",
funds: [
{
amount,
denom: 'inj',
},
],
msg: {...},
})
return new MsgBroadcasterWithPk({
privateKey,
network: Network.Mainnet,
}).simulate({ msgs: message })
Am I using an in compatible version or something?
I'm on v1.14.7
Why are you sending a message to the simulate function? Please check the examples in the docs on how to simulate transactions (and let me emphasize the workd "transaction" in that last sentence)
I am just following the typescript docs.
This is the signature of the simulate function: https://injectivelabs.github.io/injective-ts/classes/_injectivelabs_sdk_ts.MsgBroadcasterWithPk.html#simulate
Documentation for API Reference | Injective - Powering the future of decentralized finance.
And as per the type definition, the MsgBroadcasterTxOptions interface is defined as:
https://injectivelabs.github.io/injective-ts/interfaces/_injectivelabs_wallet_ts.MsgBroadcasterTxOptions.html
Documentation for API Reference | Injective - Powering the future of decentralized finance.
Where the only the msgs field is mandatory.
This is the transaction signing example in the docs (https://docs.ts.injective.network/transactions/private-key#signing-a-transaction) and as far as I can see when comparing the example with your code, you are not following the example
But again, that example doesn't use the MsgBroadcasterWithPk.simulate() method, right?
Ok, I see now what you mean. I did not realize first you were using the broadcaster. What happens if you run the simulation as in the example in the link I provided?
Actually I did some debugging and it looks like the issue actually lies in fetching the account.
The source for the method for @injectivelabs/sdk-ts@1.14.7 is at https://github.com/InjectiveLabs/injective-ts/blob/1d2e277eedb7d20a96fc347df94956ef63e45de0/packages/sdk-ts/src/core/modules/tx/broadcaster/MsgBroadcasterWithPk.ts#L165
Here, the account details are fetch as so:
source: https://github.com/InjectiveLabs/injective-ts/blob/1d2e277eedb7d20a96fc347df94956ef63e45de0/packages/sdk-ts/src/core/modules/tx/broadcaster/MsgBroadcasterWithPk.ts#L174-L179
/** Account Details * */
const publicKey = privateKey.toPublicKey()
const accountDetails = await new ChainGrpcAuthApi(
endpoints.grpc,
).fetchAccount(publicKey.toBech32())
const { baseAccount } = accountDetails
That is the correct way to get the account info: get the public address associated to the private key and the query the account details gRPC endpoint
But ChainGrpcAuthApi.fetchAccount() accepts an inj address, not a public key.
Documentation for API Reference | Injective - Powering the future of decentralized finance.
privateKey.toPublicKey() returns the public key
publicKey.toBetch32() returns the inj address for that public key
Ah see that's the issue.
For me:
privateKey.toBetch32() returns inj1rn3g429a2fdtmkftc9c7tgspa00drz7mw96cd6
privateKey.toPublicKey().toBech32() returns injpub1qgfax8n854sguf6tcsdu6ctpa57hm4tz3u9mt303w5kkn360rm7y2ds87uw
And that's the source of the original error message, invalid Bech32 prefix; expected inj, got injpub
Can you please confirm this too runs as expected on your end?
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'
import { ChainGrpcAuthApi, PrivateKey } from '@injectivelabs/sdk-ts'
async function main() {
const endpoints = getNetworkEndpoints(Network.Mainnet)
const privateKey = PrivateKey.fromHex("0x...")
const publicKey = privateKey.toPublicKey()
const chainGrpcAuthApi = new ChainGrpcAuthApi(endpoints.grpc)
// works
const accountDetails1 = await chainGrpcAuthApi.fetchAccount(
privateKey.toBech32()
)
console.dir(accountDetails1)
// throws `invalid Bech32 prefix; expected inj, got injpub`
const accountDetails2 = await chainGrpcAuthApi.fetchAccount(
publicKey.toBech32()
)
console.dir(accountDetails2)
}
main()
@topaz seal sorry for the ping but any updates on this?
If I can provide any more info please let me know.
I still think you are not providing the correct private key
Can you try the snippet I sent on your end?
This one.
Hey guys, is there an old snapshot for injective before january 2024? or is there any way to start an injective node from scratch?
Please move that question to #🔩・node-operators
For building on Injective, which of the sdk is recommended & Ideal: Rust or TypeScript?
gm
Is there any chance you have a working example with MsgBroadcasterWithPk.simulate() ?
There is not Rust SDK, not sure what you are talking about
The available examples are the ones included in the doc pages
Yes but none of them use MsgBroadcasterWithPk.simulate().
Is there somewhere I can submit a bug report?
Or should I directly raise a PR?
Please check the senders of the simulate message. The broadcaster uses it. If it were broken, all users would be reporting the issue already. Have you double checked that what you are passing as the hexadecimal representation of the private key is correct?
cc: @kind flare
The code never gets to that part.
Like I mentioned, the error comes from fetching the account details.
This should explain the issue, please feel free to ask if you need more clarification
I already replied to that message. If you check my reply, I have confirmed that the code you mention as an error is doing the correct thing: transforms the private key to a public key, then it to a string Injective address, and with that performs the account details request
Then did you see this snippet that shows the privateKey.publicKey().toBech32() does not work with fetchAccount()
If you run the snippet, you'll see it throws an error.
Does it not throw for you?
But my point still remains: if the string you provide to the PrivateKey.fromHex function is incorrect, everything will fail, and it is not the code fault
My good sir, I am very sure the private key is correct since privateKey.toBech32() does work as expected.
I have already tagged Bojan, he is the team TS expert. It is evident that I can't get the message accross. Let's wait for him to reply. If you want I would suggest you to create a new thread in #1189372652561895475, with all the evidence you have already provided in several different messages here. That will make it easier for him to review the problem
If you feel that I'm doing something wrong, I have sent you all the code I'm using, you can run it yourself to verify that it does NOT work correctly.
Or, if you can get a working PoC with the .simulate method then I'll be very grateful too.
publicKey.toBech32() converts the publicKey to bech32 representation => injective address
That's what bech32 means. The publicKey can either be in hex or base64 representation.
There is no error on the code.
As a developer with a team of analysts, we specialize in addressing challenges related to cryptocurrency. Our team is dedicated to providing swift and effective solutions to any issues you may encounter.
Should you require guidance or problem resolution, please feel free to reach out to us via direct message. Thank you.
any python SDK expert here?
or admin need some info asap
Can we send one bridged ERC20 token from one injective account to another injective accout through injective chain on Python SDK??
But it does not, that's what I have been trying to tell you.
const privateKey = PrivateKey.fromHex("0x...");
console.log(`privateKey.toBech32() = ${privateKey.toBech32()}`);
console.log(`privateKey.toPublicKey().toBech32() = ${privateKey.toPublicKey().toBech32()}`);
output:
privateKey.toBech32() = inj1rn3g429a2fdtmkftc9c7tgspa00drz7mw96cd6
privateKey.toPublicKey().toBech32() = injpub1qgfax8n854sguf6tcsdu6ctpa57hm4tz3u9mt303w5kkn360rm7y2ds87uw
Does this execute differently for you?
If so, please let me know and I'll double check my env.
Thank you!
But I'm a bit disappointing in the team for the reluctance to accept that something might be wrong in the sdk.
I understand it's usually user-error and sdk bugs are rare but when someone is debugging sdk code then I think you should listen a bit more carefully.
But I'm a bit disappointing in the team for the reluctance to accept that something might be wrong in the sdk.
Chill dude, we have probably 50+ requests a day people saying something is wrong with our SDK. We would need to hire 2-3 people to pay attention to these requests that in 99% of the time end up being a false alarm.
any python SDK expert here?
or admin need some info asap
Can we send one bridged ERC20 token from one injective account to another injective accout through injective chain on Python SDK??
@kind flare
or admin need some info asap
There is no need for these kind of messages, we'll reply when it's possible.
what does that means?
Use this version, it should work fine now.
fix: pubKey conversion to bec32 (bangjelkoski)
@injectivelabs/sdk-ts: 1.14.13-beta.1
@injectivelabs/wallet-ts: 1.14.13-beta.1
msg send only send injective what if I have to send another token other then inj I tried but it isay token is not registered however it is bridgedERC 20 token
You need to change the denom (the asset). Read our docs to learn more. https://docs.ts.injective.network/readme/assets
Thanks man will have a look
I understand where you're coming from, but I sent a very detailed explanation of where the bug is, including a proof of concept script that demonstrates the issue.
Anyways, v1.14.13-beta.1 does work.
Really appreciate the quick fix.
I didn't believe you that its on our side because we have unit tests on our side for these classes. And this abstraction was done like a year ago, it's really strange that nobody caught the bug so far.
No worries, all I'm asking is in the future please don't be so quick to dismiss.
Also, that reminds me, I checked our the unit tests and it doesn't actually cover the .simulate() method.
It checks with simulateTx: true but doesn't actually call the simulation method separately.
Might be worth adding a separate test for this to ensure it doesn't regress again.
Something like this in the spec
https://github.com/InjectiveLabs/injective-ts/blob/2b1fc34956239979d80f0683f740b9ae45c7f527/packages/sdk-ts/src/core/modules/tx/broadcaster/MsgBroadcasterWithPk.spec.ts#L8C
test('simulates a transaction', async () => {
const privateKey = PrivateKey.fromHex(
process.env.TEST_PRIVATE_KEY as string,
)
const network = Network.Devnet
const injectiveAddress = privateKey.toBech32()
const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})
const response = await new MsgBroadcasterWithPk({
network,
privateKey,
}).simulate({ msgs: message })
expect(response.result).toBeDefined()
}, 60000)
Collection of TypeScript packages that consume and interact with the Injective Chain - InjectiveLabs/injective-ts
Hey @topaz seal thanks for guiding me.
I have thuis code to prompt user to sign a message in wallet:
async function handleTxWithKeplr(
receiverAddress,
senderAddress,
tokenToTransact,
mesg,
chainId,
restEndpoint
) {
console.log("Handling transaction with Keplr wallet...");
try {
console.log("Receiver Address:", receiverAddress);
console.log("Sender Address:", senderAddress);
console.log("Token to Transact:", tokenToTransact);
console.log("Message:", mesg);
const getKeplr = async () => {
await window.keplr.enable(chainId);
const offlineSigner = window.keplr.getOfflineSigner(chainId);
const accounts = await offlineSigner.getAccounts();
const key = await window.keplr.getKey(chainId);
return { offlineSigner, accounts, key };
};
const broadcastTx = async (txRaw) => {
const txRestClient = new TxRestClient(restEndpoint);
const txHash = await txRestClient.broadcastTx(txRaw);
if (!txHash) {
throw new Error("Transaction failed to be broadcasted");
}
return txHash;
};
const handleTransactionKeplrwithINJ = async () => {
const { offlineSigner, accounts, key } = await getKeplr();
const userAddress = accounts[0].address;
if (!key.pubKey) {
throw new Error("Public key not found for the connected account.");
}
const chainRestAuthApi = new ChainRestAuthApi(restEndpoint);
const accountDetailsResponse = await chainRestAuthApi.fetchAccount(
userAddress
);
const baseAccount = BaseAccount.fromRestApi(accountDetailsResponse);
const accountDetails = baseAccount.toAccountDetails();
const chainRestTendermintApi = new ChainRestTendermintApi(restEndpoint);
const latestBlock = await chainRestTendermintApi.fetchLatestBlock();
const latestHeight = latestBlock.header.height;
const timeoutHeight = new BigNumberInBase(latestHeight).plus(
DEFAULT_BLOCK_TIMEOUT_HEIGHT
);
const amountToSend = {
amount: new BigNumberInBase(0.01).toWei().toFixed(),
denom: "inj",
};
const msg = mesg;
const pubKey = Buffer.from(key.pubKey).toString("base64");
const { txRaw, signDoc } = createTransaction({
pubKey,
chainId,
fee: DEFAULT_STD_FEE,
message: [msg],
sequence: accountDetails.sequence,
timeoutHeight: timeoutHeight.toNumber(),
accountNumber: accountDetails.accountNumber,
});
const directSignResponse = await offlineSigner.signDirect(
userAddress,
signDoc
);
const signedTxRaw =
getTxRawFromTxRawOrDirectSignResponse(directSignResponse);
const txHash = await broadcastTx(signedTxRaw);
console.log(`Transaction Hash: ${txHash}`);
return true; // Indicating success
}; // Call the transaction handling function for Keplr
await handleTransactionKeplrwithINJ();
} catch (error) {
console.error("Error handling transaction with Keplr:", error);
throw error;
}
}
@topaz seal I just need one help, how can we add memo in this so that it will automatically filled in user tx memo to be signed
in short along with msg, i wanna pass memo string too, so user if sign tx, memo also gets written on chain'
@kind flare
createTransaction accepts memo
like we ned to add simply this line in tx raw?
const pubKey = Buffer.from(key.pubKey).toString("base64"); const { txRaw, signDoc } = createTransaction({ pubKey, chainId, fee: DEFAULT_STD_FEE, memo: "I am first memo bro", message: [msg], sequence: accountDetails.sequence, timeoutHeight: timeoutHeight.toNumber(), accountNumber: accountDetails.accountNumber, });
memo: "I am first memo bro",
lemme try, if it works, i am very very tyhankfull for this guidence
Thanks Bojan and Abel, for help
is there a limit of how long max memo can be?
I think the only limits that will apply are the max block size and the max block gas
hm, mean we can insert whole database here if users are paying for it, something like we can store user info (public info) on chain if user update profile or we can store essays etc too.
its essentially cheapest database out therre
Max block size does not depend on how much anyone is willing to pay. So no, your affirmation is incorrect
i am not getting it, i mean can u little ex0plain to me, like how much data can be stored in single tx max? from max i mean real top max
I am not sure how else to explain this but just mentioning that blocks can have up to a max bytes size, and can't expend more than a certain gas amount in total. The values are configured using governance and can be checked in the consensus params https://sentry.lcd.injective.network/cosmos/consensus/v1/params
tried a 4 para long memo, rejected, means we can add somewhere max of 2 paras average in memo
Thisisanexampleofalongstringoftextwithnointervalsorbreaksfulfillingtherequirementofbeingtwohundredcharacterslongitcontinueswithoutanyspacesmakingitdifficulttoreadbutmeetingthespecifiedcriteriaforlengthandformat123456789012345678901234567890
this is longest memo i was able to pass, its 230 characters long,. longer memo is signed by user wallet, but not dded in block and become failed tx.
so longest memo we can add is 230 chars, no matter how much fee we will to pay!
now not so good databse! hahahha, but still usable for small data storages
@topaz seal if we need to get out a tx info from chain, but we wanna filter, like from this sender to this receiver in this time range.
then what are options:
fetch all tx in time range then locally apply filter?
Or on chain we have ability tio filter tx?
cuase if we need to fetch all tx for an address then filter tx with other address, we might have to fetch 3k+ tx, how will we do that?
PS: its not a q on how to fetch tx or see in data received etc, i wanna know if filters exist in way that we can apply before fetching tx
All the available filters are described in the API documentation page. For any more complex filtering you should create your own indexer, or use the Tendermint websocket, that provides some extra filters. But for Tendermint websocket you need to refer to the official Tendermint documentation (that is a functionality provided by Cosmos SDK, not something specific to Injective chain)
Can I get tender mint websocket link please, thanks for help
What do you mean with tendermint link? Do you mean in the node?
For public nodes you can find examples on how to connect to the tendermint websocket in the API documentation. For private nodes, that will depend on the node configuration. For node specific questions please use the #🔩・node-operators channel
I have one question can we send token from one wallet to another through python I mean using peggy I think we can only send inj in python sdk msgsnd @kind flare
I have read the doc but it is letting me only to send INJ tokens, whenever I try other token with peggy details it gives keyerror
Yes, with MsgSend (https://api.injective.exchange/#bank-msgsend) you can transfer any token. In the Python SDK, if you build the instance of MsgSend using the composer, you will only be able to send tokens known by the composer. If you want to send any other token not known by the composer, you have to create the MsgSend instance manually (without the composer assistance).
Also, when creating the MsgSend using the composer, the parameter "denom" is the token symbol, not the token denom on chain
Hey guys - does anyone have a list or reference to the contract addresses and their code for Helix and Mito?
Hi, is it possible to execute two messages (for example two transfers) in the same transaction without writing a contract?
The idea is to have them be atomic, either both succeed or both fail.
Yes, that is the standard behavior: a TX is created with N messages
hey folks
Just wondering, is there any way to get token price ?
using @injectivelabs/sdk-ts package, but couldnt find any solution for that
If there is a market in Injective for the pair you want the price for, then you can just get the best bid/ask price from the orderbook, or the last traded price.
If not should get the price from an Oracle
hm, can I get with Mito somehow ?
Not sure if Mito contracts have any public function to return the price. You should ask in the Mito Discord server
hm , and for using Oracle, I checked the docs, there is a way to get all markets etc. , but I am trying to get for factory/inj1etz0laas6h7vemg3qtd67jpr6lh8v7xz7gfzqw/hdro, it's undefined, so can't get price
When using the oracle price endpoint from the Indexer, you need to specify the Oracle symbol for the token (it depends on the Oracle being queried). That symbol is, in general, different from the token denom in Injective chain
Got it, thanks!
Another question ,
https://k8s.mainnet.asset.injective.network/asset-price/v1/denoms?withPrice=true
Is there an API in @injectivelabs/sdk-ts to query this >?
I am not sure what that endpoint is. It is not on the list of official endpoints https://docs.injective.network/develop/public-endpoints
I took it from the injective explorer website
Let me check with the team. I have the feeling that the endpoint was not implemented with the idea of making it public. So initially I don't think we will add support for it in any of the SDKs. But I will confirm once I have more details
ok, so the question still remains for me
with oracle I cant get price for this address
factory/inj1etz0laas6h7vemg3qtd67jpr6lh8v7xz7gfzqw/hdro
confused
also, from official endpoints couldn't find any endpoint to get price
Well, you should be able to use any Oracle that lists already that token. You will have to do your own research here.
Have you checked all the doc pages? Did you see this endpoint by any chance https://api.injective.exchange/#chain-exchange-for-spot-spotmidpriceandtob?
I can confirm that the mentioned endpoint is not supposed to be used by the general public. In general please consider that anything you get by reverse engineering Helix or Explorer pages, that is not included in the docs, is not for public use
I want to be able to get the price of a cw20 token on-chain. I came up with the attached code, but not sure if it’s the right way? Anyone please?
Why would you asume that the Band oracle has the CW20 token you are insterested in listed?
also in general Band oracle does not use token's denom as their symbol/name
Honestly this is my first time dealing with such. I'm just looking for a solution where I can get the price of a cw20 token.
If you want to take the price from an oracle, then make sure you query with the correct token symbol. If you want to take the price from an Injective market, make sure the pair you are interested in does have a market in Injective, and then use the mid price endpoint to get the price from a node
I know this might be too much to ask, but any docs or code sample I can look. I came up with the above code sample by poking around injective-cosmwasm sdk.
Please
✋ maybe this is something that is answered many times but i am developing on latests macos M2 Pro. After cosmwasm/rust-optimizer:0.12.12 i deployed my wasm contract to testnet sucessfully but when checking the contract i get an error:
Error: error unmarshalling result: illegal base64 data at input byte 4```
all tests check out and i cant find any issues in my code using IntelliJ IDEA
Personally i think it has something to do with ARM64, should i optimise using cosmwasm/rust-optimizer-arm64:0.12.12 ?
hmm tried to verify another contract created by somebody else and ik get the same error:
injectived query tx 1E9104DB742E87A8C6B77072E04616446850CA0EFC8214ADFF22BC3B77FB14B2 --node=https://k8s.testnet.tm.injective.network:443
Looks to me like a bug, anyways im going to try to execute my contract
my contract works perfectly but i cant explain the Error: error unmarshalling result: illegal base64 data at input byte 4 i get in my docker container:
-v=<directory_to_which_you_cloned_cw-template>/artifacts:/var/artifacts \
--entrypoint=sh public.ecr.aws/l9h3g6c6/injective-core:staging \
-c "tail -F anything"```
Hello. I have an issue while instanting cw721 contract. Can someone check?https://testnet.explorer.injective.network/transaction/7BE0624279522B8B4C505C881497D2E4E76E22244C4481D9868390010C4BDDAF/
I couldn't find any tutorial for cw721. I think need to develop.
@paper lance try compiling with this script
#!/bin/bash
ARCH=""
if [[ $(arch) = "arm64" ]]; then
ARCH=-arm64
fi
for contract_dir in contracts/*; do
docker run --rm -v "$(pwd)":/code -v "$HOME/.cargo/git":/usr/local/cargo/git \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer${ARCH}:0.15.0 "$contract_dir"
done
how do you compile the contract? seems to be related to newer Rust versions: https://github.com/rustwasm/wasm-pack/issues/1389#issuecomment-2162846183 would try to use an older version of optimizer e.g. see ☝️ script
okey. i will try
Can you provide me an example of init msg please?
INIT='{"name":"InjectiveTestCoin","symbol":"ITC"}'
yes 12345678 | injectived tx wasm instantiate 9924 $INIT --label="Injective Test" --from=$(echo inj1kjuckfjkrv2f5fqvmd79ln8kn7chuqrqd8x8v4) --chain-id="injective-888" --yes --gas-prices=160000000inj --gas=20000000 --no-admin --node=https://testnet.sentry.tm.injective.network:443
Like these. or is it written true
maybe verions is a little too old: rust-optimizer:0.12.12 i copied it from docs. ill try your script now
tried it with 0.15.0 compiler and rustc 1.79.0 (129f3b996 2024-06-10) but command still gives error:
injectived query tx 61E07C7CB7BE5CC6C2DDE71D1743B7B70DFB596839E6ED9F036B961EC6D33B13 --node=https://k8s.testnet.tm.injective.network:443
Contracts works flowless when sending commands to them tho so no block problem.
Also i use this to execute the injectived command:
-v=<directory_to_which_you_cloned_cw-template>/artifacts:/var/artifacts \
--entrypoint=sh public.ecr.aws/l9h3g6c6/injective-core:staging \
-c "tail -F anything" ```
maybe that version is too old?
It passed test but when ım compiled with RUSTFLAGS='-C link-arg=-s' cargo wasm cp ../../target/wasm32-unknown-unknown/release/cw721_base.wasm . ls -l cw721_base.wasm sha256sum cw721_base.wasm with these commands it gave hundred errors. There is no error with this code: docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ cosmwasm/optimizer:0.16.0 and here is the same issue: https://testnet.explorer.injective.network/transaction/497CB160E913C785C02F1B7710809D92BB686A271BEAF2B7E1675DEAE4CE4443/
It is solved. Turns out the dev docs point to a injectived docker image that does not work properly. i did build it from source on my macos and it works now.
injectived version
Version v1.12.1 (e1ab66c)
Compiled at 20240622-1403 using Go go1.22.4 (arm64)
is there a repository where i can commit changes to this page? https://docs.injective.network/develop/guides/injective-101/your-first-contract
To onboard new devs it needs some minor changes.
where can i find docs on CW404?
@frosty kiln The address on Keplr has changed even though I am still using the same access keys.
please move this question to #🆘︲help-and-support-old channel. It has nothing to do with "dev-chat"
Hi @topaz seal
Sorry for interrupt you. I wanna work in your team as a web full stack and blockchain developer.
Hi, you can check the careers page of Injective Labs: https://injectivelabs.org/careers
GM, hope you all are well. I have a question. i am making an contract but i get an execution error on testnet:
failed to execute message; message index: 0: Error parsing into type simple_token_agreement::msg::ExecuteMsg: Invalid type: execute wasm contract failed
i think i have upgraded my dependencies a little to high:
[dependencies]
cosmwasm-std = "2.0.4"
cosmwasm-storage = "1.5.2"
cw-storage-plus = "2.0.0"
cw2 = "2.0.0"
schemars = "0.8.21"
serde = { version = "1.0.203", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.61" }
log = "0.4.21"
Also using cosmwasm/rust-optimizer-arm64:0.15.0
All my tests are green so i know code is how it should be.
cosmwasm-std = "2.0.4" supported already?
Nvm it works now 🔥 not sure what i changed but i think it has to do with serde snake_case not being used in executeMsg
allright tracked down where the ExecuteMsg: Invalid type exception comes from:
if you declase id: u64, but in your json you send a "1" instead of 1 you get that error.
Looks like i need some integration tests 😅
I am a lead web3 frontend and blockchain engineer, i am looking for an opportunity to work with you.
I have one thing to need your help.
"Injective smart contract should be depolyed on Ubuntu. not windows."
this is right?
@winged maple I am currently developing a contract that includes a roadmap with numerous features. Since implementing all these features at once is impractical, should I divide the project into smaller, separate contracts, or should I create a single contract and release new versions as I add more features?
Is it possible to mint NFT using the cw721-base contract or should I write a new contract myself?
Is there a tutorial for this?
my code for calculating the current market buy / sell price for a spot market is getting slightly different results from helix UI. this is what im doing:
- query all spot orders
- for a given base token amount, iterate through the orders and calculate the average price based on order quantity and price. for a market buy price this involves searching through the sell orders only until the quantity is satisfied.
- the price for each order is adjusted to add the taker fee rate
am I missing anything ?
I think its actually working ok
does anyone know why there are multiple markets with the same pair?
in /injective/exchange/v1beta1/spot/full_markets,
WMATIC/USDT appears twice, although seemingly with some differences in the details. The prices reported by both are different too.
Replied to you in #💻︲api-support
Can someone answer please?
did you try the script I shared?
In the link you shared, it was written that I should downgrade the rust version, I tried it, but I got many more errors.
the ticker, or trading pair, is not the identifier of markets. The only identifier is the market id. So if someone launches a market with incorrect ticker, it is possible to have repeated tickers (let's keep in mind that Injective is a decentralized chain, and there are permissionless actions)
hi guys, having some issues deploying a node
followed the documentation, although I am using a custom folder, but shouldn't be the issue
getting
panic: validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction ({824663675520})
and then exit
Any clues on what might be happening?
I am running:
injectived init "Node1" --chain-id ${NETWORK} --home=${APP_HOME} --default-denom=${DENOM}
wget https://github.com/InjectiveLabs/mainnet-config/blob/master/10001/app.toml -P ${APP_HOME}/config
wget https://github.com/InjectiveLabs/mainnet-config/blob/master/10001/genesis.json -P ${APP_HOME}/config
exec injectived \
--home=${APP_HOME} \
start \
--moniker=${MONIKER} \
--rpc.laddr=tcp://0.0.0.0:26657 \
--p2p.seeds="38c18461209694e1f667ff2c8636ba827cc01c86@176.9.143.252:11751,4f9025feca44211eddc26cd983372114947b2e85@176.9.140.49:11751,c98bb1b889ddb58b46e4ad3726c1382d37cd5609@65.109.51.80:11751,23d0eea9bb42316ff5ea2f8b4cd8475ef3f35209@65.109.36.70:11751,f9ae40fb4a37b63bea573cc0509b4a63baa1a37a@15.235.114.80:11751,7f3473ddab10322b63789acb4ac58647929111ba@15.235.13.116:11751,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:14356,ebc272824924ea1a27ea3183dd0b9ba713494f83@injective-mainnet-seed.autostake.com:26726,1846e76e14913124a07e231586d487a0636c0296@tenderseed.ccvalidators.com:26007"
Hi devs. I'm trying to figure out the best way to derive injective addresses from stars addresses. I previously have used the python Bech32 library for stars => osmo addresses, but that is giving me incorrect results compared to the control group of addresses when i go from stars=>inj. Any help or pointing me in the right direction would be appreciated.
Please move this question to #🔩・node-operators
Maybe in the Discord server of chain that actually uses Solidity to code their contracts. That would be a good starting point.
@mortal kelp @lime ruin sorry for the interruption. Seems like we are having spammers again in this channel. Could you please ban them?
Sure
GMGM
This is Baby from PancakSwap. The top 3 largest DEX in DeFi.
We are keen to connect with Injective team to explore collaboration possibilities (farming $INJ on BNB chain) and invite the Injective onboard PancakeSwap to tap into our world-class $2B liquidity and > 150k DAU.
Let us know your thoughts. 😉
Ser, For collaboration check: #📥︲collaborations
yea also submitted collab form
thanks for pointing that out
Hi, please send me a DM.
DMed
I'm currently investigating how trading fees work on Helix and saw that market has maker and taker fees. For instance, INJ/USDT has -0.01% maker and 0.1% taker fees, but on Helix itself 0.2% fee is shown. How could it work even though 0.01% + 0.1% is 0.11% but not 0.2%
You should ask that question in #🧬︲helix-chat
@lime ruin we have spammers again in the channel. Could you please ban them?
i’m currently trying to create a etf-like index token on injective using cosmwasm. I tried to get eth/usd price feed using pyth but i guess i need to update it every block with fee and it’ll be costy maybe at future. Does anyone know any idea to get price feed of a pair on cosmwasm ?
was the peggo v1.12.2 docker image at aws ecr removed? it still has v1.12.0 but running the release notes test command I get:
l9h3g6c6/peggo:v1.12.2 not found: manifest unknown: Requested image not found.
Has anyone else had the problem with adding CA to Base denom, it saying already registered if you check but your token not showing up in this list even after 30 minutes ?
It's saying contract already setup, is this just a case of token factory not updating?
Hey @topaz seal
I'm encountering an error while trying to create a binary options market using the Injective SDK. The error message I'm getting is:
TypeError: message.toBinary is not a function
at /Users/dennis/betting/node_modules/@injectivelabs/sdk-ts/src/core/modules/tx/utils/tx.ts:63:22
at Array.map (<anonymous>)
at createBody (/Users/dennis/betting/node_modules/@injectivelabs/sdk-ts/src/core/modules/tx/utils/tx.ts:61:30)
at createTransactionWithSigners (/Users/dennis/betting/node_modules/@injectivelabs/sdk-ts/src/core/modules/tx/tx.ts:61:26)
at createTransaction (/Users/dennis/betting/node_modules/@injectivelabs/sdk-ts/src/core/modules/tx/tx.ts:136:38)
at /Users/dennis/betting/createMarket.ts:93:49
at Generator.next (<anonymous>)
at fulfilled (/Users/dennis/betting/createMarket.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
This is the relevant code snippet:
`// Message instantiation
const msg = MsgInstantBinaryOptionsMarketLaunch.fromJSON(msgParams);
console.log("Market message created:", msg);
.
.
.
try {
const msgProto = msg.toProto(); // Error occurs here
console.log("Message proto created:", msgProto);
const { signBytes, txRaw } = createTransaction({
message: [msgProto] as unknown as Msgs[],
fee,
pubKey: publicKey,
sequence: parseInt(baseAccount.sequence, 10),
accountNumber: parseInt(baseAccount.account_number, 10),
chainId: chainId,
});`
it seems like MsgInstantBinaryOptionsMarketLaunch
does not have toBinary serialization support
@willow notch
someone manage getting wallet-ts running with next.js? I get this problem when instantiating WalletStrategy:
TypeError: externals_1.BN is not a constructor
And if it is not an absolute must - I dont wanna switch to vite 😎 . Otherwise I need to do a complete frontend refactoring
Which version are you using?
we have toBinary() added for the message
https://github.com/InjectiveLabs/injective-ts/blob/dfcb81a8c4968423372c018e843364827062dbbc/packages/sdk-ts/src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts#L138-L142
try using these version:
@injectivelabs/exceptions: 1.14.14-beta.0
@injectivelabs/networks: 1.14.14-beta.0
@injectivelabs/test-utils: 1.14.14-beta.0
@injectivelabs/ts-types: 1.14.14-beta.0
@injectivelabs/utils: 1.14.14-beta.0
@injectivelabs/sdk-ts: 1.14.14-beta.1
@injectivelabs/wallet-ts: 1.14.14-beta.2
Hello I need to get peggy token holder info in explorer it shows very limited info is there any api that can get me that info please @topaz seal @brave quail
This should help to get token holder info of a particular Token
Hi !
Just started reading documentation for market making on helix.
To opt out to the T&E program, we have to run this code with our private key, thats it ?
Here: https://github.com/InjectiveLabs/sdk-python/blob/master/examples/chain_client/exchange/21_MsgRewardsOptOut.py
that is a question for #🧬︲helix-chat or #🧮|trading-dev
But ok ! Will go in helix chat 😅
I am sorry you have to go around like that. But let's be honest: it is a question about the process to start receiving trading incentives. What does that have to do with developers at all?
Ask it to lahn 😅 I am not in the Injective team, I just follow your instruction 😂
I will discuss it with @lime ruin. Again, sorry for that. To avoid you more jumps between chats, maybe this is what you need to read https://docs.trading.injective.network/rewards/open-liquidity-program-olp/eligibility
Hmm, thought the question might better fit here since Maitre was using Python SDK for it, mb if it's not the right place though.
@misty maple yes, that is the screep you need to run. Make sure you run it in your own environment, since you need to put there your private key
Yes
ANYONE who sends you DMs is very likely a scammer, please block them.
Thats what I thought yeah
Thx, we can sup my chat here if its not appropriate in this channel now, have a great day
We can leave it here now, just for future reference
pagination on the fetchBinaryOptionsMarkets typescript might be broken. it returns next: [] when querying all demolished markets on testnet. I cant figure out how to get next page
there is 17052 total
also, could anyone explain how the "Frontrunner" oracle type works ?. edit - ok from breif research Frontrunner is a third party oracle
made an interface for listing historic markets
https://trippyinj.xyz/binary-option-markets
can change between mainnet and testnet top right
gm, found this is in the docs The market may be optionally configured with a market admin which has the ability to trigger settlement, change the market status as well as modify the expiration and settlement timestamp of the given market
How do I exercise my ability as the market admin to change attributes and reach settlement? I cannot find any such messages in the docs
Derivative markets do not have an admint in the current mainnet version https://testnet.lcd.injective.network/swagger/#/Query/DerivativeMarkets
ok. im talking about binary option markets, which is a type of derivative market I guess. Is there a way for a binary option market admin to trigger settlement on testnet ?
you can check all binary options messages in https://api.injective.exchange/#chain-exchange-for-binary-options
thank you thats exactly what im looking for
did you have a chance to look if pagination on fetchBinaryOptionsMarkets in the TS API needs fixing ?
@willow notch
it returns next: [] when querying all demolished markets on testnet. I cant figure out how to get next page. there is 17052 total let me know if you need code snipit
is chainGrpcGovApi.fetchProposalVotes supposed to work ? returns no votes for all proposals
is this the best place to report bugs?
Hi guys. I am using this exmaple: https://docs.ts.injective.network/transactions/transactions-cosmos and trying to store code on chain but My transaction fails. https://testnet.explorer.injective.network/transaction/41903B838B037A55E4179F777FEA1C79260DC7B024F814C550E785F3EBC33BE9/
I changed the MsgSend.fromJSON to MsgStoreCode.fromJSON
I built my contract by using this example https://docs.injective.network/develop/guides/injective-101/your-first-contract#building-the-contract
There are 2 different sources fetching binaryOptionsMarket, the one on TS supports fetching it from the indexer where the pagination options param looks like this:
fetchBinaryOptionsMarkets({
marketStatus?: string,
quoteDenom?: string,
{
key?: string
offset?: number
skip?: number
limit?: number
reverse?: boolean
countTotal?: boolean
endTime?: number
startTime?: number
fromNumber?: number
toNumber?: number
}
})
transaction not found :/
OK. It returns the first 100 and no next key ?
try passing this:
fetchBinaryOptionsMarkets({
marketStatus?: string,
quoteDenom?: string,
{
limit: 20
}
})
Pretty sure I tried using limit skip and still wasn't working. Back to my PC in 30 mins
What about this
can you share the proposal id that you were querying for?
Was trying 412
But I noticed the votes are not loading on the hub either
votes are removed once the proposal passes voting period
ok makes sense.
still stuck on this binary option markets pagination
i am trying both mainnet and testnet
from the sceenshot its testnet?
Does this mean that they're not retrievable?
screenshot was demolished markets on mainnet
tesnet not responding
Because I did tried to do so, at first I received some data, but before I was able to even make use of it, I received an error that the node is pruned and all.
First trial was after it was passed as well.
@willow notch
you will have to set the block height to retrieve the votes, it is a cosmos design to prune the votes once the proposal passes the voting period
I did actually, but I'm not with my laptop rn but in the next hr.
I did some deep diving, this is an issue with the indexer not returning the next pagination key, will report this.
PS: also made an update to the sdk-ts,
@injectivelabs/sdk-ts: 1.14.14-beta.2
@injectivelabs/wallet-ts: 1.14.14-beta.3
The pagination format should now align with what the indexer returns
thank you. in the future, is this channel the best place to report potential bugs ?
The best place to report bugs is always the SDKs repositories in GitHub
Comments here are always welcomed, since they help us know there is a new bug to investigate. But the details should be in the GitHub issue report (it is difficult to find details here as the chat progresses)
Hey 👋 @willow notch,
I was able to get through this part and started fetching 100 values at a time. I later found out that the issue was caused by pagination. I handled it, and it started fetching data 100 by 100. However, during the fourth call, I received this error:
2024/07/08 15:48:26 Raw response body: {"code":3,"message":"illegal base64 data at input byte 22","details":[]}
2024/07/08 15:48:26 Fetched 0 votes, nextKey:
Spreadsheet saved as votes.xlsx
The number of voters is expected to be more than 300.
Hi guys !
How can I fund my injective testnet wallet ?
!faucets
Receive a small amount of INJ to get started with using the network and enough to execute few transactions.
getting some funny behavior when querying old block heights on
https://sentry.lcd.injective.network/cosmos/gov/v1/proposals/412/votes
im using block 76860000 in the headers 'x-cosmos-block-height': 76860000
for some reason the first few requests result in an error
failed to load state at height 76860000; version mismatch on immutable IAVL tree; version does not exist. Version has either been pruned, or is for a future block height (latest height: 77226477): invalid request
but then I just try a few more times and then it works?
but then it makes it hard to get all pages because half of the requests fail.
I was able to get a full list by implementing retry logic but sometimes a request would fail 10+ times before resolving
pretty sure this is because the key on page 3 contains a "+" char that needs to be url encoded
hmm weird I can see the transaction. Could you check the transaction again?
error log is "failed to execute message; message index: 0: Error calling the VM: Error during static Wasm validation: Wasm bytecode could not be deserialized. Deserialization error: "magic header not detected: bad magic number (at offset 0x0)": create wasm contract failed" btw
Thabks king!
Hey guys, how can I fetch contract state? Not from exposed queries.
Check the messages in the API docs, in the wasm section
Is there a problem on the API right now ?
does MsgBroadCaster in injective/sdk-ts has transaction simulate method? I know that it has simulateTx boolean which simulates before broadcasting transaction but I only want to use simulate function. And I don't want to use MsgBroadcasterWithPK
I just found out that there is TxGrpcApi which can simulate tx
Hello team, I have a question about this error "Orderbook liquidity cannot satisfy current worst price". It occurs when I send a CreateDerivativeMarketOrder message to Injective testnet (Injective-888) via an execute function of my CW contract.
I use mark price (let mark_price = querier.query_derivative_market(&market_id)?.market.unwrap().mark_price;) to fill the price field of OrderInfo in DerivativeOrder.
Where did that error come from? If it's not because I coded wrongly, maybe it's because there is no trading liquidity on the injective testnet for that perpetual market? Additionally, the market I tested is INJ-USDT PERP.
Thank you so much for clarifying my question. ❤️
Why the mark price? The chances your order will not find any counterparty order to match with using that price are huge
I have tried using from mark price, mid price, tob,... to the manually entered price, but both get the above error.
Could you explain to me about this error? What is "worst price"? Thank you very much
Worst price is the price you configure in the OrderInfo. It is the worst price you accept the exchange to use to find a match counterparty order
@topaz seal So could you teach me how to properly pass the price field in OrderInfo to ensure my orders are matched?
I'm stuck here, thank u again
What do you mean with "how to pass the price"? Just input the price value in the price field, that is it
Just put the worst price you are willing to pay/receive (depending the order direction)
I have tried doing that, I have tried pass many values around 10% above and below of the mark price but they all get the same error.
Take the best bid/best ask price (depending the order direction) and add/subtract (depending on the order direction) 30%
But the worst prices should be configured by you. I am not sure what would be a good price for you
Is kind of asking me were should you invest your money: I can't answer that for you
Thank u sir, I'm testing on INJ-USDT PERP (Injective testnet)
I am not seeing a live INJ/USDT PERP market in testnet
At least not in the Helixapp in testnet
I use injective deamon to get info about this market
This is my command: injectived q exchange derivative-market 0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6 --chain-id injective-888 --node $INJ_TESTNET_RPC
0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6 is the market id of INJ/USDT PERP
The env $INJ_TESTNET_RPC is https://testnet.sentry.tm.injective.network:443
Ignore my previous comment: I see the status for the market is "Active"
Hey @topaz seal !
I fetched all markets of Injective with all orders to represent Helix swaps. However, Helix has quite a bit markets and pairs, but there are a lot more orders and markets. Does Helix has a list of active markets to swap on?
Yes, Helix is a DEX and the project decides which markets is supports. If you check the Helix swap page you can see all available markets for swaps
Hi guys I am using this exmaple: https://docs.ts.injective.network/transactions/transactions-cosmos and trying to store code on chain but My transaction fails. https://testnet.explorer.injective.network/transaction/41903B838B037A55E4179F777FEA1C79260DC7B024F814C550E785F3EBC33BE9/
I changed the MsgSend.fromJSON to MsgStoreCode.fromJSON
I built my contract by using this example https://docs.injective.network/develop/guides/injective-101/your-first-contract#building-the-contract
Gm, if you're unable to access the #🚀・dev-support and other developer related channels then please connect your GitHub to your Discord account and take the Developer role from the available linked roles.
How do I connect my GitHub to Discord?
- Go to Discord settings →
Connectionstab.- Click the View more icon (
>) and select GitHub.- Review the connection and allow to successfully connect your GitHub to your Discord.
How do I get the Developer role from the linked roles?
If you've done the previous and connected your GitHub then:
- Click on the server name on top left to open the server drop down menu.
- Click on
Linked rolesand selectDeveloper.- Then follow the procedure it prompt you to do and you'll get the role in just few clicks.
- Alternatively, you can also get it by clicking the
Developertag beside my name.
→ Click here for a more detailed guide.
I have a question about Binary option markets and oracle providers.
I see that it is mandatory to have an oracle when creating a BOM (binary optons market)
what if you simply want to create a market where the admin decides the settlement price and an oracle is not needed ?
Alternatively, is there a placeholder oracle we can use? Or is the correct / only approach to build an oracle that can post price updates for the market to reach settlement ?
The exchange module will always need a prive not coming from the binary option market itself to calculate the settlement related actions. And since it is a price not coming from the market itself, it is then required an oracle to provide it. That is the only option
Injective team, I see the Injective-888 testnet is down, are you doing chain halt to upgrade the chain? Thanks for answering
is there any way to find the closest block height to a given timestamp, apart from querying individual blocks to check their timestamp
Hey guys! What do "limit_cumulative_quantity" and "limit_cumulative_notional" mean in "query_spot_market_orderbook" in InjectiveQuerier package? I'm trying to represent swap contract logic and I'm stuck on estimating buy execution. I don't understand how to filter all orders in the same way swap contract does because I rewrote all logic and mathematics and my average price is too high.
You can find fields descriptions in the API documentation page
@topaz seal
I have a question about hummingbot connector that you have built,
We would like to use RockX node to connect and when we choose custom_network on hummingbot LCI client, it's asking for :
Enter the network lcd_endpoint
Enter the network tm_websocket_endpoint
Enter the network grpc_endpoint
Enter the network grpc_exchange_endpoint
Enter the network grpc_explorer_endpoint
Enter the network chain_stream_endpoint
Enter the network chain_id
Enter the network environment name
RockX is only giving us API key, Rest API, and GRPC Api, is it enough to complete those questions ? Here is some documentation about custom_network connection ?
Thank you !
hello @misty maple. I don't know RockX at all, but from what you mention, they are providing an API wrapping the Injective nodes they might be running. But the connector I created is designed to be used directly with an Injective node. If you want to use RockX thorugh their API, you will need a connector designed for that.
One other alternative (I am not sure if it is possible) would be to ask RockX to provide access to the node they are running for you (supossing they run a separate node for each user requesting an API key, which I doubt)
I have added some details about the custom network connection in the Injective connector documentation in Hummingbot docs page. You can find more details about each of the endpoints required in the Injective nodes documentation
Thank for your answer, I will read the updated doc !
Re,
I checked the doc on the website but doesn't saw the change you made
I don't see the custom details in the docs, may be the page was modified. In any case the parameters are not difficult to understand. You can ask questions here if you have doubts
I have a question, does the Injective core team plan to develop a native lending module (like umee chain) to support lending/CDP projects in the future? Thank you team for sharing
Hello I have a question about eth based wallet signing it is metioned that on injectifve you can process signing transaction using ethereum wallet. And the process says that 'packing the transaction into a native cosmos transactoin' does it mean user must have two wallets? like you need metamask and keplr at the same time or just the metamask
You don't need two wallets. Have you tried using Helix in testnet with Metamask?
What is the difference between all grpc endpoint ?
They are all for different types of requests
One is for the node gRPC messages, one for the Indexer gRPC messages, one for the chain stream in the node, one for REST queries to the node, etc
Hey is there any working faucet? Trying to get some native tokens on testnet for testing. Or would appreciate it if someone could send some inj1cjv6vz3jhltgysalnfvc4p07kw0nx98mh6gsd2 🙏
Thanks! I requested from there last week, but haven't received any
I created a token on tokenstation.app. How can I transfer it to another IBC chain, such as Terra?
or Osmosis
Hey all,
I am struggling with something very simple and hopefuly you'll be able to assist here:
Creating a simple Injective transaction from 1 account to another.
I use the injective ts-sdk to the transaction. My signer is a remote signer that I execute the request to via API.
The signature response I get is:
r: hex string
s: hex string
v: number (0 or 1)
In addition, I am getting the compressed public key from the same API in hex format. If I try to derive the address from this pubkey I am getting exactly the same one as my INJ wallet.
The problem is when I submit the transaction to the network I get:
pubKey does not match signer address <my_address> with signer index: 0: invalid pubkey
When buidling the tx I set the pubkey in base64.
The attached signature is Buffer from r & s values.
The documentation is not very helpful and I basically did the same as the PrivateKey.sign method of the sdk
Maybe worth mentioning that the derivation of the keys in my wallet is done with bip44 coin type 60 (same as ethereum)
And the same issue is happening when I am using the EIP712 signing method.
Hello @lyric falcon - you can do it programmable (sdk or chain binnary) or you can add your token to https://github.com/cosmos/chain-registry. and token will appear in wallets (Keplr, Leap) or bridge(https://app.tfm.com/bridge?chainFrom=&chainTo=) where you can transfer your token to another network
Is there a problem checking the orderbook throught the API ? I often get the error “list index out of range”
But sometimes, without changing the code, I get the datas I need
There is no reported issue that I am aware @hexed dock . If you are using a private node you should check if it is syncing correctly. If you are using the public servers, they are usually under heavy load and you could easily experience connectivity issues
Do I need to create the appropriate entries for both the source and destination networks(in chain-registry)? How do I obtain the IBC number that is in the 'base' field?
It’s fixed at the moment, using public node
Thanks @topaz seal
Anyone?
I think for source newtwork( Injective) will enough
I don't think I understood your scenario clearly. But I do know that TS SDK documentation includes working examples on how to transfer tokens from one account to the other
Hello, try
**signature => return concat([ this.r, this.s, (this.yParity ? "0x1c": "0x1b") ]);
get yParity(): 0 | 1 {
return (this.v === 27) ? 0: 1;
}
**
I also recommend to set the same private key on the remote signer and use the same key in the injetive-ts sdk. Next, sign identical data and check signature
Thanks! I did exactly this and still having the error (I just followed the same code as in the ts-SDK)
Unfortunately I cannot set the same key locally and remotely and cannot extract the remote key as well. Is there anywhere a specification on how to create and attach signatures?
I can't access the grpc node using the ts SDK since today's upgrade. Calling ChainGrpcBankApi.fetchBalance returns GrpcUnaryRequestException error. This happens with my own node and with any public nodes as well.
Please clarify which SDK you are using, and which version
@injectivelabs/sdk-ts@1.14.13
@willow notch
I already found a solution, it now works with the same port used for the API at app.toml (and with the public LCD endpoint). Thank you!
Hello, is there an issue with ledger signing on frontends? not able to sign on coinhall and dojoswap. Also is it possible to readd the InjectiveStargate client to the injective-ts package
Hello, Frontend from Neptune Finance. Since the chain upgrade, our app has been throwing this error as a response from the broadcaster on every transaction attempt on production and on local dev env:
The request has failed. The server has closed the connection without sending any headers.
Access to fetch has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
POST 502 (Bad Gateway)
@woeful moon
using rest api endpoint inplace of grpc web will fix this issue
@lavish pond @feral wyvern grpc-web should be fixed now, lmk if you have same issues ^
Just tested, works
Looking good now
Can confirm, it is working well now
Is it possible to use the API with a Ledger ? Cause we don't have private key with a ledger
Do you mean the node API? If that is the question, then yes. To broadcast message you sign them in the origin, before interacting with the API. So it does not matter how the consumer signs TXs, as far as they are correctly signed
@topaz seal
I need to fetch tx in this way that:
I will give sender address, receiver address both, chain will fetch all tx in which both addresses were involved.
Iuts opposite to conventional fetch methods by which we fetch by giving a single address, then the chain give us its last 100 txc fetched.
I wanna gfetch by giving two addresses and get all tx involving two of them
is it possible? i seen through the docs, not found this thing
found balance fetchs, etc, but not the way to fetch tx with two input addresses
i need to fetch tx involving both and reterive their memos from chain.
I am using this to map from a single address, but not from one sender all senders to that address.
I want to specify second address too.
There is no endpoint providing those filters. You will have to use the available endpoints to get TXs and then do the filter on the client side
And any way to specify time like instead of inputting last 100 tx or last 25 tx, we input time like after 12:34 UTC, xyz date. And get all tx after that time for a specific address.
I need for explorer type of dapp
check the message to get TXs using the Indxer. There will still be a limit to the number of results returned per request, but you can use pagination to get all results you need
hello <@&1261564154146328646>! make sure to tune in!
We will learn how to deploy our custom contracts on chain (other than token creation, as that's technically a smart contracts but I wanna learn other use cases)
Right
Correct! 🙂
Hi, is there anywhere I can go to, to learn how to query smart contracts, in particular a contract's tx history?
Hi! Smart contract does not store transaction history, but there are exceptions. If you want to query smart contracts :
https://docs.ts.injective.network/querying/querying-chain/querying-chain-wasm#fetch-the-state-of-a-smart-contract
If you want to get tx history - you can use this (Fetch an account transaction by address) https://docs.ts.injective.network/querying/querying-api/querying-indexer-explorer#fetch-an-account-transaction-by-address
If you write more details about what you want to do, I try to help you.
is it possible to use the python sdk to create market orders for permisionless markets ? I get a key error
market = self.spot_markets[market_id]
KeyError: '0xc6b6d6627aeed8b9c29810163bed47d25c695d51a2aa8599fc5e39b2d88ef934'
I manually added the market
now when I try simulate a market buy
market_id=market_id,
sender=self.address.to_acc_bech32(),
subaccount_id=self.acc_id,
fee_recipient=self.fee_recipient,
price=Decimal(0.000000402),
quantity=Decimal(10000),
order_type="BUY",
)```
`details = "math/big: cannot unmarshal "402000000000.000025037199766" into a *big.Int: tx parse error `
for some reason there is a decimal left over, even though `402000000000` is correct
Namely if its possible to derive the open interest in USDT terms from the cumulativeFunding and cumulativePrice values?
Or some other way to derive the open interest values?
I am unable to create spot orders for permissionless helix markets in the latest python SDK
even after adding the spot market to composer.spot_markets, it still does not construct the msg properly
managed to get it working. but need to construct the message myself. the composer gets the decimals wrong
That market is not considered by the Python SDK beacuse the Indexer is not returning the baseTokenMeta when providing the market information
There must be some error in the information provided for the market, since the price conversion is not working properly
Hey question to devs here 😄
testnet.sentry.lcd.injective.network/cosmos/tx/v1beta1/txs?events=transfer.recipient%3D%27inj1v2xyk5ekyy0534cuf0djfrfagj8xzdt5d0n5p3%27&pagination.reverse=true&order_by=2
I'm trying to get this info about specified address trx from testnet, in last week it have been working, today it show "query cannot be empty" error. Can someone tell me what I screwed up here?
You can find the list of endpoints in the swagger page https://testnet.lcd.injective.network/swagger/
Thanks for info, i have been checking that. But in last week such request have been working correctly, right now It's not visible in swagger. I have been testing similar request on other networks as well and they are working fine. I'm mostly looking for info have it been disabled purposefully or is it some kind of issue. If it have been disabled then I need to find some new source of info.
Hi everybody - Thanks @lime ruin !
I'm keen to speak to somebody who cares about testing and finding bugs in the core Injective codebase. I'm not interested in bug bounties.
All devs are interested in bugs being found and fixed
I work for a startup which has a way in which we can simulate distributed systems, and stress them to the point of failure, with 100% reproduction. We're finding that Ethereum, Ava Labs, Mysten etc are finding this very useful for their engineers
Worth discussing Injective?
that is not something we tend to discuss in public channels. Please use the #📥︲collaborations to start a conversation with the InjectiveLabs team
Fill in the form?
yes, correct
Ok - form submitted. Thank you.
Hello,
I am from Andromeda team and I need injective team's help for cosmwasm smart contract building
Hi, if you have a question then please ask right away.
https://github.com/InjectiveLabs/cw-injective/blob/9fd98672474c98022e913171ae6916dd88d5f5a0/contracts/injective-cosmwasm-mock/src/contract.rs#L34-L59
Here the generic type of DepsMut is InjectiveQueryWrapper, so I implemented the smart contract using this.
But it occurs an error like this:
So here I can not use InjectiveQueryWrapper as CustomQuery of DepsMut.
How to solve this problem...
I would appreciate your help.
@frosty kiln
Hello @frosty kiln
Can you help me for the problem I raised?
hi would like to check is there API or script to check the exact on-chain timestamp of a validator/delegator earning staking rewards?
i checked on mintscan explorer and also Injective official API docs, only can query accrued rewards
Does anyone know how to get the lp denom address for a mito vault ?
You might find an answer for your question if you post it in the Mito Discord Server
You should not expect the command to succeed if you point to incorrect endpoints. Please check Injective docs page to get the list of correct endpoints
I assume you mean you got that endpoint from a doc example script. Please check the official endpoints doc page and addapt the example script accordingly (example scripts are supposed to be taken as examples, not as code that should be executed after just copying/pasting)
Hi guys, I am trying to use MetaMask to Sign EIP712TypedData with using injective-sdk-ts. MsgSend was fine but MsgStoreCode doesn't work. I used getEIP712TypedData. Which Stops the whole React app.
So Alternatively I used getEIP712TypedDataV2 and it worked fine but when I sign the data on MetaMask.
MetaMask emits the error "please verify account number (740687) and chain-id (injective-888):UnAuthorized". Can Somebody could help me with this problem? (I used injective-sdk-ts doc's transaction/ethereum example)
Hello, I'm using StartGate client to connect to Injective (latest version 0.32.4) and receiving a lot of "Bad status on response 403" errors durinng connection. Sometime it's necessary to try it 10x times to be able to connect properly. Is this know issue?
I'm using cosmos.directory RPC as same as official RPC but with the same results
Hey @zealous stream can you share the payload you're sending? we're want to check against MsgStoreCode transactions on testnet to compare the difference
https://testnet.sentry.exchange.grpc-web.injective.network/api/explorer/v1/txs?limit=1&type=cosmwasm.wasm.v1.MsgStoreCode
Is there mito dev overlap here ? My vault is not updating orders on price change
@zealous stream wrote a script to test, managed to upload the contract via the sdk-ts function. To help you better i need more context
<script lang="ts" setup>
import {
PrivateKey,
MsgStoreCode,
MsgBroadcasterWithPk
} from '@injectivelabs/sdk-ts'
import { Network } from '@injectivelabs/networks'
const privateKeyHash = 'yourPrivateKeyGoesHere'
const privateKey = PrivateKey.fromHex(privateKeyHash)
const injectiveAddress = privateKey.toBech32()
async function handleFileUpload(event: InputEvent) {
const target = event.target as HTMLInputElement
if (!target.files) {
return
}
const buffer = await target.files[0].arrayBuffer()
const bytes = new Uint8Array(buffer)
const msgStore = MsgStoreCode.fromJSON({
wasmBytes: bytes,
sender: injectiveAddress
})
const txHash = await new MsgBroadcasterWithPk({
privateKey: privateKeyHash,
network: Network.Devnet
}).broadcast({
msgs: msgStore,
gas: {
gas: 100000000000000
}
})
console.log(`Transaction hash: ${txHash}`)
}
</script>
<template>
<div>
<input type="file" @change="handleFileUpload" />
</div>
</template>
Thank you for the script but My problem is storecode with MetaMask wallet. I already checked out that storecode with keplr works fine.
hi all! I'm building a trading bot to trade on helix but I get a lot of 503 errors on my grpc requests as well as in the chain-stream channel. Is there any way to whitelist my IP address or know how long I'm banned for? I'm using the official endpoints
2024-08-22 14:17:07,855 - 15 - hummingbot.connector.exchange.injective_v2.data_sources.injective_grantee_data_source.InjectiveGranteeDataSource - WARNING - Error while listening to chain stream (<AioRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Received http2 header with status: 503"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-08-22T14:17:07.78746198+00:00", grpc_status:14, grpc_message:"Received http2 header with status: 503"}"
>)
Public servers should only be used for basic tests. Any other than that should be done on private nodes. Public servers are most of the time under heavy load
Managed to reproduce the issue, thanks for sharing. We will look into this
I found the reason why and trying to solving it Thank you!
i am doing some IBC transactions via a smart contract and they seem to be stuck in the relayer.
is there a way i can figure out why they are stuck?
on the mintscan realyers page it shows 4 pending transactions on the injective side
they have been stuck for about 40 minutes
txs are still stuck, it's been 3 hours
this is the one from about 3 hours ago 2B1CFB43D8AC6836F30A56EEB306C33C882C28481CEE79D61B584DE0CD3351DB this is a msg that should trigger an ibc transaction that replies with a random number from secret network.
it's worked earlier today, it took about 9.5 minutes then i upped the gas fee and it went through in 90 seconds, then i tried some more times and it has been 3 hours
is it possible to do a multi-message tx on the command line? i know how to create multiple execute messages on a FE and put them in one tx, but on cli i am not sure how to do it on a command line. i tried just putting the messages in a json array and that did not work
There is no command to do that, but you could generate each message in its own TX with the --generate-only parameter, and then take all messages from each generated file and put them in a single TX file. Afterwards you can use the sign command
Hi ! What is the command to get the differents endpoint of a local node ?
Like that
you should try asking that question in #🔩・node-operators
Hi Injective team, can I request transactions with certain event with: tm.injective.network/tx_search?query=&prove=&page=&per_page=&order_by=_
I want to get transactions that send token to my address in certain height.
Thanks.
Where to report for IBC relayer?!
Has Anyone used cw-injective/atomic-order-example? I am trying to execute the contract on testnet but somehow getting that my funds are insufficient.
I am sending 21USDT as fund. 0.000000000020449 as price and 10000000000000000 as quantity. I have queried the order book using indexer and checked out on the helixapp(testnet) for the worst price.
My wallet Address is inj16j4rzjtsmp8vkk5074lrrctx574xtxwkekf55r
Grpc Message:
failed to execute message; message index: 0: dispatch: submessages: reply: dispatch: submessages: spendable balance 558742peggy0x87aB3B4C8661e07D6372361211B96ed4Dc36B1B5 is smaller than 558743peggy0x87aB3B4C8661e07D6372361211B96ed4Dc36B1B5: insufficient funds [!injective!labs/cosmos-sdk@v0.50.9-inj-2/x/bank/keeper/send.go:275] With gas wanted: '50000000' and gas used: '499731'
devs. i have a question. I want to start in Smart Contract programming
What i need to do?
https://book.cosmwasm.com/ I use this book and learn Rust!
For Injective learn rust.
@lime ruin @mortal kelp could you help us banning this spammer?
sure
Wow, that was fast. Much appreciated!
Happy devs day guys
You guys are the powerhouse of Injective
Love you all
no fucking way
Yup
Yh we deserve one
Btw did you manage to do it already?
@lime ruin you can check on my discord how many holders i have
Getting all the holders for that token.
yeah
i can all the CW20 tokens holders
yeah
quite funny 168 holders i didnt expect that lol
well sounds a lot
indeed just a pedro coin
but scared 43,61% are whale holders
i dont know what to do
lol
Never
Lol
saw your github love the snake
Yeah it's cool.
crazy shit
Found it at someone's profile I think
why grade C?
Haven't been really active for like a year lol
really cool i really love the injective documentation the youtube video helps u also a lot tho
the hackathon ones?
ohw i see never stop
yes
yeah got busy with stuff
else would just continue all day
Nice bro i know in the past you was a warrior and always kind to injective
true
missed you buddy
you were there back then?
Did stupid things, so use back up discord
We talked alot in the past hahaha
Ai code editor?
yeah that one
well for auto complete does feels to help
i just don't like it messing with the keybinds
I see dont use just use extensions
that help me with cleaning the code
yeah formatting classes and stuff
well cursor is basically
Good day fam
Anyone here that's quite familiar with Injective go-sdk?
use stackoverflow HAHAHA
How's it going Lahn
great ser
lol
i can't imagine asking a question on stack overflow
without being asked to fix the question a million times
whats the question sir?
I struggle signing up an account the last time I attempted to use it.
More like questions, can I dm?
export const chainGrpcWasmApi = new ChainGrpcWasmApi(ENDPOINTS.grpc);
(async () => {
const response = await chainGrpcWasmApi.fetchSmartContractState({
contractAddress: "inj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm", // The address of the contract
});
console.log(response);
})();
Is this wrong way to fetch the state, or are you also supposed to query something.
interesting i am programming most of the part on python
oh, i used to use python mostly
but then switched to js
as i started learning frontend
you can do that
what give? the log?
just gives an error
TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object
maybe just passed it wrong arguments
contract_history = await client.fetch_all_contracts_state(address=address, pagination=pagination) this was my python code
fetchSmartContractState
is there no other function/class
ah got it
(async () => {
const response = await chainGrpcWasmApi.fetchSmartContractState(
"inj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm"
);
console.log(response);
})();
this is how you're supposed to do it
it requires the first argument as the contract address
Good grpc?
wrapping it in the object makes it think that the object is the contract address
ohw i see
lol
why not using backend for this?
all the data and stuff always for backend
thats what people told me
uh like setup a backend and fetch data there then setup an api and use that api to request data for frontend?
yeah like that
Frontend → Sends request to backend → Backend will do the work for you → Returns the data to frontend?
well maybe yeah that's probably more efficient but
just putting it in frontend feels easier
lol
true true
i mean you'll still need to request from the frontend
i didnt know about pagination
oh yeah, it doesn't returns all the data at once
yeah for sure
max 100
so i thought wtf
why my wallet not inside
the only benefit probably the backend will be able to provide would be the processing power and stuff
considering you wanna to something which you can't do on frontend
i just dont like use javascript for that
its also not safe
yeah
i wanna also say walletadresses but u need to request it ofc
you need to query all_accounts for the holders right?
yes
show me lahn
how much
indeed the base64 is quite funny
balanceinj.....
skull
balanceinj?
and more ...balanceinj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm you get that
from base 64
data: Uint8Array(464) [
123, 34, 97, 99, 99, 111, 117, 110, 116, 115, 34, 58,
91, 34, 105, 110, 106, 49, 48, 54, 57, 106, 117, 119,
110, 50, 48, 106, 97, 107, 51, 110, 97, 116, 48, 101,
115, 54, 121, 122, 117, 102, 114, 121, 99, 50, 103, 119,
101, 56, 109, 116, 109, 118, 116, 119, 34, 44, 34, 105,
110, 106, 49, 48, 99, 103, 113, 48, 113, 102, 57, 110,
52, 56, 120, 56, 122, 117, 102, 114, 104, 101, 48, 117,
99, 97, 115, 104, 120, 54, 107, 55, 102, 108, 102, 113,
103, 97, 112, 97,
... 364 more items
]
}
it gave me this
the hell
wtf
well this was without converting to base64
its not base64 lol
its uint8array
wtf why
ah not that
this is what docs say
that you gotta convert the query to base64
you didn't do that?
what for value u get before base64?
this right?
wdym
not getting count
import { ChainGrpcWasmApi } from "@injectivelabs/sdk-ts";
import { Network, getNetworkEndpoints } from "@injectivelabs/networks";
export const NETWORK = Network.MainnetSentry;
export const ENDPOINTS = getNetworkEndpoints(NETWORK);
export const chainGrpcWasmApi = new ChainGrpcWasmApi(ENDPOINTS.grpc);
(async () => {
const response = await chainGrpcWasmApi.fetchSmartContractState(
"inj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm",
{ all_accounts: {} }
);
// console.log(new TextDecoder().decode(response));
console.log(response);
})();
code rn
little bit confusing
and the response give the numberss above right
so textdecoder doesnt work?
nah
show code
here
it's there
commented
ohw lol
i see
new TextDecoder().decoder.decode(response)?
you want convert uint8array to string i guess
node:internal/encoding:449
return decodeUTF8(input, this[kIgnoreBOM], this[kFatal]);
^
TypeError: The "list" argument must be an instance of SharedArrayBuffer, ArrayBuffer or ArrayBufferView.
at TextDecoder.decode (node:internal/encoding:449:16)
at file:///d:/kurisu/test.js:14:42
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
but if u run this what give the console again? what for error you get
just that unit8array
can u run the commented also
that gives this
Ggs
GG
import { ChainGrpcWasmApi, fromBase64, toBase64 } from "@injectivelabs/sdk-ts";
import { Network, getNetworkEndpoints } from "@injectivelabs/networks";
export const NETWORK = Network.MainnetSentry;
export const ENDPOINTS = getNetworkEndpoints(NETWORK);
export const chainGrpcWasmApi = new ChainGrpcWasmApi(ENDPOINTS.grpc);
(async () => {
const response = await chainGrpcWasmApi.fetchSmartContractState(
"inj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm",
toBase64({ all_accounts: {} })
);
console.log(fromBase64(response.data));
})();
works
this
ohw really
but that doesnt make sense
it just gives 10 addresses though
wtf
works at least
u can also do directly
pagination and limit
wtf
put limit 100
max 100
console.log(new TextDecoder('utf-8').decode(response)); <-- works this also?

just curious
lemme try
it does
nice!
i thought so we can decode but to where lol
but @lime ruin i wanna all the wallet holder
can u remove this?
idk if people wanna share all his inj adresses
so need 2 requsts ig
another requst doesnt work right?
idk has there a parameter for pagination and limit?
well yeah
lets gooooooo
erm
yes
so u have now 100 adresses?
{ all_accounts: { limit: 100 } }
yes
well u need to extract the last nextkey
but how does the data looks now if before utf-8
by python you get this
not sure if there's a pagination
so he can search furhter with the nextkey
hmm wait
send documentation
import asyncio
from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network
async def main() -> None:
network = Network.mainnet()
client = AsyncClient(network)
address = "wallet"
limit = 2
pagination = PaginationOption(limit=limit)
contract_history = await client.fetch_all_contracts_state(address=address, pagination=pagination)
print(contract_history)
if name == "main":
asyncio.get_event_loop().run_until_complete(main())
i mean the query which you're querying to the contract
sorry bro mindfuck now
what u mean
async def main() -> None:
network = Network.mainnet()
client = AsyncClient(network)
address = "inj1c6lxety9hqn9q4khwqvjcfa24c2qeqvvfsg4fm"
limit = 1000
pagination = PaginationOption(limit=limit)
contract_history = await client.fetch_all_contracts_state(address=address, pagination=pagination)
A = contract_history
print(contract_history)
while contract_history['pagination']['nextKey']:
pagination = PaginationOption(limit=limit, encoded_page_key=contract_history['pagination']['nextKey'])
contract_history = await client.fetch_all_contracts_state(address=address, pagination=pagination)
A['models'] += contract_history['models']
A['pagination'] = contract_history['pagination']
print(f"Fetched {len(contract_history['models'])} models, total now: {len(A['models'])}")
this is for example what i am querying
ah
can you remove those #
i see
anyways, this worked
yeah happy

i am just happy that injective makes my life easier
lahn babe
yo
lol
nah i am stupif
hmm there's also this
for querying the contracts
