Search
Preparing search index...
The search index is not available
detherjs
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
"dether"
DetherJS
Class DetherJS
classdesc
This is the main detherJS object You can Use it like this
Hierarchy
DetherJS
Index
Constructors
constructor
Properties
dth
Contract
encrypted
Wallet
geo
Registry
Contract
network
provider
shops
Contract
using
Metamask
zone
Factory
Contract
Methods
add
Shop
add
Teller
add
Teller
Comment
approve
Token
bid
Zone
claim
Free
Zone
collect
Shop
Taxes
create
Zone
delete
User
Shop
exec
Exchange
exec
Exchange
From
Sell
exec
Exchange_
delayed
get
All
Balance
get
Available
Token
get
Available
Token
Decimals
getERC20
Info
get
Exchange
Estimation
get
Licence
Price
InZone
get
Open
Bid
get
Shop
ByAddress
get
Shop
ByPosition
get
Shops
InZone
get
Shops
InZones
get
Teller
get
Teller
InZone
get
Tellers
InZones
get
Token
Liquidity
get
Transaction
Status
get
Zone
ByAddress
get
Zone
ByGeohash
get
Zones
Status
has
Approval
has
Provider
has
Wallet
init
init
Provider
is
Bidder
Onthis
Auction
is
Teller
is
Zone
Opened
is
Zone
Owned
is
Zone
Owner
load
User
load
Wallet
process
State
release
Zone
remove
Shop
remove
Teller
send
Crypto
set
Custom
Contract
Addresses
set
Shop
Licence
Price
shop
Exists
ByAddress
sign
Message
top
UpShop
top
UpZone
update
Teller
withdraw
Auctions
Raw
withdraw
Zone
Auction
Bid
withdraw
Zone
Auction
Bid
Address
withdraw
Zone
Auctions
Bid
withdraw
Zone
Auctions
Bid
Address
withdraw
Zone
Owner
Dth
withdraw
Zone
Owner
Dth
Address
Constructors
constructor
new
DetherJS
(
useMetamask
:
boolean
)
:
DetherJS
Parameters
useMetamask:
boolean
Returns
DetherJS
Properties
dth
Contract
dth
Contract
:
Contract
encrypted
Wallet
encrypted
Wallet
:
string
geo
Registry
Contract
geo
Registry
Contract
:
Contract
network
network
:
any
provider
provider
:
any
shops
Contract
shops
Contract
:
Contract
using
Metamask
using
Metamask
:
boolean
zone
Factory
Contract
zone
Factory
Contract
:
Contract
Methods
add
Shop
add
Shop
(
password
:
string
, shopData
:
IShopArgs
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
shopData:
IShopArgs
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
add
Teller
add
Teller
(
password
:
string
, tellerData
:
ITellerArgs
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
tellerData:
ITellerArgs
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
add
Teller
Comment
add
Teller
Comment
(
password
:
string
, zoneGeohash
:
string
, ipfsHash
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneGeohash:
string
ipfsHash:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
approve
Token
approve
Token
(
password
:
string
, token
:
Token
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
token:
Token
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
bid
Zone
bid
Zone
(
password
:
string
, geohash6
:
string
, bidAmount
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
bidAmount:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
claim
Free
Zone
claim
Free
Zone
(
password
:
string
, geohash6
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
collect
Shop
Taxes
collect
Shop
Taxes
(
password
:
string
, geohash6
:
string
, start
:
number
, end
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
start:
number
end:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
create
Zone
create
Zone
(
password
:
string
, country
:
string
, geohash6
:
string
, amount
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
country:
string
geohash6:
string
amount:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
delete
User
Shop
delete
User
Shop
(
password
:
string
, geohash6
:
string
, shopAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
shopAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
exec
Exchange
exec
Exchange
(
password
:
string
, sellToken
:
Token
, buyToken
:
Token
, sellAmount
:
string
, buyAmount
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
sellToken:
Token
buyToken:
Token
sellAmount:
string
buyAmount:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
exec
Exchange
From
Sell
exec
Exchange
From
Sell
(
password
:
string
, buyToken
:
Token
, sellAmount
:
string
, buyAmount
:
string
, destAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
buyToken:
Token
sellAmount:
string
buyAmount:
string
destAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
exec
Exchange_
delayed
exec
Exchange_
delayed
(
password
:
string
, sellToken
:
Token
, buyToken
:
Token
, sellAmount
:
string
, buyAmount
:
string
, nonce
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
any
>
Parameters
password:
string
sellToken:
Token
buyToken:
Token
sellAmount:
string
buyAmount:
string
nonce:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
any
>
get
All
Balance
get
All
Balance
(
address
:
string
, tickers
:
ITicker
[]
)
:
Promise
<
IBalances
[]
>
Parameters
address:
string
tickers:
ITicker
[]
Returns
Promise
<
IBalances
[]
>
get
Available
Token
get
Available
Token
(
forLogo
?:
false
)
:
Promise
<
ITicker
>
Parameters
Optional
forLogo:
false
Returns
Promise
<
ITicker
>
get
Available
Token
Decimals
get
Available
Token
Decimals
(
forLogo
?:
false
)
:
Promise
<
any
>
Parameters
Optional
forLogo:
false
Returns
Promise
<
any
>
getERC20
Info
getERC20
Info
(
address
:
string
)
:
Promise
<
ITicker
>
Parameters
address:
string
Returns
Promise
<
ITicker
>
get
Exchange
Estimation
get
Exchange
Estimation
(
sellToken
:
Token
, buyToken
:
Token
, sellAmount
:
string
)
:
Promise
<
string
>
Parameters
sellToken:
Token
buyToken:
Token
sellAmount:
string
Returns
Promise
<
string
>
get
Licence
Price
InZone
get
Licence
Price
InZone
(
geohash6
:
string
)
:
Promise
<
string
>
Parameters
geohash6:
string
Returns
Promise
<
string
>
get
Open
Bid
get
Open
Bid
(
address
:
string
)
:
Promise
<
any
>
Parameters
address:
string
Returns
Promise
<
any
>
get
Shop
ByAddress
get
Shop
ByAddress
(
shopAddress
:
string
)
:
Promise
<
IShop
>
Parameters
shopAddress:
string
Returns
Promise
<
IShop
>
get
Shop
ByPosition
get
Shop
ByPosition
(
geohash12
:
string
)
:
Promise
<
IShop
>
Parameters
geohash12:
string
Returns
Promise
<
IShop
>
get
Shops
InZone
get
Shops
InZone
(
geohash6
:
string
)
:
Promise
<
IShop
[]
>
Parameters
geohash6:
string
Returns
Promise
<
IShop
[]
>
get
Shops
InZones
get
Shops
InZones
(
geohash6List
:
string
[]
)
:
Promise
<
IShop
[]
[]
>
Parameters
geohash6List:
string
[]
Returns
Promise
<
IShop
[]
[]
>
get
Teller
get
Teller
(
address
:
string
)
:
Promise
<
any
>
Parameters
address:
string
Returns
Promise
<
any
>
get
Teller
InZone
get
Teller
InZone
(
geohash6
:
string
)
:
Promise
<
any
>
Parameters
geohash6:
string
Returns
Promise
<
any
>
get
Tellers
InZones
get
Tellers
InZones
(
geohash6List
:
string
[]
)
:
Promise
<
any
[]
>
Parameters
geohash6List:
string
[]
Returns
Promise
<
any
[]
>
get
Token
Liquidity
get
Token
Liquidity
(
tokenAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
any
>
Parameters
tokenAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
any
>
get
Transaction
Status
get
Transaction
Status
(
txHash
:
string
)
:
Promise
<
TransactionStatus
>
Parameters
txHash:
string
Returns
Promise
<
TransactionStatus
>
get
Zone
ByAddress
get
Zone
ByAddress
(
address
:
string
)
:
Promise
<
IZone
>
Parameters
address:
string
Returns
Promise
<
IZone
>
get
Zone
ByGeohash
get
Zone
ByGeohash
(
geohash6
:
string
)
:
Promise
<
IZone
>
Parameters
geohash6:
string
Returns
Promise
<
IZone
>
get
Zones
Status
get
Zones
Status
(
geohash6List
:
string
[]
)
:
Promise
<
any
[]
>
Parameters
geohash6List:
string
[]
Returns
Promise
<
any
[]
>
has
Approval
has
Approval
(
owner
:
string
, sellToken
:
Token
, amount
:
string
)
:
Promise
<
boolean
>
Parameters
owner:
string
sellToken:
Token
amount:
string
Returns
Promise
<
boolean
>
Private
has
Provider
has
Provider
(
)
:
void
Returns
void
Private
has
Wallet
has
Wallet
(
)
:
void
Returns
void
init
init
(
connectOptions
?:
IEthersOptions
)
:
Promise
<
void
>
Parameters
Optional
connectOptions:
IEthersOptions
Returns
Promise
<
void
>
init
Provider
init
Provider
(
connectOptions
?:
IEthersOptions
)
:
Promise
<
void
>
Parameters
Optional
connectOptions:
IEthersOptions
Returns
Promise
<
void
>
is
Bidder
Onthis
Auction
is
Bidder
Onthis
Auction
(
zoneAddress
:
string
, ethAddress
:
string
, auctionID
:
number
)
:
Promise
<
number
>
Parameters
zoneAddress:
string
ethAddress:
string
auctionID:
number
Returns
Promise
<
number
>
is
Teller
is
Teller
(
address
:
string
)
:
Promise
<
any
>
Parameters
address:
string
Returns
Promise
<
any
>
is
Zone
Opened
is
Zone
Opened
(
geohash6
:
string
, country
:
string
)
:
Promise
<
Boolean
>
Parameters
geohash6:
string
country:
string
Returns
Promise
<
Boolean
>
is
Zone
Owned
is
Zone
Owned
(
geohash6
:
string
)
:
Promise
<
Boolean
>
Parameters
geohash6:
string
Returns
Promise
<
Boolean
>
is
Zone
Owner
is
Zone
Owner
(
address
:
string
)
:
Promise
<
any
>
Parameters
address:
string
Returns
Promise
<
any
>
load
User
load
User
(
encryptedWallet
:
string
)
:
void
Parameters
encryptedWallet:
string
Returns
void
Private
load
Wallet
load
Wallet
(
password
?:
string
)
:
Promise
<
Wallet
>
Parameters
Optional
password:
string
Returns
Promise
<
Wallet
>
process
State
process
State
(
password
:
string
, zoneAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
release
Zone
release
Zone
(
password
:
string
, geohash6
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
remove
Shop
remove
Shop
(
password
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
remove
Teller
remove
Teller
(
password
:
string
, zoneGeohash
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneGeohash:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
send
Crypto
send
Crypto
(
password
:
string
, toAddress
:
string
, token
:
Token
, amount
:
string
, tokenAddress
?:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
toAddress:
string
token:
Token
amount:
string
Default value
tokenAddress:
string
= constants.ADDRESS_ZERO
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
set
Custom
Contract
Addresses
set
Custom
Contract
Addresses
(
contractAddresses
:
any
)
:
Promise
<
void
>
Parameters
contractAddresses:
any
Returns
Promise
<
void
>
set
Shop
Licence
Price
set
Shop
Licence
Price
(
password
:
string
, geohash6
:
string
, newPrice
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
newPrice:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
shop
Exists
ByAddress
shop
Exists
ByAddress
(
shopAddress
:
string
)
:
Promise
<
boolean
>
Parameters
shopAddress:
string
Returns
Promise
<
boolean
>
sign
Message
sign
Message
(
password
:
string
, message
:
string
)
:
Promise
<
string
>
Parameters
password:
string
message:
string
Returns
Promise
<
string
>
top
UpShop
top
UpShop
(
password
:
string
, topUpAmount
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
topUpAmount:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
top
UpZone
top
UpZone
(
password
:
string
, geohash6
:
string
, topUpAmount
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
topUpAmount:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
update
Teller
update
Teller
(
password
:
string
, tellerData
:
ITellerArgs
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
tellerData:
ITellerArgs
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Auctions
Raw
withdraw
Auctions
Raw
(
password
:
string
, zoneAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Auction
Bid
withdraw
Zone
Auction
Bid
(
password
:
string
, geohash6
:
string
, auctionId
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
auctionId:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Auction
Bid
Address
withdraw
Zone
Auction
Bid
Address
(
password
:
string
, zoneAddress
:
string
, auctionId
:
number
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneAddress:
string
auctionId:
number
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Auctions
Bid
withdraw
Zone
Auctions
Bid
(
password
:
string
, geohash6
:
string
, auctionIds
:
number
[]
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
auctionIds:
number
[]
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Auctions
Bid
Address
withdraw
Zone
Auctions
Bid
Address
(
password
:
string
, zoneAddress
:
string
, auctionIds
:
number
[]
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneAddress:
string
auctionIds:
number
[]
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Owner
Dth
withdraw
Zone
Owner
Dth
(
password
:
string
, geohash6
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
geohash6:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
withdraw
Zone
Owner
Dth
Address
withdraw
Zone
Owner
Dth
Address
(
password
:
string
, zoneAddress
:
string
, txOptions
?:
ITxOptions
)
:
Promise
<
ContractTransaction
>
Parameters
password:
string
zoneAddress:
string
Default value
txOptions:
ITxOptions
= constants.DEFAULT_TX_OPTIONS
Returns
Promise
<
ContractTransaction
>
Globals
Internals
"dether"
Externals
"constants"
"core/exchanges/base"
"core/exchanges/index"
"core/exchanges/uniswap"
"core/shop"
"core/teller"
"core/util"
"core/wallet"
"core/zone"
"helpers/contracts"
"helpers/convert"
"helpers/providers"
"helpers/util"
"helpers/validate"
"types"
DetherJS
constructor
dth
Contract
encrypted
Wallet
geo
Registry
Contract
network
provider
shops
Contract
using
Metamask
zone
Factory
Contract
add
Shop
add
Teller
add
Teller
Comment
approve
Token
bid
Zone
claim
Free
Zone
collect
Shop
Taxes
create
Zone
delete
User
Shop
exec
Exchange
exec
Exchange
From
Sell
exec
Exchange_
delayed
get
All
Balance
get
Available
Token
get
Available
Token
Decimals
getERC20
Info
get
Exchange
Estimation
get
Licence
Price
InZone
get
Open
Bid
get
Shop
ByAddress
get
Shop
ByPosition
get
Shops
InZone
get
Shops
InZones
get
Teller
get
Teller
InZone
get
Tellers
InZones
get
Token
Liquidity
get
Transaction
Status
get
Zone
ByAddress
get
Zone
ByGeohash
get
Zones
Status
has
Approval
has
Provider
has
Wallet
init
init
Provider
is
Bidder
Onthis
Auction
is
Teller
is
Zone
Opened
is
Zone
Owned
is
Zone
Owner
load
User
load
Wallet
process
State
release
Zone
remove
Shop
remove
Teller
send
Crypto
set
Custom
Contract
Addresses
set
Shop
Licence
Price
shop
Exists
ByAddress
sign
Message
top
UpShop
top
UpZone
update
Teller
withdraw
Auctions
Raw
withdraw
Zone
Auction
Bid
withdraw
Zone
Auction
Bid
Address
withdraw
Zone
Auctions
Bid
withdraw
Zone
Auctions
Bid
Address
withdraw
Zone
Owner
Dth
withdraw
Zone
Owner
Dth
Address
Generated using
TypeDoc
This is the main detherJS object You can Use it like this