Skip to content

Instantly share code, notes, and snippets.

View paullinator's full-sized avatar

Paul V Puey paullinator

View GitHub Profile
@paullinator
paullinator / types.ts
Last active September 6, 2023 19:23
EdgeTxInfo
type EdgeTxAsset = {
pluginId: string,
tokenId: string,
nativeAmount: string,
}
type EdgeTxInfoSwap = {
type: 'swap' | 'swapOrder' | 'swapOrderFulfill',
orderId?: string,
direction: 'from' | 'to',
@paullinator
paullinator / rn-zcash-sdk.ts
Last active September 23, 2020 20:02
React Native Zcash SDK Interface
class KeyTool {
static deriveViewKey (seedBytesHex: string): string
static deriveSpendingKey: (seedBytesHex: string): string
}
class AddressTool {
static deriveShieldedAddress (viewingKey: string): string
static deriveTransparentAddress (viewingKey: string): string
static isValidShieldedAddress (address: string): boolean
static isValidTransparentAddress (address: string): boolean
}
@paullinator
paullinator / FlipInput Architecture
Last active January 25, 2018 11:24
Edge FlipInput component architecture
This is a proposed architecture for the commonly used, and frequently buggy, FlipInput and ExchangeFlipInput component.
## FlipInput
FlipInput component is not to access any redux state and all state is to be contained inside component. This will be a non-connected component. FlipInput will know nothing about nativeAmounts. All amounts going into and out of FlipInput are floatingpoint big numbers in US locale decimal format with no 1000s separator and are agnostic of native vs currency vs display amounts. All values are “decimal” values. Internally, FlipInput will display locale fixed `displayAmounts` which will have 1000s separators and decimal points added. For nomenclature, `displayAmounts` will refer to values with localized amounts in string format with 1000s separator. `decimalAmounts` will refer to en_US decimal format amounts with no 1000s separator and a `.` as the decimal point. Note that the FlipInput no longer returns both the primary and secondary values when they change nor does it notify whe