Skip to content

Commit

Permalink
update sdk gen & fix bitcoin auth length (#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
wow-sven authored Jul 14, 2024
1 parent 990dd47 commit c080c33
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 107 deletions.
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 2 additions & 1 deletion sdk/typescript/rooch-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"tweetnacl": "^1.0.3",
"bech32": "^2.0.0",
"@mysten/bcs": "1.0.2",
"valibot": "^0.25.0"
"valibot": "^0.25.0",
"buffer": "6.0.0"
},
"publishConfig": {
"access": "public",
Expand Down
14 changes: 8 additions & 6 deletions sdk/typescript/rooch-sdk/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
PaginationArguments,
PaginationResult,
SessionInfoView,
StateView,
ObjectStateView,
QueryUTXOsParams,
PaginatedUTXOStateViews,
PaginatedInscriptionStateViews,
Expand Down Expand Up @@ -148,13 +148,13 @@ export class RoochClient {
}

// Get the states by access_path
async getStates(params: GetStatesParams): Promise<StateView[]> {
async getStates(params: GetStatesParams): Promise<ObjectStateView[]> {
const result = await this.transport.request({
method: 'rooch_getStates',
params: [params.accessPath, params.stateOption],
})

const typedResult = result as unknown as StateView[]
const typedResult = result as unknown as ObjectStateView[]
return typedResult[0] === null ? [] : typedResult
}

Expand Down Expand Up @@ -364,9 +364,11 @@ export class RoochClient {
// Maybe we should define the type?
const tableId = (
(
((states[0].decoded_value as AnnotatedMoveStructView).value['value'] as AnnotatedMoveStructView).value[
'keys'
] as AnnotatedMoveStructView
(
(states[0].decoded_value as AnnotatedMoveStructView).value[
'value'
] as AnnotatedMoveStructView
).value['keys'] as AnnotatedMoveStructView
).value['handle'] as AnnotatedMoveStructView
).value['id'] as string

Expand Down
Loading

0 comments on commit c080c33

Please sign in to comment.