-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
fa9508e
commit 2eb31fa
Showing
29 changed files
with
196 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ledgerhq/wallet-api-core": minor | ||
--- | ||
|
||
Support Neo family |
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,26 @@ | ||
import BigNumber from "bignumber.js"; | ||
import type { RawNeoTransaction, NeoTransaction } from "./types"; | ||
|
||
export function serialize({ | ||
amount, | ||
recipient, | ||
family, | ||
}: NeoTransaction): RawNeoTransaction { | ||
return { | ||
amount: amount.toString(), | ||
recipient, | ||
family, | ||
}; | ||
} | ||
|
||
export function deserialize({ | ||
amount, | ||
recipient, | ||
family, | ||
}: RawNeoTransaction): NeoTransaction { | ||
return { | ||
amount: new BigNumber(amount), | ||
recipient, | ||
family, | ||
}; | ||
} |
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,9 @@ | ||
import type { z } from "zod"; | ||
import type { TransactionCommon } from "../index"; | ||
import type { schemaRawNeoTransaction } from "./validation"; | ||
|
||
export interface NeoTransaction extends TransactionCommon { | ||
readonly family: RawNeoTransaction["family"]; | ||
} | ||
|
||
export type RawNeoTransaction = z.infer<typeof schemaRawNeoTransaction>; |
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,6 @@ | ||
import { z } from "zod"; | ||
import { schemaFamilies, schemaTransactionCommon } from "../common"; | ||
|
||
export const schemaRawNeoTransaction = schemaTransactionCommon.extend({ | ||
family: z.literal(schemaFamilies.enum.neo), | ||
}); |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
64 changes: 64 additions & 0 deletions
64
website/docs/reference/api/client/interfaces/NeoTransaction.md
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,64 @@ | ||
--- | ||
id: "NeoTransaction" | ||
title: "Interface: NeoTransaction" | ||
sidebar_label: "NeoTransaction" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
Common fields for all cryptocurrency transactions | ||
|
||
## Hierarchy | ||
|
||
- [`TransactionCommon`](TransactionCommon.md) | ||
|
||
↳ **`NeoTransaction`** | ||
|
||
## Properties | ||
|
||
### amount | ||
|
||
• **amount**: `BigNumber` | ||
|
||
The amount of token to send in the transaction, denoted in the smallest cryptocurrency's magnitude | ||
For example in BTC, a tx with an 'amount' field of 1 will correspond to a tx corresponding to 0.00000001 BTC | ||
|
||
#### Inherited from | ||
|
||
[TransactionCommon](TransactionCommon.md).[amount](TransactionCommon.md#amount) | ||
|
||
#### Defined in | ||
|
||
packages/core/lib/families/types.d.ts:42 | ||
|
||
___ | ||
|
||
### family | ||
|
||
• `Readonly` **family**: ``"neo"`` | ||
|
||
The family of the transaction | ||
|
||
#### Overrides | ||
|
||
[TransactionCommon](TransactionCommon.md).[family](TransactionCommon.md#family) | ||
|
||
#### Defined in | ||
|
||
packages/core/lib/families/neo/types.d.ts:5 | ||
|
||
___ | ||
|
||
### recipient | ||
|
||
• **recipient**: `string` | ||
|
||
The address of the transaction's recipient | ||
|
||
#### Inherited from | ||
|
||
[TransactionCommon](TransactionCommon.md).[recipient](TransactionCommon.md#recipient) | ||
|
||
#### Defined in | ||
|
||
packages/core/lib/families/types.d.ts:46 |
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
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
Oops, something went wrong.