Skip to content

Commit

Permalink
nit: hash wars
Browse files Browse the repository at this point in the history
  • Loading branch information
dalechyn committed Nov 3, 2024
1 parent 81e1def commit 374187a
Show file tree
Hide file tree
Showing 121 changed files with 2,455 additions and 830 deletions.
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
message publishing
register signer
register fname
register fid | viem
52 changes: 48 additions & 4 deletions playground/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Actions, Client, Transport } from 'fhub'
// import { CastAdd_toMessageDataProtobuf } from '../../src/Node/Internal/CastAdd/toMessageDataProtobuf'
// import { CastAdd_toMessageProtobuf } from '../../src/Node/Internal/CastAdd/toMessageProtobuf'
// import { Message_fromProtobuf } from '../../src/Node/Internal/Message/fromProtobuf'
import { CastAdd_toHex } from '../../src/Node/Internal/CastAdd/toHex'
// import { Actions as NodeActions } from 'fhub/Node'
// import {
// file_hub_event,
Expand Down Expand Up @@ -42,7 +46,47 @@ const client = Client.create(
// console.log('recasts', castWithReactions.recasts.length)

// events subscriptions
for await (const cast of Actions.Watch.watchCasts(client)) {
// biome-ignore lint/suspicious/noConsoleLog: <explanation>
console.log(`${cast.fid} casted at ${cast.timestamp}: ${cast.text.value}`)
}
// for await (const cast of Actions.Watch.watchCasts(client)) {
// // biome-ignore lint/suspicious/noConsoleLog: <explanation>
// console.log(`${cast.fid} casted at ${cast.timestamp}: ${cast.text.value}`)
// }
//

const cast = await Actions.Cast.getCast(client, {
fid: 11517n,
hash: '0x388ec5079a518ca133ec87aac23e1c4743bcc860',
})

console.dir(cast.meta, { depth: Number.POSITIVE_INFINITY })
console.dir(
CastAdd_toHex(cast),

{ depth: Number.POSITIVE_INFINITY },
)
// console.dir(
// Message_fromProtobuf(
// CastAdd_toMessageProtobuf({
// cast,
// privateKey:
// '0x0000000000000000000000000000000000000000000000000000000000000000',
// }),
// ),
// { depth: Infinity },
// )

// cast creation
// const message = await Actions.Cast.create(client, {
// cast: {
// text: {
// value: 'I sent this cast from my fhub package',
// },
// isLong: false,
// },
// account: {
// fid: 11517n,
// privateKey:
// '0x243d43a14dc0416c8b9b4cf253b05aa2531a4782e3c709d3456d017945af8dac',
// },
// })

// console.log(message)
147 changes: 126 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Actions/Cast.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { Actions_Cast_getCast as getCast } from '../Internal/Actions/Cast/getCast.js'
export { Actions_Cast_create as create } from '../Internal/Actions/Cast/create.js'
6 changes: 6 additions & 0 deletions src/Internal/Account/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { Types } from 'ox'

export type Account = {
privateKey: Types.Hex
fid: bigint
}
Loading

0 comments on commit 374187a

Please sign in to comment.