Documentation

Class: DetherJS

On detherJS, there are three main types of functions.

  • Functions for the zoning system: they represent all the functions needed for zone management.
  • Functions for tellers: they represent all the functions needed for adding, removing and updating your teller.
  • Functions for shops: they represent all the functions needed for adding, removing, and managing your shop.

Methods for the zoning system

Methods for tellers

All functions for managing a teller’s lifecycle. You need to own the zone where you want to add a teller. When you add a teller, ~15% of what you stake in DTH will be taken out annually as taxes (based on the Harberger tax principle).

Methods for shops

All functions for managing a shop’s lifecycle are presented here. If you add a shop on a zone which is already owned by someone, you'll pay the zone owner 1/42th of what you staked in DTH daily.

Other methods

Method for the zoning system

createZone

This represents the function you need to call before being able to add a teller on a zone. You must stake DTH tokens to own a zone. ~15% of what you stake in DTH will be taken out annually as taxes (based on the Harberger taxes principles).

createZone(password: string, country: string, geohash6: string, amount: number, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:589

Parameters:

NameTypeValue
passwordstringPassword of your wallet
countrystringISO 2 country code (https://www.iban.com/country-codes)
geohash6string6 character geohash of the zone you want to create
amountnumberAmount of DTH you want to stake on the zone (minimum 100 DTH), the address doing the transaction must have the DTH on its address
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›

See example on addTellersAndShops.js

bidZone

If a zone is already owned by someone and you want to operate on it as a teller, you must first become the zone owner. As a result, you need to bid more than the current owner. Once you’ve bid, a 48 hour auction will open and the current zone owner or any other participant will be able to bid to win the auction and become the new zone owner. The participant that bids the highest amount of DTH at the end of the 48 hour auction will become the zone owner.

bidZone(password: string, geohash6: string, bidAmount: number, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:627

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 character geohash of the zone you want to bid
bidAmountnumberAmount of DTH you want to bid. Must be superior than the current amount of DTH staked on the zone
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›

See example in dether.spec.ts


claimFreeZone

A zone that was previously owned by someone but that is not anymore is now considered as a 'free zone'. Execute this function to own it: you will need to stake at least 100 DTH to own it. ~15% of what you stake in DTH will be taken out annually as taxes (based on the Harberger taxes principles).

claimFreeZone(password: string, geohash6: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:610

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 character geohash of the zone you want to claim
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›

See example in dether.spec.ts


setShopLicencePrice

When you own a zone, you can collect fees in DTH from shops located on your zone. By default, shops must stake 42 DTH to add their shop. You can collect 1/42th of that amount on a daily basis. As the zone owner, you also have the ability to increase this minimum staking price of 42 DTH to whatever amount of DTH you want. This new licence price will only apply to new shops registering on your zone.

setShopLicencePrice(password: string, geohash6: string, newPrice: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:466

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
newPricestringNew price in DTH for shops willing to add their shop on your zone (minimum 42)
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


collectShopTaxes

Function to execute when you want to collect the fees from the shops located on your zone. To call this function, you need to know how many shops are located on you zone. You will need to call detherJS.getShopsInZones() in order to do so.

collectShopTaxes(password: string, geohash6: string, start: number, end: number, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:501

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
startnumberO (or bigger amount if there are too many shops on your zone for gas transaction)
endnumberAmount of shops present on you zone - 1 (or less number if there are too many shops on your zone for gas transaction)
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


deleteUserShop

As a zone owner, you have the ability to delete a shop located on your zone.

deleteUserShop(password: string, geohash6: string, shopAddress: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:521

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
shopAddressstringEthereum address of the shop owner
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


processState

processState is a smart contract function that updates the zone contract state (owner, current bid, Harberger taxes, etc ...). It automatically executes on each action on the zone (bid, create, delete, collectShopTaxes...), but you may have other reasons to call it on your own.

processState(password: string, zoneAddress: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:785

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneAddressstring
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


releaseZone

Execute this function if you want to get rid of the ownership of the zone you own. You'll get your staked DTH back, minus the fees paid for the Harberger taxes.

releaseZone(password: string, geohash6: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:665

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


topUpZone

As a zone owner you'll pay annually around ~15% of what you stake in DTH to the protocol as taxes (based on the Harberger tax principles). If the amount of staked DTH on your zone reaches zero, your zone becomes a free zone that anyone can claim. Thus, you need top up your zone in DTH before then in order to avoid losing your ownership on the zone.

topUpZone(password: string, geohash6: string, topUpAmount: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:646

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
topUpAmountstringamount of DTH you want to top up
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


withdrawAuctionsRaw

After participating in a zone auction and losing the auction, you'll need to manually withdraw the DTH you have staked to bid for that zone. This function will withdraw all DTH tokens you have bid on this zone.

withdrawAuctionsRaw(password: string, zoneAddress: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:745

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneAddressstringEthereum address of the zone you want to withdraw on
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


withdrawZoneAuctionBid

After participating in a zone auction and losing the auction, you'll need to manually withdraw the DTH you have staked when bidding for that zone. This function will withdraw the DTH on the auction ID that you'll pass as arguments.

withdrawZoneAuctionBid(password: string, geohash6: string, auctionId: number, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:676

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
auctionIdnumberId of the auction you want to withdraw on
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


withdrawZoneAuctionBidAddress

After participating in a zone auction and losing the auction, you'll need to manually withdraw the DTH you have staked when bidding for that zone. This function will withdraw DTH on the auction ID that you'll pass as arguments.

withdrawZoneAuctionBidAddress(password: string, zoneAddress: string, auctionId: number, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:728

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneAddressstringEthereum address of the zone you want to withdraw on
auctionIdnumberId of the auction you want to withdraw on
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


withdrawZoneAuctionsBid

After participating in a zone auction and losing the auction, you'll need to manually withdraw the DTH you have staked when bidding for that zone. This function will withdraw DTH on the auction ID's that you'll pass as arguments.

withdrawZoneAuctionsBid(password: string, geohash6: string, auctionIds: number[], txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:694

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
auctionIdsnumber[]Array of Id's of the auction you want to withdraw on
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


withdrawZoneAuctionsBidAddress

After participating in a zone auction and losing the auction, you'll need to manually withdraw the DTH you have staked when bidding for that zone. This function will withdraw DTH on the auction ID's you'll pass as arguments.

withdrawZoneAuctionsBidAddress(password: string, zoneAddress: string, auctionIds: number[], txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:757

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneAddressstringEthereum address of the zone you want to withdraw on
auctionIdsnumber[]Array of Id's of the auction you want to withdraw on
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


withdrawZoneOwnerDth

Execute this function when you lose an auction as a zone owner in order to get your DTH tokens back.

withdrawZoneOwnerDth(password: string, geohash6: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:712

Parameters:

NameTypeValue
passwordstringPassword of your wallet
geohash6string6 characters geohash of your zone
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


withdrawZoneOwnerDthAddress

Execute this function when you lose an auction as a zone owner in order to get your DTH tokens back.

withdrawZoneOwnerDthAddress(password: string, zoneAddress: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:774

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneAddressstringEthereum address of the zone you want to withdraw on
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


getOpenBid

Get current opened bids on the zone

getOpenBid(address: string): Promise‹any›

Defined in dether.ts:806

Parameters:

NameType
addressstring

Returns: Promise‹any›


getZoneByAddress

Get the zone

getZoneByAddress(address: string): Promise‹[IZone](../interfaces/_types.izone.md)›_

Defined in dether.ts:561

Parameters:

NameType
addressstring

Returns: Promise‹[IZone](../interfaces/_types.izone.md)›_

See example on getTellersAndShops.js


getZoneByGeohash

Get the zone

getZoneByGeohash(geohash6: string): Promise‹[IZone](../interfaces/_types.izone.md)›_

Defined in dether.ts:552

Parameters:

NameType
geohash6string

Returns: Promise‹[IZone](../interfaces/_types.izone.md)›_

See example on getTellersAndShops.js


getZonesStatus

Get multiple zones

getZonesStatus(geohash6List: string[]): Promise‹any[]›

Defined in dether.ts:566

Parameters:

NameType
geohash6Liststring[]

Returns: Promise‹any[]›


isBidderOnthisAuction

Does this Ethereum address have any bid on this auction?

isBidderOnthisAuction(zoneAddress: string, ethAddress: string, auctionID: number): Promise‹number›

Defined in dether.ts:575

Parameters:

NameType
zoneAddressstring
ethAddressstring
auctionIDnumber

Returns: Promise‹number›


isZoneOpened

Is this zone already opened (is owned, or was already owned once)?

isZoneOpened(geohash6: string, country: string): Promise‹Boolean›

Defined in dether.ts:796

Parameters:

NameType
geohash6string
countrystring

Returns: Promise‹Boolean›


isZoneOwned

Is this zone is owned?

isZoneOwned(geohash6: string): Promise‹Boolean›

Defined in dether.ts:547

Parameters:

NameType
geohash6string

Returns: Promise‹Boolean›


isZoneOwner

Is this Ethereum address a zone owner?

isZoneOwner(address: string): Promise‹any›

Defined in dether.ts:801

Parameters:

NameType
addressstring

Returns: Promise‹any›


Method for tellers

addTeller

Add a teller on a zone. Prerequisite: you must own the zone where you want to add the teller.

addTeller(password: string, tellerData: ITellerArgs, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:337

Parameters:

NameTypeValue
passwordstringPassword of your wallet
tellerDataITellerArgsArguments of the teller you want to add
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›

See example on addTellersAndShops.js


addTellerComment

Add on-chain comments about the teller. You must only enter the hash of the comment which must be stored on IPFS. NOTE: You must do the IPFS task on your own. This library does not support it for now.

addTellerComment(password: string, zoneGeohash: string, ipfsHash: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:385

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneGeohashstringZone's teller where you want to let your comments ont
ipfsHashstringIpfs hash, where is stored the comments
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


removeTeller

Execute this function if you want to remove your teller from a zone.

removeTeller(password: string, zoneGeohash: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:353

Parameters:

NameTypeValue
passwordstringPassword of your wallet
zoneGeohashstringZone's teller
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


updateTeller

Execute this function if you want to update your teller’s information. You must pass an entire ITellerArgs object as arguments.

updateTeller(password: string, tellerData: ITellerArgs, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:369

Parameters:

NameTypeValue
passwordstringPassword of your wallet
tellerDataITellerArgsNew teller value
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


getTeller

Get a teller by its address

getTeller(address: string): Promise‹any›

Defined in dether.ts:313

Parameters:

NameType
addressstring

Returns: Promise‹any›

/* currency id
1 => 'USD'
2 => 'EUR'
3 => 'THB'
4 => 'MXN'
5 => 'NGN'
6 => 'UAH'
7 => 'INR'
8 => 'PHP'
9 => 'VND'
10 => 'AUD'
11 => 'JPY'
12 => 'CAD'
13 => 'RUB'
14 => 'KRW'
15 => 'GBP'
16 => 'IDR'
17 => 'HKD'
18 => 'CHF'
19 => 'MYR'
20 => 'KES'
21 => 'PKR'
22 => 'DKK'
23 => 'TZS'
24 => 'ZAR'
25 => 'PLN'
26 => 'HTG'
27 => 'CZK'
28 => 'RON'
29 => 'SEK'
*/
import DetherJS from "../lib/dether";
require("dotenv").config();
const INFURA_KEY = process.env.INFURA_KEY;
const rpcURL = `https://kovan.infura.io/v3/${INFURA_KEY}`;
const detherJs = new DetherJS(false);
const exampleGetTeller = async () => {
await detherJs.init({ rpcURL });
const teller = await detherJs.getTeller(
"0x907f3400F9f12EFCD160f387B5AF317B640fD6c2"
);
console.log(teller);
};
exampleGetTeller();
{
isSeller: true, // true if you want to sell cryptocurrency
isBuyer: true, // true if you want to buy cryptocurrency
currencyId: 1, // 1 for USD (see the full list below)
tellerGeohash: 'sr2y7v7zz524', // 12 characters geohash to define tellers position
zoneAddress: '0x8fc629D0A2575F57a6D7c49D62B441209183f955', // zone contract address
zoneGeohash: 'sr2y7v', // 6 characters geoash to define a square representing zone
buyRate: 4, // fees you want to take for buying crypto 4%
sellRate: 3, // fees you want to take for selling crypto
referrer: undefined, // address of the referrer of the teller OR undefined if no referrer
messenger: undefined, // telegram nickname the teller want to be contacted on or undefined if not entered when registered
tellerAddress: '0x907f3400F9f12EFCD160f387B5AF317B640fD6c2', // teller's |ethereum address
tellerContractAddress: '0x79755785e98446F30F6Cf388f2E70c58f6A3C993', // teller's contract address
sellUp: '1000', // max amount the teller is able to sell
buyUp: '2000', // max amount the teller is able to buy
ticker: 'BTC' // list of other crypto tickers the teller is able to sell, you can have multiple tickers BTC/XMR/BCH
}

See example on getTellersAndShops.js


getTellerInZone

Get teller by its zone address.

getTellerInZone(geohash6: string): Promise‹any›

Defined in dether.ts:318

Parameters:

NameType
geohash6string

Returns: Promise‹any›

See example on getTellersAndShops.js


getTellersInZones

Get tellers from multiple zones.

getTellersInZones(geohash6List: string[]): Promise‹any[]›

Defined in dether.ts:327

Parameters:

NameType
geohash6Liststring[]

Returns: Promise‹any[]›


isTeller

Discover if an Ethereum address is a teller in detherContract.

isTeller(address: string): Promise‹any›

Defined in dether.ts:308

Parameters:

NameType
addressstring

Returns: Promise‹any›


Method for shops

addShop

Add a shop.

addShop(password: string, shopData: IShopArgs, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:438

Parameters:

NameTypeValue
passwordstringPassword of your wallet
shopDataIShopArgsparams of the shop you want to add
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›

See example on addTellersAndShops.js


removeShop

Remove your shop. You will get your DTH back, minus what you have potentially paid as fees to the potential zone owner.

removeShop(password: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:456

Parameters:

NameTypeValue
passwordstringPassword of your wallet
txOptionsITxOptionsTransaction options args. By defaults (constants.DEFAULT_TX_OPTIONS)

Returns: Promise‹ContractTransaction›


topUpShop

If there is a zone owner, you'll need to pay taxes in DTH on a daily basis to the zone owner. Everyday, you will pay 1/42th of what you staked in DTH. If the amount DTH you have staked reaches zero, your shop could be deleted.

topUpShop(password: string, topUpAmount: string, txOptions: ITxOptions): Promise‹ContractTransaction›

Defined in dether.ts:484

Parameters:

NameTypeValue
passwordstringPassword of your wallet
topUpAmountstringAmount of DTH you want to add on your shop
txOptionsITxOptionsconstants.DEFAULT_TX_OPTIONS

Returns: Promise‹ContractTransaction›


getShopByAddress

Get shop.

getShopByAddress(shopAddress: string): Promise‹[IShop](../interfaces/_types.ishop.md)›_

Defined in dether.ts:412

Parameters:

NameType
shopAddressstring

Returns: Promise‹[IShop](../interfaces/_types.ishop.md)›_

See example on getTellersAndShops.js


getShopByPosition

Get shop.

getShopByPosition(geohash12: string): Promise‹[IShop](../interfaces/_types.ishop.md)›_

Defined in dether.ts:417

Parameters:

NameType
geohash12string

Returns: Promise‹[IShop](../interfaces/_types.ishop.md)›_


getShopsInZone

Get all shops located on a zone.

getShopsInZone(geohash6: string): Promise‹[IShop](../interfaces/_types.ishop.md)[]›_

Defined in dether.ts:422

Parameters:

NameType
geohash6string

Returns: Promise‹[IShop](../interfaces/_types.ishop.md)[]›_


getShopsInZones

Get all shops located on multiple zones.

getShopsInZones(geohash6List: string[]): Promise‹[IShop](../interfaces/_types.ishop.md)[][]›_

Defined in dether.ts:428

Parameters:

NameType
geohash6Liststring[]

Returns: Promise‹[IShop](../interfaces/_types.ishop.md)[][]›_


shopExistsByAddress

Does this address own a shop?

shopExistsByAddress(shopAddress: string): Promise‹boolean›

Defined in dether.ts:407

Parameters:

NameType
shopAddressstring

Returns: Promise‹boolean›


getLicencePriceInZone

Get the amount of DTH to stake to add a shop on that zone. If the zone is owned by someone, and if you add a shop on this zone, you'll pay a daily fee of 1/42th of what you staked in DTH to the zone owner.

getLicencePriceInZone(geohash6: string): Promise‹string›

Defined in dether.ts:433

Parameters:

NameType
geohash6string

Returns: Promise‹string›


other methods

init

init(connectOptions?: IEthersOptions): Promise‹void›

Defined in dether.ts:49

Parameters:

NameType
connectOptions?IEthersOptions

Returns: Promise‹void›


initProvider

initProvider(connectOptions?: IEthersOptions): Promise‹void›

Defined in dether.ts:91

Parameters:

NameType
connectOptions?IEthersOptions

Returns: Promise‹void›


isBidderOnthisAuction

isBidderOnthisAuction(zoneAddress: string, ethAddress: string, auctionID: number): Promise‹number›

Defined in dether.ts:575

Parameters:

NameType
zoneAddressstring
ethAddressstring
auctionIDnumber

Returns: Promise‹number›


isZoneOpened

isZoneOpened(geohash6: string, country: string): Promise‹Boolean›

Defined in dether.ts:796

Parameters:

NameType
geohash6string
countrystring

Returns: Promise‹Boolean›


isZoneOwned

isZoneOwned(geohash6: string): Promise‹Boolean›

Defined in dether.ts:547

Parameters:

NameType
geohash6string

Returns: Promise‹Boolean›


isZoneOwner

isZoneOwner(address: string): Promise‹any›

Defined in dether.ts:801

Parameters:

NameType
addressstring

Returns: Promise‹any›


loadUser

loadUser(encryptedWallet: string): void

Defined in dether.ts:98

Parameters:

NameType
encryptedWalletstring

Returns: void


Private loadWallet

loadWallet(password?: string): Promise‹Wallet›

Defined in dether.ts:106

Parameters:

NameType
password?string

Returns: Promise‹Wallet›


Interface

ITeller

Object representing a teller with all its information

/* currency id
1 => 'USD'
2 => 'EUR'
3 => 'THB'
4 => 'MXN'
5 => 'NGN'
6 => 'UAH'
7 => 'INR'
8 => 'PHP'
9 => 'VND'
10 => 'AUD'
11 => 'JPY'
12 => 'CAD'
13 => 'RUB'
14 => 'KRW'
15 => 'GBP'
16 => 'IDR'
17 => 'HKD'
18 => 'CHF'
19 => 'MYR'
20 => 'KES'
21 => 'PKR'
22 => 'DKK'
23 => 'TZS'
24 => 'ZAR'
25 => 'PLN'
26 => 'HTG'
27 => 'CZK'
28 => 'RON'
29 => 'SEK'
*/
{
isSeller: true, // true if you want to sell cryptocurrency
isBuyer: true, // true if you want to buy cryptocurrency
currencyId: 1, // 1 for USD (see the full list below)
tellerGeohash: "sr2y7v7zz524", // 12 characters geohash to define tellers position
zoneAddress: "0x8fc629D0A2575F57a6D7c49D62B441209183f955", // zone contract address
zoneGeohash: "sr2y7v", // 6 characters geoash to define a square representing zone
buyRate: 4, // fees you want to take for buying crypto 4%
sellRate: 3, // fees you want to take for selling crypto
referrer: undefined, // address of the referrer of the teller OR undefined if no referrer
messenger: undefined, // telegram nickname the teller want to be contacted on or undefined if not entered when registered
tellerAddress: "0x907f3400F9f12EFCD160f387B5AF317B640fD6c2", // teller's |ethereum address
tellerContractAddress: "0x79755785e98446F30F6Cf388f2E70c58f6A3C993", // teller's contract address
sellUp: "1000", // max amount the teller is able to sell
buyUp: "2000", // max amount the teller is able to buy
ticker: "BTC", // list of other crypto tickers the teller is able to sell, you can have multiple tickers BTC/XMR/BCH
};

Defined in types.ts:35

buyRate: number

currencyId: number

isBuyer: boolean

isSeller: boolean

sellRate: number

tellerAddress: string

tellerContractAddress: string

tellerGeohash: string

zoneAddress: string

zoneGeohash: string

ticker? : string

messenger? : string

refFees? : number

referrer? : string

buyUp? : string

sellUp? : string


ITellerArgs

Object to add as a parameter for adding a teller on the map.

/* currency id
1 => 'USD'
2 => 'EUR'
3 => 'THB'
4 => 'MXN'
5 => 'NGN'
6 => 'UAH'
7 => 'INR'
8 => 'PHP'
9 => 'VND'
10 => 'AUD'
11 => 'JPY'
12 => 'CAD'
13 => 'RUB'
14 => 'KRW'
15 => 'GBP'
16 => 'IDR'
17 => 'HKD'
18 => 'CHF'
19 => 'MYR'
20 => 'KES'
21 => 'PKR'
22 => 'DKK'
23 => 'TZS'
24 => 'ZAR'
25 => 'PLN'
26 => 'HTG'
27 => 'CZK'
28 => 'RON'
29 => 'SEK'
*/
const TELLER_ARGS = {
buyRate: 334, // amount you want to take for fees when you buy crypto * 100, 334 => 3.34%
sellRate: 177, // amount you want to take for fees when you buy crypto * 100, 177 => 1.17%
currencyId: 1, // currency you want to trade with 1 => dollar (see below)
description: "1000-500-BTC/XMR/DOGE", // template for following params sellAmount-buyAmount-tickers
// sellAmount = max amount you are able to sell in your currency. ex: 1000
// buyAmount = max amount you are able to buy in your currency? ex: 500
// tickers = list of tickers you are able to sell. ex: BTC/XMR/DOGE
isBuyer: true, // if you want to be a buyer
isSeller: true, // if you want to be a seller
messenger: "my_telegram_nick", // telegram nickname to be contacted on
position: "xngstsebcddd", // 12 chars geohash to be positioned on the map
referrer: "0x26F3d9f700111338092cd534126fb3832575aEA2", // address of your referrer (can be 0x)
refFees: 210, // if you have a referrer, it will be the fees he will take * 10 // should be inferior to 333
};

Defined in types.ts:54

buyRate? : number

currencyId? : number

description? : string

isBuyer: boolean

isSeller: boolean

messenger? : string

position: string

refFees? : number

referrer? : string

sellRate? : number


ITxOptions

Defined in types.ts:292

gasLimit? : number

gasPrice? : number

nonce? : number

value? : any


IZone

Defined in types.ts:86

address? : string (ethereum contract address of the zone)

auction? : [IZoneAuction](_types.izoneauction.md)_

geohash: string |Geohash of the zone|

owner? : [IZoneOwner](_types.izoneowner.md)_ (Owner of the zone)

status: [ZoneStatus](../enums/_types.zonestatus.md)_ (Status of the zone) Defined in types.ts:93


IZoneOwner

Defined in types.ts:86

address: string (Ethereum contract address of the zone)

auctionId: number (current highest auction ID on the zone)

balance: number (current balance of DTH staked on the zone)

lastTaxTime: number (timestamp where the zone was taxed last time)

staked: number (DTH staked at first when owner get the zone)

startTime: number (time when zone was created)


IZoneAuction

Object representing an auction

Defined in types.ts:69

endTime: number

highestBid: number

highestBidder: string

id: number

startTime: number

state: [ZoneAuctionState](../enums/_types.zoneauctionstate.md)_ *Defined in types.ts:62


IShopArgs

Defined in types.ts:257

category? : string |See the enum below|

country: string |Iso 2 code country https://www.iban.com/country-codes|

description? : string |Short description of the shop, must be < 32 char|

name? : string |Short description of the shop, must be < 16 char|

opening? : string |See the formatage below|

position: string |12 characters Geohash, representing where you want to locate your shop|

staking: string |How much do you want to stake for this shop (minimum 42 DTH)? If there is a zone owner, you will pay the zone owner 1/42th of the DTH you have staked on a daily basis.|

// category =
// opening =

Properties

Defined in dether.ts:38

dthContract: Contract

encryptedWallet: string

geoRegistryContract: Contract

network: any

provider: any

shopsContract: Contract

usingMetamask: boolean

zoneFactoryContract: Contract