js-conflux-sdk
Conflux Doc
  • Home
  • Introduction
  • QuickStart
  • Overview
  • Contrast with web3.js
  • Guides
    • Providers
    • How to Connect Fluent
    • CIP37 Address
    • Account
    • Sending Transaction
    • Interact with Contract
    • Sign methods
    • Error Handling
    • Batch RPC
  • API
    • Conflux
    • PoS
    • TxPool
    • Provider
    • Drip
    • Transaction
    • Wallet
  • Release notes
  • v2.0 Changes
  • FAQs
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API

Drip

PreviousProviderNextTransaction

Last updated 2 years ago

Was this helpful?

Drip

Positive decimal integer string in Drip

Kind: global class

    • instance

      • ⇒ string

      • ⇒ string

    • static

      • ⇒

      • ⇒

new Drip(value)

Param
Type

value

number | string | BigInt

Example

> new Drip(1.00)
   [String (Drip): '1']
> new Drip('0xab')
   [String (Drip): '171']

drip.toCFX() ⇒ string

Get CFX number string

> Drip(1e9).toCFX()
   "0.000000001"

drip.toGDrip() ⇒ string

Get GDrip number string

> Drip(1e9).toGDrip()
   "1"

Get Drip string from CFX

Param
Type

value

string | number | BigInt

Example

> Drip.fromCFX(3.14)
   [String (Drip): '3140000000000000000']
> Drip.fromCFX('0xab')
   [String (Drip): '171000000000000000000']

Get Drip string from GDrip

Param
Type

value

string | number | BigInt

Example

> Drip.fromGDrip(3.14)
   [String (Drip): '3140000000']
> Drip.fromGDrip('0xab')
   [String (Drip): '171000000000']

Kind: instance method of Example

Kind: instance method of Example

Drip.fromCFX(value) ⇒

Kind: static method of

Drip.fromGDrip(value) ⇒

Kind: static method of

Drip
new Drip(value)
.toCFX()
.toGDrip()
.fromCFX(value)
Drip
.fromGDrip(value)
Drip
Drip
Drip
Drip
Drip
Drip
Drip