Add support for WalletLocator (#1083)

Being able to fetch the WalletLocator field opens up new use-cases. The field can store for example a transaction hash, referencing a transaction with memos containing useful data.
This commit is contained in:
RareData
2019-12-12 08:47:41 +01:00
committed by Elliot Lee
parent 29bc5303ae
commit 5f92b230aa
6 changed files with 13 additions and 2 deletions

View File

@@ -3948,6 +3948,7 @@ return api.getSettings(address).then(settings =>
"requireDestinationTag": true,
"disallowIncomingXRP": true,
"emailHash": "23463B99B62A72F26ED677CC556C44E8",
"walletLocator": "00000000000000000000000000000000000000000000000000000000DEADBEEF",
"domain": "example.com",
"transferRate": 1.002,
"tickSize": 5,

View File

@@ -75,6 +75,7 @@ const AccountFlagIndices = {
const AccountFields = {
EmailHash: {name: 'emailHash', encoding: 'hex',
length: 32, defaults: '00000000000000000000000000000000'},
WalletLocator: {name: 'walletLocator'},
MessageKey: {name: 'messageKey'},
Domain: {name: 'domain', encoding: 'hex'},
TransferRate: {name: 'transferRate', defaults: 0, shift: 9},

View File

@@ -21,7 +21,7 @@
},
"domain": {
"type": "string",
"description": " The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase."
"description": "The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase."
},
"emailHash": {
"description": "Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use `null` to clear.",
@@ -30,6 +30,13 @@
{"$ref": "hash128"}
]
},
"walletLocator": {
"description": "Transaction hash or any other 64 character hexadecimal string, that may or may not represent the result of a hash operation. Use `null` to clear.",
"oneOf": [
{"type": "null"},
{"$ref": "hash256"}
]
},
"enableTransactionIDTracking": {
"type": "boolean",
"description": "Track the ID of this accounts most recent transaction."

View File

@@ -17,7 +17,7 @@ export interface AccountRootLedgerEntry {
RegularKey?: string,
TickSize?: number,
TransferRate?: number,
WalletLocator?: string, // DEPRECATED
WalletLocator?: string,
WalletSize?: number // DEPRECATED
}

View File

@@ -17,6 +17,7 @@ export type FormattedSettings = {
disallowIncomingXRP?: boolean,
domain?: string,
emailHash?: string|null,
walletLocator?: string|null,
enableTransactionIDTracking?: boolean,
globalFreeze?: boolean,
memos?: Memo[],

View File

@@ -2,6 +2,7 @@
"requireDestinationTag": true,
"disallowIncomingXRP": true,
"emailHash": "23463B99B62A72F26ED677CC556C44E8",
"walletLocator": "00000000000000000000000000000000000000000000000000000000DEADBEEF",
"domain": "example.com",
"transferRate": 1.002,
"tickSize": 5,