Compare commits

...

1 Commits

Author SHA1 Message Date
muzam1l
25eec6980f Fix TrustSet transaction example. 2022-07-14 20:05:32 +05:30
3 changed files with 12 additions and 8 deletions

View File

@@ -40,9 +40,9 @@
{
"label": "Token",
"body": {
"currency": "${1:13.1}",
"value": "${2:FOO}",
"description": "${3:rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpns}"
"currency": "${1:USD}",
"value": "${2:100}",
"issuer": "${3:rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpns}"
}
}
]

View File

@@ -212,9 +212,13 @@
"Fee": "12",
"Flags": 262144,
"LastLedgerSequence": 8007750,
"Amount": {
"$value": "100",
"$type": "xrp"
"LimitAmount": {
"$type": "json",
"$value": {
"currency": "USD",
"issuer": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
"value": "100"
}
},
"Sequence": 12
}

View File

@@ -118,7 +118,7 @@ export const prepareTransaction = (data: any) => {
// handle type: `json`
if (_value && typeof _value === "object" && _value.$type === "json") {
if (typeof _value.$value === "object") {
options[field] = _value.$value as any;
options[field] = { ..._value.$value } as any;
} else {
try {
options[field] = JSON.parse(_value.$value);
@@ -131,7 +131,7 @@ export const prepareTransaction = (data: any) => {
}
}
// delete unneccesary fields
// delete unnecessary fields
if (options[field] === undefined) {
delete options[field];
}