@radixdlt/atom-transaction-mapping
Advanced tools
Comparing version 1.0.1-alpha.0 to 1.0.3-alpha.0
@@ -32,2 +32,3 @@ "use strict"; | ||
const getRecipient = (input) => { | ||
var _a, _b; | ||
const sender = input.from; | ||
@@ -41,3 +42,3 @@ const particleGroup = input.particleGroup; | ||
return neverthrow_1.err(new Error('A transfer should have one or two receivers. Unable to parse.')); | ||
const recipient = upTTPs.find((p) => !p.address.equals(sender))?.address ?? sender; | ||
const recipient = (_b = (_a = upTTPs.find((p) => !p.address.equals(sender))) === null || _a === void 0 ? void 0 : _a.address) !== null && _b !== void 0 ? _b : sender; | ||
return neverthrow_1.ok({ to: recipient, upTTPs }); | ||
@@ -51,7 +52,3 @@ }; | ||
throw Error('Incorrect implementation, should not happen.'); | ||
return { | ||
...input, | ||
to, | ||
amount: upParticleToRecipient.amount, | ||
}; | ||
return Object.assign(Object.assign({}, input), { to, amount: upParticleToRecipient.amount }); | ||
}); | ||
@@ -58,0 +55,0 @@ const pgToTokenTransfer = (particleGroup) => getSenderAndToken(particleGroup) |
@@ -17,8 +17,5 @@ "use strict"; | ||
throw new Error('Incorrect implementation, mismatch between application state types.'); | ||
return { | ||
...input, | ||
reduceFromInitialState: (upParticles) => exports.reduceFromInitialState({ ...input, upParticles }), | ||
}; | ||
return Object.assign(Object.assign({}, input), { reduceFromInitialState: (upParticles) => exports.reduceFromInitialState(Object.assign(Object.assign({}, input), { upParticles })) }); | ||
}; | ||
exports.makeParticleReducer = makeParticleReducer; | ||
//# sourceMappingURL=particleReducer.js.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
size: balances.size, | ||
balancesFor: (owner) => balances.get(owner) ?? tokenBalancesForOneAccountReducer_1.emptyTokenBalancesForOneAccount(owner), | ||
balancesFor: (owner) => { var _a; return (_a = balances.get(owner)) !== null && _a !== void 0 ? _a : tokenBalancesForOneAccountReducer_1.emptyTokenBalancesForOneAccount(owner); }, | ||
}); | ||
@@ -17,0 +17,0 @@ exports.tokenBalancesPerAccount = tokenBalancesPerAccount; |
@@ -15,8 +15,3 @@ "use strict"; | ||
inputCreator: utils_1.transferrableTokensParticleFromOther.bind(null, burnAction.sender), | ||
outputCreator: (amount, fromTTP) => neverthrow_1.ok(atom_1.unallocatedTokensParticle({ | ||
...fromTTP, | ||
permissions: fromTTP.permissions.permissions, | ||
amount, | ||
nonce: undefined, | ||
})), | ||
outputCreator: (amount, fromTTP) => neverthrow_1.ok(atom_1.unallocatedTokensParticle(Object.assign(Object.assign({}, fromTTP), { permissions: fromTTP.permissions.permissions, amount, nonce: undefined }))), | ||
}); | ||
@@ -23,0 +18,0 @@ const consumableParticles = input.upParticles |
@@ -46,9 +46,5 @@ "use strict"; | ||
const makeSimpleTransitioner = (input) => { | ||
return exports.makeTransitioner({ | ||
...input, | ||
inputCreator: (amount, _) => neverthrow_1.ok(input.inputCreator(amount)), | ||
outputCreator: (amount, _) => neverthrow_1.ok(input.outputCreator(amount)), | ||
}); | ||
return exports.makeTransitioner(Object.assign(Object.assign({}, input), { inputCreator: (amount, _) => neverthrow_1.ok(input.inputCreator(amount)), outputCreator: (amount, _) => neverthrow_1.ok(input.outputCreator(amount)) })); | ||
}; | ||
exports.makeSimpleTransitioner = makeSimpleTransitioner; | ||
//# sourceMappingURL=fungibleParticleTransitioner.js.map |
@@ -5,9 +5,4 @@ "use strict"; | ||
const atom_1 = require("@radixdlt/atom"); | ||
const transferrableTokensParticleFromOther = (address, amount, from) => atom_1.TransferrableTokensParticle.create({ | ||
...from, | ||
permissions: from.permissions.permissions, | ||
amount, | ||
address, | ||
nonce: undefined, | ||
}); | ||
const transferrableTokensParticleFromOther = (address, amount, from) => atom_1.TransferrableTokensParticle.create(Object.assign(Object.assign({}, from), { permissions: from.permissions.permissions, amount, | ||
address, nonce: undefined })); | ||
exports.transferrableTokensParticleFromOther = transferrableTokensParticleFromOther; | ||
@@ -14,0 +9,0 @@ const collectUpParticles = (input) => { |
@@ -19,3 +19,3 @@ "use strict"; | ||
const resourceIdentifier = input.action.resourceIdentifier; | ||
const tokenDefValidation = validateTokenDefinition ?? (() => neverthrow_1.ok(exports.alwaysValid)); | ||
const tokenDefValidation = validateTokenDefinition !== null && validateTokenDefinition !== void 0 ? validateTokenDefinition : (() => neverthrow_1.ok(exports.alwaysValid)); | ||
const spunParticles_ = atom_1.spunParticles(input.upParticles); | ||
@@ -22,0 +22,0 @@ const tokenDefinitionParticle = spunParticles_.tokenDefinitionParticleMatchingIdentifier(resourceIdentifier); |
{ | ||
"name": "@radixdlt/atom-transaction-mapping", | ||
"version": "1.0.1-alpha.0", | ||
"version": "1.0.3-alpha.0", | ||
"description": "Create Atoms from actions", | ||
@@ -27,8 +27,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@radixdlt/account": "^1.0.1-alpha.0", | ||
"@radixdlt/actions": "^1.0.1-alpha.0", | ||
"@radixdlt/atom": "^1.0.1-alpha.0", | ||
"@radixdlt/primitives": "^1.0.1-alpha.0", | ||
"@radixdlt/account": "^1.0.3-alpha.0", | ||
"@radixdlt/actions": "^1.0.3-alpha.0", | ||
"@radixdlt/atom": "^1.0.3-alpha.0", | ||
"@radixdlt/primitives": "^1.0.3-alpha.0", | ||
"@radixdlt/uint256": "^1.1.0", | ||
"@radixdlt/util": "^1.0.1-alpha.0", | ||
"@radixdlt/util": "^1.0.3-alpha.0", | ||
"@types/uuid": "^8.3.0", | ||
@@ -45,3 +45,3 @@ "neverthrow": "^4.0.1", | ||
}, | ||
"gitHead": "d4912e22fcb4884c8af847610752be360290197d" | ||
"gitHead": "38895b63a5434ec1c03fbb7be37513fb1020a87a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
422321
3296
+ Added@radixdlt/actions@1.0.3-alpha.0(transitive)
+ Added@radixdlt/atom@1.0.3-alpha.0(transitive)
- Removed@radixdlt/actions@1.0.1-alpha.0(transitive)
- Removed@radixdlt/atom@1.0.1-alpha.0(transitive)