-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { MethodParamsAndResult, rpcRequestMessageSchema } from '../../../types'; | ||
import * as v from 'valibot'; | ||
|
||
export const stxSignTransactionsMethodName = 'stx_signTransactions'; | ||
export const stxSignTransactionsParamsSchema = v.object({ | ||
/** | ||
* The transactions to sign as hex-encoded strings. | ||
*/ | ||
transactions: v.array( | ||
v.object({ | ||
transactionHex: v.string(), | ||
|
||
/** | ||
* Whether the transaction should be broadcast after signing. Defaults to `false`. | ||
*/ | ||
broadcast: v.optional(v.boolean()), | ||
}) | ||
), | ||
}); | ||
export type StxSignTransactionsParams = v.InferOutput<typeof stxSignTransactionsParamsSchema>; | ||
export const stxSignTransactionsResultSchema = v.object({ | ||
/** | ||
* The signed transactions as hex-encoded strings. In the same order as the sign request. | ||
*/ | ||
transactions: v.array(v.string()), | ||
}); | ||
export type StxSignTransactionsResult = v.InferOutput<typeof stxSignTransactionsResultSchema>; | ||
export const stxSignTransactionsRequestMessageSchema = v.object({ | ||
...rpcRequestMessageSchema.entries, | ||
...v.object({ | ||
method: v.literal(stxSignTransactionsMethodName), | ||
params: stxSignTransactionsParamsSchema, | ||
id: v.string(), | ||
}).entries, | ||
}); | ||
export type StxSignTransactionsRequestMessage = v.InferOutput< | ||
typeof stxSignTransactionsRequestMessageSchema | ||
>; | ||
export type StxSignTransactions = MethodParamsAndResult< | ||
StxSignTransactionsParams, | ||
StxSignTransactionsResult | ||
>; |