Skip to content

Commit 39f971b

Browse files
committed
format files
1 parent 88f5824 commit 39f971b

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@ We recommend using the npmjs package in order to receive updates/fixes.
99

1010
### App Operations
1111

12-
| Operation | Response | Command | Notes |
13-
| ------------ | --------------------------- | ------- | ------------------------------------ |
14-
| getAppName | { name: string, version: string } | None | Returns app name and version |
15-
| getAppVersion| { version: string } | None | Returns app version |
12+
| Operation | Response | Command | Notes |
13+
| ------------- | --------------------------------- | ------- | ---------------------------- |
14+
| getAppName | { name: string, version: string } | None | Returns app name and version |
15+
| getAppVersion | { version: string } | None | Returns app version |
1616

1717
### Address Operations
1818

19-
| Operation | Response | Command | Notes |
20-
| ------------ | --------------------------- | ------- | ------------------------------------ |
21-
| getAddress | { publicKey: string } | account + showAddrInDevice | Retrieves public key for given account |
19+
| Operation | Response | Command | Notes |
20+
| ---------- | --------------------- | -------------------------- | -------------------------------------- |
21+
| getAddress | { publicKey: string } | account + showAddrInDevice | Retrieves public key for given account |
2222

2323
### Transaction Operations
2424

25-
| Operation | Response | Command | Notes |
26-
| -------------- | --------------------------- | ----------------------------------------------------------------------- | ------------------------------------ |
27-
| signTransaction| { signature: string } | txType + senderAccount + senderAddress + receiverAddress + amount + fee + nonce + validUntil + memo + networkId | Signs a Mina transaction |
28-
| signMessage | { field: string, scalar: string, raw_signature: string, signed_message: string } | account + networkId + message | Signs a message using the specified account |
25+
| Operation | Response | Command | Notes |
26+
| --------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
27+
| signTransaction | { signature: string } | txType + senderAccount + senderAddress + receiverAddress + amount + fee + nonce + validUntil + memo + networkId | Signs a Mina transaction |
28+
| signMessage | { field: string, scalar: string, raw_signature: string, signed_message: string } | account + networkId + message | Signs a message using the specified account |
2929

3030
### Transaction Types
3131

32-
| Type | Value | Description |
33-
|------|-------|-------------|
34-
| PAYMENT | 0x00 | Payment transaction |
35-
| DELEGATION | 0x04 | Delegation transaction |
32+
| Type | Value | Description |
33+
| ---------- | ----- | ---------------------- |
34+
| PAYMENT | 0x00 | Payment transaction |
35+
| DELEGATION | 0x04 | Delegation transaction |
3636

3737
### Network IDs
3838

39-
| Network | Value | Description |
40-
|---------|-------|-------------|
41-
| MAINNET | 0x01 | Mina mainnet |
42-
| DEVNET | 0x00 | Mina devnet |
39+
| Network | Value | Description |
40+
| ------- | ----- | ------------ |
41+
| MAINNET | 0x01 | Mina mainnet |
42+
| DEVNET | 0x00 | Mina devnet |
4343

4444
## Notes
4545

src/app.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ export class MinaApp extends BaseApp {
241241
signature: null,
242242
returnCode: "-4",
243243
message: "Fee too small",
244-
245244
};
246245
}
247246

@@ -350,7 +349,7 @@ export class MinaApp extends BaseApp {
350349
);
351350

352351
const response = processResponse(responseBuffer);
353-
352+
354353
// Validate minimum buffer length (64 bytes for signature + 1 byte for message length)
355354
if (response.length() < 65) {
356355
throw new Error("Response buffer too short");
@@ -361,17 +360,21 @@ export class MinaApp extends BaseApp {
361360
const sigLength = signature.length;
362361
const field_extracted = signature.substring(0, sigLength / 2);
363362
const scalar_extracted = signature.substring(sigLength / 2, sigLength);
364-
363+
365364
// Then read the message length (1 byte)
366365
const messageLength = response.readBytes(1).readUInt8();
367-
366+
368367
// Validate remaining buffer length against message length
369368
if (response.length() < messageLength) {
370-
throw new Error(`Response buffer too short for message: expected ${messageLength} bytes but only ${response.length()} remaining`);
369+
throw new Error(
370+
`Response buffer too short for message: expected ${messageLength} bytes but only ${response.length()} remaining`,
371+
);
371372
}
372-
373+
373374
// Finally read the message
374-
const returnedMessage = response.readBytes(messageLength).toString('utf8');
375+
const returnedMessage = response
376+
.readBytes(messageLength)
377+
.toString("utf8");
375378

376379
return {
377380
field: BigInt("0x" + field_extracted).toString(),

0 commit comments

Comments
 (0)