Skip to content

Commit

Permalink
fix: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
hcote committed Dec 4, 2024
1 parent 79a83c5 commit d2af7b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/@magic-ext/kadena/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Extension } from '@magic-sdk/commons';
import {
IUnsignedCommand,
KdaUnsignedCommand,
KadenaConfig,
KadenaPayloadMethod,
KadenaUserMetadata,
Expand Down Expand Up @@ -33,7 +33,7 @@ export class KadenaExtension extends Extension.Internal<'kadena'> {
}

public async signTransactionWithSpireKey(
transaction: IUnsignedCommand,
transaction: KdaUnsignedCommand,
): Promise<SignTransactionWithSpireKeyResponse> {
const signedTransaction = await this.request(
this.utils.createJsonRpcRequestPayload(KadenaPayloadMethod.KadenaSignTransactionWithSpireKey, [{ transaction }]),
Expand Down
28 changes: 16 additions & 12 deletions packages/@magic-ext/kadena/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,29 @@ export interface SignTransactionResponse {
pubKey?: string;
}

export interface IUnsignedCommand {
hash: string;
export interface KdaUnsignedCommand {
cmd: string;
sigs: [undefined];
}

export interface Sig {
sig: string;
pubKey?: string;
hash: string;
sigs: Array<
| string
| {
pubKey: string;
sig?: string;
}
| undefined
>;
}

export interface ICommand {
export interface KdaSignedCommand {
hash: string;
cmd: string;
sigs: Sig[];
sigs: {
sig: string;
pubKey?: string;
}[];
}

export interface SignTransactionWithSpireKeyResponse {
transactions: (IUnsignedCommand | ICommand)[];
transactions: (KdaUnsignedCommand | KdaSignedCommand)[];
}

export interface KadenaUserMetadata {
Expand Down

0 comments on commit d2af7b4

Please sign in to comment.