Content pfp
Content
@
https://warpcast.com/~/channel/fc-devs
0 reply
0 recast
0 reaction

Greg pfp
Greg
@greg
where is the latest example of how to create a signer and publish a message to snapchain? examples in the docs don't work :/ https://docs.farcaster.xyz/developers/guides/writing/submit-messages
1 reply
1 recast
2 reactions

Sanjay pfp
Sanjay
@sanjay
That is the latest. Specifically, this example should work https://github.com/farcasterxyz/hub-monorepo/blob/main/packages/hub-nodejs/examples/write-data/index.ts. What's the error you're seeing?
2 replies
0 recast
2 reactions

Greg pfp
Greg
@greg
just copied and pasted the whole file to my editor with latest version of farcaster/hub-nodejs and getting type errors on every makeCastAdd() as well as the final client.submitMessage Property `type` is missing but required in type `CastAddBody` for the former I fixed that but client.submitMessage is still not happy
2 replies
0 recast
1 reaction

Sanjay pfp
Sanjay
@sanjay
Hmm, that's odd. `type` should be optional. But you should able to do `type: CastType.CAST` and it should work. I'll fix. What's the issue with submitMessage?
1 reply
0 recast
1 reaction

Greg pfp
Greg
@greg
yea that's what i did for makeCastAdd but then submitMessage seems to not like CastType.CAST
1 reply
0 recast
1 reaction

Greg pfp
Greg
@greg
also worth pointing out that the example tries to do the equivalent of `client.submitMessage(cast)` instead of `cast.value` but that seemed even more wrong ๐Ÿ˜…
1 reply
0 recast
1 reaction

Sanjay pfp
Sanjay
@sanjay
It submits after calling map which should use the value. Could you share the full code with me? I don't get the submitMessage error. if (cast.isOk()) { await client.submitMessage(cast.value) } works for me.
1 reply
0 recast
0 reaction

Greg pfp
Greg
@greg
ah right - sorry stepped away from my computer for a bit, ill send it when I get back
1 reply
0 recast
0 reaction

Greg pfp
Greg
@greg
here you go @sanjay, trying to cast from @gtest using the private key of account 0x1dB89032CF3f29092C1FCBe6ed8cA4eCB08A437E which registered a signer onchain a few hours ago https://gist.github.com/gskril/c20b63f01f1aad3ac122092f79f894a5
1 reply
0 recast
0 reaction