Aliases

From Nxtwiki
Jump to: navigation, search

Buy / Sell Alias

Buy or sell an alias. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is either buyAlias or sellAlias
  • alias is the ID of the alias (optional)
  • aliasName is the alias name (optional if alias provided)
  • priceNQT is the asking price (in NQT) of the alias (sellAlias only)
  • amountNQT is the amount (in NQT) offered for an alias for sale (buyAlias only)
  • recipient is the account ID of the recipient (only required for sellAlias and only if there is a designated recipient)
  • recipientPublicKey is the public key of the recipient account (only applicable if recipient provided; optional, enhances security of a new account)

Note: An alias can be transferred rather than sold by setting priceNQT to zero. A pending sale can be canceled by selling again to self for a price of zero.

Response: Refer to Create Transaction Response.

Buy / Sell Alias Example

http://localhost:7876/nxt?
  requestType=sellAlias&
  secretPhrase=IWontTellYou&
  aliasName=nextus&
  priceNQT=5&
  recipient=NXT-4VNQ-RWZC-4WWQ-GVM8S&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "d6f026cd8a883b5b6ff78a7d0121e4847eb6744b02757427de6d7ca0bf304226",
 "unsignedTransactionBytes": "01166e01d4013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "2041afc1687da2693ba092e33a84f665ad461e3b6762c18af61778261bc7e...",
  "feeNQT": "100000000",
  "type": 1,
  "fullHash": "14a3eeb17cd4082db287259a768d32065d4cf5397ed6053fffa25e92a8a66ac7",
  "version": 1,
  "ecBlockId": "1612829598027150491",
  "signatureHash": "d6f026cd8a883b5b6ff78a7d0121e4847eb6744b02757427de6d7ca0bf304226",
  "attachment": {
   "alias": "nextus",
   "priceNQT": "5",
   "version.AliasSell": 1
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 6,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "recipientRS": "NXT-4VNQ-RWZC-4WWQ-GVM8S",
  "recipient": "17013046603665206934",
  "ecBlockHeight": 284050,
  "deadline": 60,
  "transaction": "3245077163546682132",
  "timestamp": 30671214,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 8515,
 "transactionBytes": "01166e01d4013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "fullHash": "14a3eeb17cd4082db287259a768d32065d4cf5397ed6053fffa25e92a8a66ac7",
 "transaction": "3245077163546682132"
}


Buy Alias

Refer to Buy / Sell Alias.

Sell Alias

Refer to Buy / Sell Alias.

Set Alias

Create and/or assign an alias. POST only.

Request: Refer to Create Transaction Request for common parameters.

Response: Refer to Create Transaction Response. The transaction ID is also the alias ID.

Set Alias Example

http://localhost:7876/nxt?
  requestType=setAlias&
  secretPhrase=IWontTellYou&
  aliasName=iwonttellyou&
  aliasURI=acct:nxt-l6fm-89wk-vk8p-fcrbb@nxt&
  feeNQT=100000000&
  deadline=60
{
 "signatureHash": "0dc7e07acef27fe86686cfabe2d1bd57c0c038f9465c3fe3d10f67932a97af10",
 "unsignedTransactionBytes": "011135d0d3013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143...",
 "transactionJSON": {
  "senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
  "signature": "d92aefbab189b6e61f890c34b06a47e14a1a2b2ce868f77a4591d2067c51d...",
  "feeNQT": "100000000",
  "type": 1,
  "fullHash": "53917acbf44109391609a9bb57832c0d5903301e3d2bd6ffcf45cf893480f5a1",
  "version": 1,
  "ecBlockId": "4181883296304410027",
  "signatureHash": "0dc7e07acef27fe86686cfabe2d1bd57c0c038f9465c3fe3d10f67932a97af10",
  "attachment": {
   "alias": "iwonttellyou",
   "version.AliasAssignment": 1,
   "uri": "acct:nxt-l6fm-89wk-vk8p-fcrbb@nxt"
  },
  "senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
  "subtype": 1,
  "amountNQT": "0",
  "sender": "15323192282528158131",
  "ecBlockHeight": 283939,
  "deadline": 60,
  "transaction": "4109888654593921363",
  "timestamp": 30658613,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 8104,
 "transactionBytes": "011135d0d3013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473...",
 "fullHash": "53917acbf44109391609a9bb57832c0d5903301e3d2bd6ffcf45cf893480f5a1",
 "transaction": "4109888654593921363"
}


Delete Alias

Delete an alias given an alias ID or name. POST only.

Request: Refer to Create Transaction Request for common parameters.

  • requestType is deleteAlias
  • alias is the alias ID (optional)
  • aliasName is the alias name to be deleted (optional if alias provided)

Response: Refer to Create Transaction Response.

Delete Alias Example

https://localhost:7876/nxt?
  requestType=deleteAlias&
  aliasName=mystical
{
 "signatureHash": "a6e68daed99c1015dd12546c042466612b52a9f5193d8513f7f12684aba5bf1d",
 "unsignedTransactionBytes": "011809e60c023c0010f09c34f225d425306e5be55a49469081...",
 "transactionJSON": {
  "senderPublicKey": "10f09c34f225d425306e5be55a4946908156072afbead4d574a512d7e086ef5c",
  "signature": "a5088bc6469e528d884e7fd3c49afeefc8656dd59c9fa5ffeab2a17b465f6d03e77...",
  "feeNQT": "100000000",
  "type": 1,
  "fullHash": "63afc769e677b6210617ff7a9f5be2d7fe1aea7e46ccad968017d28df578fabf",
  "version": 1,
  "ecBlockId": "17895923487075501156",
  "signatureHash": "a6e68daed99c1015dd12546c042466612b52a9f5193d8513f7f12684aba5bf1d",
  "attachment": {
   "version.AliasDelete": 1,
   "alias": "mystical"
  },
  "senderRS": "NXT-4VDY-LNVT-LMAY-FMCKA",
  "subtype": 8,
  "amountNQT": "0",
  "sender": "15295723609781267838",
  "ecBlockHeight": 161137,
  "deadline": 60,
  "transaction": "2429260880513838947",
  "timestamp": 34399753,
  "height": 2147483647
 },
 "broadcasted": true,
 "requestProcessingTime": 52,
 "transactionBytes": "011809e60c023c0010f09c34f225d425306e5be55a4946908156072...",
 "transaction": "2429260880513838947"
}


Get Alias

Get information about a given alias

Request:

  • requestType is getAlias
  • alias is the alias ID (optional)
  • aliasName is the name of the alias (optional if alias provided)
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • timestamp (N) is the time (in seconds since the genesis block) when the alias was created or last transferred
  • aliasName (S) is the name of the alias
  • account (S) is the number of the account that owns the alias
  • accountRS (S) is the Reed-Solomon address of the account that owns the alias
  • aliasURI (S) is what the alias points to, in URI format
  • alias (S) is the alias ID
  • priceNQT (S) is the asking price (in NQT) of the alias if it is for sale
  • buyer (S) is the account number of the buyer if the alias is for sale and a buyer is specified
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Alias Example

https://localhost:7876/nxt?
  requestType=getAlias&
  alias=15515279700680480368
{
 "aliasURI": "http:\/\/google.com",
 "aliasName": "google",
 "accountRS": "NXT-FLVS-VRBV-LDPD-6DZ9W",
 "alias": "15515279700680480368",
 "requestProcessingTime": 1,
 "account": "5629477397208681336",
 "timestamp": 2409343
}


Get Alias Count

Get the number of aliases owned by an account given the account ID.

Request:

  • requestType is getAliasCount
  • account is the account ID
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • numberOfAliases (N) is the number of aliases owned by the account
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Alias Count Example

http://localhost:7876/nxt?
  requestType=getAliasCount&
  account=NXT-FLVS-VRBV-LDPD-6DZ9W
{
 "numberOfAliases": 200,
 "requestProcessingTime": 2
}


Get Aliases

Get information on aliases owned by a given account in alias name order.

Request:

  • requestType is getAliases
  • account is the ID of the account that owns the aliases
  • timestamp is the earliest creation time (in seconds since the genesis block) of the aliases (optional)
  • firstIndex is a zero-based index to the first alias to retrieve (optional)
  • lastIndex is a zero-based index to the last alias to retrieve (optional)
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • aliases (A) is an array of alias objects (refer to Get Alias for details)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Aliases Example

https://localhost:7876/nxt?
  requestType=getAliases&
  account=5629477397208681336&
  lastIndex=1
{
 "aliases": [
  {
   "aliasURI": "",
   "aliasName": "101",
   "accountRS": "NXT-FLVS-VRBV-LDPD-6DZ9W",
   "alias": "8952438483248557843",
   "account": "5629477397208681336",
   "timestamp": 2409893
  }
 ],
 "requestProcessingTime": 1
}


Get Aliases Like

Get all aliases starting with a given prefix in alias name order.

Request:

  • requestType is getAliasesLike
  • aliasPrefix is the prefix (at least 2 characters long) of the aliasName
  • firstIndex is a zero-based index to the first alias to retrieve (optional)
  • lastIndex is a zero-based index to the last alias to retrieve (optional)
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • aliases (A) is an array of alias objects (refer to Get Alias for details)
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)

Get Aliases Like Example

https://localhost:7876/nxt?
  requestType=getAliasesLike&
  aliasPrefix=mysteri
{
 "aliases": [
  {
   "aliasURI": "",
   "aliasName": "mysteries",
   "accountRS": "NXT-9DZL-XFE2-EWE5-HVVAY",
   "alias": "13234331415538245332",
   "account": "18384674354580664306",
   "timestamp": 4856820
  },
  {
   "aliasURI": "anm",
   "aliasName": "mysterious",
   "accountRS": "NXT-AHBB-DSVC-WS2L-EW8BC",
   "alias": "8033154744709486670",
   "account": "14205721421835156777",
   "timestamp": 2417903
  }
 ],
 "requestProcessingTime": 1
}