Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dsd-client-conn-lib

Package Overview
Dependencies
Maintainers
1
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsd-client-conn-lib

Provides convenient way to call PDS server API of edzLabs.com's PDS service. Full API reference is located at [app.dase.io](https:*app.dase.io)

  • 3.7.9
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by2.56%
Maintainers
1
Weekly downloads
 
Created
Source

Description

Provides convenient way to call PDS server API of edzLabs.com's PDS service. Full API reference is located at app.dase.io

Examples

var CONN = require("dsd-client-conn-lib");
var dsdConn = CONN.connClient2;
var dsdCst = CONN.Consts;
//default host for all is "partner.dase.io"
//but you may specify different hosts and ports like that:
//dsdConn.setCoreServer({ host: "partner.dase.io", port: 5090 });
//dsdConn.setDaseServer({ host: "partner.dase.io", port: 5100 });
//dsdConn.setPdsServer({ host: "partner.dase.io", port: 5200 });
//dsdConn.setKeychainServer({ host: "partner.dase.io", port: 5110 });

function log(title, msg) {
    console.log(title, msg ? msg : "");
 }

log("sendSilver should success");

dsdConn.getCoreClient().sendSilver({
    senderId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
    senderPassword: "12345678",
    silverAmount: 100,
    toUserId: "0xb35ef3e31f2944d252eda42801caf5d890d1d7f9"
}).then(
    ok => { log("sendSilver ok: ", ok); },
    err => { log("sendSilver err: ", err); }
);

log("sendSilver2 should error");

dsdConn.getDaseClient().sendSilver({
    senderId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
    senderPassword: "12345678",
    toUserId: "0xb35ef3e31f2944d252eda42801caf5d890d1d7f9"
}).then(
    ok => { log("sendSilver2 ok: ", ok); },
    err => {
        log("sendSilver2 err: ", err);

        //specify error handlers if necessary
        if(err.code === dsdCst.errorCodes.WrongParametersCount.id) {
            log("I have wrong parameters count..."+dsdCst.errorCodes.WrongParametersCount.name);
            //do something
        }
        else if(err.code === dsdCst.errorCodes.ServerSideError.id) {
            log("I have server error..."+ dsdCst.errorCodes.ServerSideError.name);
            //do something
        }
    }
);


console.log("addDab should success");

dsdConn.getPdsClient().addDab({
    ownerId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
    assetUrl: "http:*localhost",
    ownerPassword: "12345678",
    publicDescription: "new client lib asset"
}).then(
    ok => { log("addDab ok: ", ok); },
    err => { log("addDab err: ", err); }
);

API reference

Core API methods here

DASE API methods here

PDS API methods here

Keychain API methods here

Deprecated API

Core API methods here

DASE API methods here

PDS API methods here

Keychain API methods here

CORE API methods

(Back)

Functions

newUser(bchainTypeCode, credentials)Keys

Description: Method newUser

getLastBlock(bchainTypeCode)Integer

Description: Method getLastBlock

getTimestamps(bchainTypeCode, blocksNumbers)Array_of_Integer

Description: Method getTimestamps

getBlocks(bchainTypeCode, blocksNumbers)Array_of_Object

Description: Method getBlocks

sendLeos(currencyTypeCode, senderId, senderCredentials, amount, toUserId)Integer

Description: Method sendLeos

transfer(srcCurrencyTypeCode, senderId, senderCredentials, srcLeosAmount)Integer

Description: Method transfer

silverCostInGold(userId, silverLeosAmount)Integer

Description: Method silverCostInGold

goldCostInSilver(userId, goldLeosAmount)Integer

Description: Method goldCostInSilver

completeAppCashProductPurchase(userId, paymentInfo, engineName)Integer

Description: Method completeAppCashProductPurchase

getAppCashProducts(appId, engineName)Object

Description: Method getAppCashProducts

sendWeis_Ethereum(sender, senderCredentials, receiver, weisAmount, databytes)Integer

Description: Method sendWeis_Ethereum

getSystemAccounts()Object

Description: Method getSystemAccounts

getBalances(zetUserId, ethUserId, pgnUserId, flwUserId)Object

Description: Method getBalances

v_getEligibilityValue(userId)Integer

Description: Method v_getEligibilityValue

v_wantVote(userId, userCredentials, iWish)Boolean

Description: Method v_wantVote

v_supportVoter(userId, userCredentials, voterToSupport)Boolean

Description: Method v_supportVoter

v_getAccountsByCoinbases(coinbases)Array_of_Address

Description: Method v_getAccountsByCoinbases

v_getVoteCostInSilverLeos(userId)Integer

Description: Method v_getVoteCostInSilverLeos

v_getContractVoters(userId)Array_of_Address

Description: Method v_getContractVoters

v_getQuorumVoters()Array_of_Address

Description: Method v_getQuorumVoters

v_getCandidatesPool(userId)Array_of_Address

Description: Method v_getCandidatesPool

v_isInCandidatesPool(userId)Boolean

Description: Method v_isInCandidatesPool

v_hasPledge(userId)Boolean

Description: Method v_hasPledge

v_isLicensedForVoting(userId)Boolean

Description: Method v_isLicensedForVoting

getMyCoinbase()Address

Description: Method getMyCoinbase

v_withdrawPledge(userId, userCredentials)Boolean

Description: Method v_withdrawPledge

v_offerBuyVoting(userId, userCredentials, silverLeosAmount)Boolean

Description: Method v_offerBuyVoting

offerCurrencyExchangeGoldForWeis(sellerId, sellerCredentials, buyerId, goldLeosAmount, weisAmount)Boolean

Description: Method offerCurrencyExchangeGoldForWeis

offerCurrencyExchangeWeisForGold(sellerId, sellerCredentials, buyerId, goldLeosAmount, weisAmount)Boolean

Description: Method offerCurrencyExchangeWeisForGold

cancelCurrencyExchangeOffer(sellerId, sellerCredentials, offerId)Boolean

Description: Method cancelCurrencyExchangeOffer

getCurrencyExchangeOffers(userId, offersIds)Array_of_Object

Description: Method getCurrencyExchangeOffers

acceptCurrencyExchangeGoldForWeisOffer(buyerId, buyerCredentials, offerId, goldLeosAmount)Boolean

Description: Method acceptCurrencyExchangeGoldForWeisOffer

acceptCurrencyExchangeWeisForGoldOffer(buyerId, buyerCredentials, offerId, weisAmount)Boolean

Description: Method acceptCurrencyExchangeWeisForGoldOffer

rejectCurrencyExchangeOffer(buyerId, buyerCredentials, offerId)Boolean

Description: Method rejectCurrencyExchangeOffer

getCurrencyExchangeOffersIdsToMe(userId, pos, size)Array_of_Integer

Description: Method getCurrencyExchangeOffersIdsToMe

getCurrencyExchangeOffersCountToMe(userId)Integer

Description: Method getCurrencyExchangeOffersCountToMe

getCurrencyExchangeTradeHistory(tradeTypeCode, userId, startBlock)Array_of_Event

Description: Method getCurrencyExchangeTradeHistory

offerTokenExchangeGoldForPnft(sellerId, sellerCredentials, buyerId, goldLeosAmount, pnftId)Boolean

Description: Method offerTokenExchangeGoldForPnft

offerTokenExchangePnftForGold(sellerId, sellerCredentials, buyerId, goldLeosAmount, pnftId)Boolean

Description: Method offerTokenExchangePnftForGold

cancelTokenExchangeOffer(sellerId, sellerCredentials, offerId)Boolean

Description: Method cancelTokenExchangeOffer

getTokenExchangeOffers(userId, offersIds)Array_of_Object

Description: Method getTokenExchangeOffers

acceptTokenExchangeGoldForPnftOffer(buyerId, buyerCredentials, offerId, goldLeosAmount)Boolean

Description: Method acceptTokenExchangeGoldForPnftOffer

acceptTokenExchangePnftForGoldOffer(buyerId, buyerCredentials, offerId, pnftId)Boolean

Description: Method acceptTokenExchangePnftForGoldOffer

rejectTokenExchangeOffer(buyerId, buyerCredentials, offerId)Boolean

Description: Method rejectTokenExchangeOffer

getTokenExchangeOffersIdsToMe(userId, pos, size)Array_of_Integer

Description: Method getTokenExchangeOffersIdsToMe

getTokenExchangeOffersCountToMe(userId)Integer

Description: Method getTokenExchangeOffersCountToMe

getTokenExchangeTradeHistory(tradeTypeCode, userId, startBlock)Array_of_Event

Description: Method getTokenExchangeTradeHistory

payPnftRoyalties(userId, credentials, pnftId, weisToPay, bchainTypeCode)Boolean

Description: Method payPnftRoyalties

getTotalRoyaltyPctgForPnft(pnftId, bchainTypeCode)Integer

Description: Method getTotalRoyaltyPctgForPnft

getTotalSatEthereumRoyaltyPercent(satId)Integer

Description: Method getTotalSatEthereumRoyaltyPercent

importFromNft(userId, credentials, erc721Addr, tokenId, pnftId, bchainTypeCode)Integer

Description: Method importFromNft

exportToNft(userId, credentials, pnftId, bchainTypeCode)Boolean

Description: Method exportToNft

getPnft(pnftId, bchainTypeCode)Object

Description: Method getPnft

erc721_safeTransferFrom(userId, credentials, erc721Addr, from, to, tokenId, bchainTypeCode)Boolean

Description: Method erc721_safeTransferFrom

erc721_transferFrom(userId, credentials, erc721Addr, from, to, tokenId, bchainTypeCode)Boolean

Description: Method erc721_transferFrom

erc721_approve(userId, credentials, erc721Addr, approved, tokenId, bchainTypeCode)Boolean

Description: Method erc721_approve

erc721_setApprovalForAll(userId, credentials, erc721Addr, operator, approved, bchainTypeCode)Boolean

Description: Method erc721_setApprovalForAll

erc721_balanceOf(erc721Addr, owner, bchainTypeCode)Integer

Description: Method erc721_balanceOf

erc721_ownerOf(erc721Addr, tokenId, bchainTypeCode)Address

Description: Method erc721_ownerOf

erc721_getApproved(erc721Addr, tokenId, bchainTypeCode)Address

Description: Method erc721_getApproved

erc721_isApprovedForAll(erc721Addr, owner, operator, bchainTypeCode)Boolean

Description: Method erc721_isApprovedForAll

erc721_tokenOfOwnerByIndex(erc721Addr, owner, index, bchainTypeCode)Integer

Description: Method erc721_tokenOfOwnerByIndex

newUser(bchainTypeCode, credentials) ⇒ Keys

Description: Method newUser

Kind: global function
Returns: Keys - Look at Type description in Docs.

ParamTypeDescription
bchainTypeCodeConstant_of_Integer(optional. default: 1) Look at Constants description in Docs.
credentialsString(optional. default: null)

Example
1st:

Call (in pseudo-code):

newUser(1,'12345678');

Response json-data:

{"result":{"userId":"0xa6338a68b941684b5adb7524a06ccc396ebad5a6","pubKey":"0x0535aaa59911be010f44950df20f9b680b90f77f8d6b27fef5615b208dbdc20ca2ab237d56bd5d4aee340192e0f385e8a53d49d82e02b0d5e9dcec5abb845d31","prvKey":"0x43725c1cf6ae8ad9b88d0f49e24e2181c6ac5b9e01d4c00f578ae0909fdc07ea"}}

Example
2nd:

Call (in pseudo-code):

newUser(1,'12345678_Zetonium');

Response json-data:

{"result":{"userId":"0x5387953b5ae9761ba82381cd4bf90c0c2d610836","pubKey":"0x5749e2716c8e1f27f7f566ffef4c3862cc26fd4cfacb136c37a2f7f660b771ec9d7edb4cb0da980ceb9b8aef7bff16e6749be5627da182b79cc953831f7129f2","prvKey":"0xf3bfb49352772533c94e3363a64517e676e8cc802577045061002515114c143c"}}

Example
3th:

Call (in pseudo-code):

newUser(2,'12345678_Ethereum');

Response json-data:

{"result":{"userId":"0xec437de270daa9c9afbc431e8b280da08433c65e","pubKey":"0x8a84cff8fde8a9c2b3e166a846f1002903807238a0dfe78fd2b1837dc3e335b9ba296676e18c2f441a4e011f79d42444bb197c8e4517e5b4b24361e1f828027b","prvKey":"0xd53db5f115befcb00b7d3ea019daf731e2bfa72cfb0918de106664d79ce330ec"}}

getLastBlock(bchainTypeCode) ⇒ Integer

Description: Method getLastBlock

Kind: global function

ParamTypeDescription
bchainTypeCodeConstant_of_Integer(optional. default: 1) Look at Constants description in Docs.

getTimestamps(bchainTypeCode, blocksNumbers) ⇒ Array_of_Integer

Description: Method getTimestamps

Kind: global function

ParamTypeDescription
bchainTypeCodeConstant_of_Integer(optional. default: 1) Look at Constants description in Docs.
blocksNumbersArray_of_Integer

getBlocks(bchainTypeCode, blocksNumbers) ⇒ Array_of_Object

Description: Method getBlocks

Kind: global function

ParamTypeDescription
bchainTypeCodeConstant_of_Integer(optional. default: 1) Look at Constants description in Docs.
blocksNumbersArray_of_Integer

sendLeos(currencyTypeCode, senderId, senderCredentials, amount, toUserId) ⇒ Integer

Description: Method sendLeos

Kind: global function
Returns: Integer - newSrcBalance

ParamTypeDescription
currencyTypeCodeConstant_of_Integer(optional. default: 1) Look at Constants description in Docs.
senderIdAddress
senderCredentialsString
amountInteger
toUserIdAddress

Example
1st:

Call (in pseudo-code):

sendLeos(1,'0x003e8c791cb39b4cad756b9c25431d6eb3fed85c','12345678',500000000,'0xa6338a68b941684b5adb7524a06ccc396ebad5a6');

Response json-data:

{"result":"855736620000"}

Example
2nd:

Call (in pseudo-code):

sendLeos(1,'0x003e8c791cb39b4cad756b9c25431d6eb3fed85c','12345678',500000000,'0x9189313f9823231685571d81bc084f35617a9f4c');

Response json-data:

{"result":"855236620000"}

Example
3th:

Call (in pseudo-code):

sendLeos(1,'0x003e8c791cb39b4cad756b9c25431d6eb3fed85c','12345678',500000000,'0x14302f1785fd47583c929cf3684953116cbeaa95');

Response json-data:

{"result":"854736620000"}

transfer(srcCurrencyTypeCode, senderId, senderCredentials, srcLeosAmount) ⇒ Integer

Description: Method transfer

Kind: global function
Returns: Integer - newSrcBalance

ParamTypeDescription
srcCurrencyTypeCodeConstant_of_IntegerLook at Constants description in Docs.
senderIdAddress
senderCredentialsString
srcLeosAmountInteger

silverCostInGold(userId, silverLeosAmount) ⇒ Integer

Description: Method silverCostInGold

Kind: global function

ParamType
userIdAddress
silverLeosAmountInteger

goldCostInSilver(userId, goldLeosAmount) ⇒ Integer

Description: Method goldCostInSilver

Kind: global function

ParamType
userIdAddress
goldLeosAmountInteger

Example
1st:

Call (in pseudo-code):

goldCostInSilver('0xe7e0f3cddec426b44589cd1877f0aa392b207c13',1000000);

Response json-data:

{"result":"1000000"}

completeAppCashProductPurchase(userId, paymentInfo, engineName) ⇒ Integer

Description: Method completeAppCashProductPurchase

Kind: global function
Returns: Integer - statusCode

ParamType
userIdAddress
paymentInfoObject
engineNameString

getAppCashProducts(appId, engineName) ⇒ Object

Description: Method getAppCashProducts

Kind: global function
Returns: Object - products

ParamType
appIdString
engineNameString

sendWeis_Ethereum(sender, senderCredentials, receiver, weisAmount, databytes) ⇒ Integer

Description: Method sendWeis_Ethereum

Kind: global function
Returns: Integer - newSrcBalance

ParamType
senderAddress
senderCredentialsString
receiverAddress
weisAmountInteger
databytesString

Example
1st:

Call (in pseudo-code):

sendWeis_Ethereum('0x0c46effd09207e466fdf188ab12c352fbe3377ec','12345678','0xe7e0f3cddec426b44589cd1877f0aa392b207c13',100000,null);

Response json-data:

{"result":"9998999999999999400000"}

getSystemAccounts() ⇒ Object

Description: Method getSystemAccounts

Kind: global function

getBalances(zetUserId, ethUserId, pgnUserId, flwUserId) ⇒ Object

Description: Method getBalances

Kind: global function

ParamTypeDescription
zetUserIdAddress(optional. default: null)
ethUserIdAddress(optional. default: null)
pgnUserIdAddress(optional. default: null)
flwUserIdAddress(optional. default: null)

Example
1st:

Call (in pseudo-code):

getBalances('0xa6338a68b941684b5adb7524a06ccc396ebad5a6',null);

Response json-data:

{"result":{"silver_leos":"489000000"}}

Example
2nd:

Call (in pseudo-code):

getBalances('0x9189313f9823231685571d81bc084f35617a9f4c',null);

Response json-data:

{"result":{"silver_leos":"489000000"}}

Example
3th:

Call (in pseudo-code):

getBalances('0x14302f1785fd47583c929cf3684953116cbeaa95',null);

Response json-data:

{"result":{"silver_leos":"489000000"}}

v_getEligibilityValue(userId) ⇒ Integer

Description: Method v_getEligibilityValue

Kind: global function

ParamType
userIdAddress

v_wantVote(userId, userCredentials, iWish) ⇒ Boolean

Description: Method v_wantVote

Kind: global function
Returns: Boolean - isOk

ParamType
userIdAddress
userCredentialsString
iWishBoolean

v_supportVoter(userId, userCredentials, voterToSupport) ⇒ Boolean

Description: Method v_supportVoter

Kind: global function
Returns: Boolean - isOk

ParamType
userIdAddress
userCredentialsString
voterToSupportAddress

Example
1st:

Call (in pseudo-code):

v_supportVoter('0x003e8c791cb39b4cad756b9c25431d6eb3fed85c','12345678','0x082b4e4e0f686a9a249799acea9f05dc2fe83a4a');

Response json-data:

{"result":true}

v_getAccountsByCoinbases(coinbases) ⇒ Array_of_Address

Description: Method v_getAccountsByCoinbases

Kind: global function

ParamType
coinbasesArray_of_Address

v_getVoteCostInSilverLeos(userId) ⇒ Integer

Description: Method v_getVoteCostInSilverLeos

Kind: global function

ParamType
userIdAddress

v_getContractVoters(userId) ⇒ Array_of_Address

Description: Method v_getContractVoters

Kind: global function

ParamType
userIdAddress

v_getQuorumVoters() ⇒ Array_of_Address

Description: Method v_getQuorumVoters

Kind: global function

v_getCandidatesPool(userId) ⇒ Array_of_Address

Description: Method v_getCandidatesPool

Kind: global function

ParamType
userIdAddress

v_isInCandidatesPool(userId) ⇒ Boolean

Description: Method v_isInCandidatesPool

Kind: global function

ParamType
userIdAddress

v_hasPledge(userId) ⇒ Boolean

Description: Method v_hasPledge

Kind: global function

ParamType
userIdAddress

v_isLicensedForVoting(userId) ⇒ Boolean

Description: Method v_isLicensedForVoting

Kind: global function

ParamType
userIdAddress

getMyCoinbase() ⇒ Address

Description: Method getMyCoinbase

Kind: global function

v_withdrawPledge(userId, userCredentials) ⇒ Boolean

Description: Method v_withdrawPledge

Kind: global function
Returns: Boolean - isOk

ParamType
userIdAddress
userCredentialsString

v_offerBuyVoting(userId, userCredentials, silverLeosAmount) ⇒ Boolean

Description: Method v_offerBuyVoting

Kind: global function
Returns: Boolean - isOk

ParamType
userIdAddress
userCredentialsString
silverLeosAmountInteger

offerCurrencyExchangeGoldForWeis(sellerId, sellerCredentials, buyerId, goldLeosAmount, weisAmount) ⇒ Boolean

Description: Method offerCurrencyExchangeGoldForWeis

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
buyerIdAddress
goldLeosAmountInteger
weisAmountInteger

offerCurrencyExchangeWeisForGold(sellerId, sellerCredentials, buyerId, goldLeosAmount, weisAmount) ⇒ Boolean

Description: Method offerCurrencyExchangeWeisForGold

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
buyerIdAddress
goldLeosAmountInteger
weisAmountInteger

cancelCurrencyExchangeOffer(sellerId, sellerCredentials, offerId) ⇒ Boolean

Description: Method cancelCurrencyExchangeOffer

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
offerIdInteger

getCurrencyExchangeOffers(userId, offersIds) ⇒ Array_of_Object

Description: Method getCurrencyExchangeOffers

Kind: global function

ParamType
userIdAddress
offersIdsArray_of_Integer

acceptCurrencyExchangeGoldForWeisOffer(buyerId, buyerCredentials, offerId, goldLeosAmount) ⇒ Boolean

Description: Method acceptCurrencyExchangeGoldForWeisOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger
goldLeosAmountInteger

acceptCurrencyExchangeWeisForGoldOffer(buyerId, buyerCredentials, offerId, weisAmount) ⇒ Boolean

Description: Method acceptCurrencyExchangeWeisForGoldOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger
weisAmountInteger

rejectCurrencyExchangeOffer(buyerId, buyerCredentials, offerId) ⇒ Boolean

Description: Method rejectCurrencyExchangeOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger

getCurrencyExchangeOffersIdsToMe(userId, pos, size) ⇒ Array_of_Integer

Description: Method getCurrencyExchangeOffersIdsToMe

Kind: global function

ParamTypeDescription
userIdAddress
posInteger(optional. default: 0)
sizeInteger(optional. default: 10)

getCurrencyExchangeOffersCountToMe(userId) ⇒ Integer

Description: Method getCurrencyExchangeOffersCountToMe

Kind: global function

ParamType
userIdAddress

getCurrencyExchangeTradeHistory(tradeTypeCode, userId, startBlock) ⇒ Array_of_Event

Description: Method getCurrencyExchangeTradeHistory

Kind: global function
Returns: Array_of_Event - Look at Type description in Docs.

ParamTypeDescription
tradeTypeCodeConstant_of_IntegerLook at Constants description in Docs.
userIdAddress
startBlockInteger

offerTokenExchangeGoldForPnft(sellerId, sellerCredentials, buyerId, goldLeosAmount, pnftId) ⇒ Boolean

Description: Method offerTokenExchangeGoldForPnft

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
buyerIdAddress
goldLeosAmountInteger
pnftIdInteger

offerTokenExchangePnftForGold(sellerId, sellerCredentials, buyerId, goldLeosAmount, pnftId) ⇒ Boolean

Description: Method offerTokenExchangePnftForGold

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
buyerIdAddress
goldLeosAmountInteger
pnftIdInteger

cancelTokenExchangeOffer(sellerId, sellerCredentials, offerId) ⇒ Boolean

Description: Method cancelTokenExchangeOffer

Kind: global function

ParamType
sellerIdAddress
sellerCredentialsString
offerIdInteger

getTokenExchangeOffers(userId, offersIds) ⇒ Array_of_Object

Description: Method getTokenExchangeOffers

Kind: global function

ParamType
userIdAddress
offersIdsArray_of_Integer

acceptTokenExchangeGoldForPnftOffer(buyerId, buyerCredentials, offerId, goldLeosAmount) ⇒ Boolean

Description: Method acceptTokenExchangeGoldForPnftOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger
goldLeosAmountInteger

acceptTokenExchangePnftForGoldOffer(buyerId, buyerCredentials, offerId, pnftId) ⇒ Boolean

Description: Method acceptTokenExchangePnftForGoldOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger
pnftIdInteger

rejectTokenExchangeOffer(buyerId, buyerCredentials, offerId) ⇒ Boolean

Description: Method rejectTokenExchangeOffer

Kind: global function

ParamType
buyerIdAddress
buyerCredentialsString
offerIdInteger

getTokenExchangeOffersIdsToMe(userId, pos, size) ⇒ Array_of_Integer

Description: Method getTokenExchangeOffersIdsToMe

Kind: global function

ParamTypeDescription
userIdAddress
posInteger(optional. default: 0)
sizeInteger(optional. default: 10)

getTokenExchangeOffersCountToMe(userId) ⇒ Integer

Description: Method getTokenExchangeOffersCountToMe

Kind: global function

ParamType
userIdAddress

getTokenExchangeTradeHistory(tradeTypeCode, userId, startBlock) ⇒ Array_of_Event

Description: Method getTokenExchangeTradeHistory

Kind: global function
Returns: Array_of_Event - Look at Type description in Docs.

ParamTypeDescription
tradeTypeCodeConstant_of_IntegerLook at Constants description in Docs.
userIdAddress
startBlockInteger

payPnftRoyalties(userId, credentials, pnftId, weisToPay, bchainTypeCode) ⇒ Boolean

Description: Method payPnftRoyalties

Kind: global function
Returns: Boolean - isOk

ParamTypeDescription
userIdAddress
credentialsString
pnftIdInteger
weisToPayInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

getTotalRoyaltyPctgForPnft(pnftId, bchainTypeCode) ⇒ Integer

Description: Method getTotalRoyaltyPctgForPnft

Kind: global function
Returns: Integer - pctg

ParamTypeDescription
pnftIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

getTotalSatEthereumRoyaltyPercent(satId) ⇒ Integer

Description: Method getTotalSatEthereumRoyaltyPercent

Kind: global function
Returns: Integer - pctg

ParamType
satIdInteger

importFromNft(userId, credentials, erc721Addr, tokenId, pnftId, bchainTypeCode) ⇒ Integer

Description: Method importFromNft

Kind: global function
Returns: Integer - pnftId

ParamTypeDescription
userIdAddress
credentialsString
erc721AddrAddress
tokenIdInteger
pnftIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

exportToNft(userId, credentials, pnftId, bchainTypeCode) ⇒ Boolean

Description: Method exportToNft

Kind: global function

ParamTypeDescription
userIdAddress
credentialsString
pnftIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

getPnft(pnftId, bchainTypeCode) ⇒ Object

Description: Method getPnft

Kind: global function

ParamTypeDescription
pnftIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_safeTransferFrom(userId, credentials, erc721Addr, from, to, tokenId, bchainTypeCode) ⇒ Boolean

Description: Method erc721_safeTransferFrom

Kind: global function

ParamTypeDescription
userIdAddress
credentialsString
erc721AddrAddress(optional. default: null)
fromAddress
toAddress
tokenIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_transferFrom(userId, credentials, erc721Addr, from, to, tokenId, bchainTypeCode) ⇒ Boolean

Description: Method erc721_transferFrom

Kind: global function

ParamTypeDescription
userIdAddress
credentialsString
erc721AddrAddress(optional. default: null)
fromAddress
toAddress
tokenIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_approve(userId, credentials, erc721Addr, approved, tokenId, bchainTypeCode) ⇒ Boolean

Description: Method erc721_approve

Kind: global function

ParamTypeDescription
userIdAddress
credentialsString
erc721AddrAddress(optional. default: null)
approvedAddress
tokenIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_setApprovalForAll(userId, credentials, erc721Addr, operator, approved, bchainTypeCode) ⇒ Boolean

Description: Method erc721_setApprovalForAll

Kind: global function

ParamTypeDescription
userIdAddress
credentialsString
erc721AddrAddress(optional. default: null)
operatorAddress
approvedBoolean
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_balanceOf(erc721Addr, owner, bchainTypeCode) ⇒ Integer

Description: Method erc721_balanceOf

Kind: global function
Returns: Integer - numberOfNfts

ParamTypeDescription
erc721AddrAddress(optional. default: null)
ownerAddress
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_ownerOf(erc721Addr, tokenId, bchainTypeCode) ⇒ Address

Description: Method erc721_ownerOf

Kind: global function
Returns: Address - owner

ParamTypeDescription
erc721AddrAddress(optional. default: null)
tokenIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_getApproved(erc721Addr, tokenId, bchainTypeCode) ⇒ Address

Description: Method erc721_getApproved

Kind: global function
Returns: Address - operator

ParamTypeDescription
erc721AddrAddress(optional. default: null)
tokenIdInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_isApprovedForAll(erc721Addr, owner, operator, bchainTypeCode) ⇒ Boolean

Description: Method erc721_isApprovedForAll

Kind: global function

ParamTypeDescription
erc721AddrAddress(optional. default: null)
ownerAddress
operatorAddress
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

erc721_tokenOfOwnerByIndex(erc721Addr, owner, index, bchainTypeCode) ⇒ Integer

Description: Method erc721_tokenOfOwnerByIndex

Kind: global function
Returns: Integer - tokenId

ParamTypeDescription
erc721AddrAddress(optional. default: null)
ownerAddress
indexInteger
bchainTypeCodeConstant_of_Integer(optional. default: 2) Look at Constants description in Docs.

FAQs

Package last updated on 30 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc