Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions js/kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2570,6 +2570,7 @@ brtAccount = function(){
self.geohash = '';
self.static = false;
self.radius = 0;
self.safeDeal = {};

self.validation = function(){

Expand All @@ -2581,7 +2582,8 @@ brtAccount = function(){
a: self.tags,
g: self.geohash,
s: self.static,
r: self.radius
r: self.radius,
d: self.safeDeal,
});
}

Expand All @@ -2592,7 +2594,8 @@ brtAccount = function(){
tags: self.tags,
geohash: self.geohash,
static: self.static,
radius: self.radius
radius: self.radius,
safeDeal: self.safeDeal,
};
}

Expand All @@ -2603,7 +2606,8 @@ brtAccount = function(){
a: self.tags,
g: self.geohash,
s: self.static,
r: self.radius
r: self.radius,
d: self.safeDeal,
})
}
};
Expand All @@ -2615,6 +2619,7 @@ brtAccount = function(){
self.geohash = d.geohash;
self.static = d.static;
self.radius = d.radius;
self.safeDeal = d.safeDeal;
}

self.type = 'brtaccount';
Expand All @@ -2639,6 +2644,7 @@ brtOffer = function(){
self.currencyPrice = {};
self.delivery = {};
self.videoSettings = {};
self.safeDeal = {};
self.price = 0;
self.published = 'published';

Expand Down Expand Up @@ -2668,7 +2674,8 @@ brtOffer = function(){
p: self.published,
f: self.currencyPrice,
d: self.delivery,
v: self.videoSettings
v: self.videoSettings,
s: self.safeDeal,
}) +
JSON.stringify(self.images) +
self.geohash +
Expand All @@ -2693,6 +2700,7 @@ brtOffer = function(){
currencyPrice: self.currencyPrice,
delivery: self.delivery,
videoSettings: self.videoSettings,
safeDeal: self.safeDeal,
price: self.price,
published: self.published
};
Expand All @@ -2712,7 +2720,8 @@ brtOffer = function(){
p: self.published,
f: self.currencyPrice,
d: self.delivery,
v: self.videoSettings
v: self.videoSettings,
s: self.safeDeal,
}),
s5: JSON.stringify(self.images),
s6: self.geohash,
Expand All @@ -2737,6 +2746,7 @@ brtOffer = function(){
self.currencyPrice = d.currencyPrice;
self.delivery = d.delivery;
self.videoSettings = d.videoSettings;
self.safeDeal = d.safeDeal;
self.price = d.price;
self.published = d.published;
}
Expand Down
27 changes: 26 additions & 1 deletion js/lib/apps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,31 @@ var BastyonApps = function (app) {
}
},

fromToTransactions: {
parameters: ['addressFrom', 'addressTo'],
permissions: [],
authorization: true,
action: function ({
data,
application
}) {
return app.platform.sdk.node.transactions.getfromtotransactions(
data.addressFrom, data.addressTo, data.update, data.depth, data.opreturn
).then(result => {
if (data.confirmations) {
return app.platform.sdk.node.get.timepr().then(() => {
if (!(app.platform.currentBlock)) {
throw new Error('actions_currentBlock_not_defined');
}
return (result || []).filter(f => (app.platform.currentBlock - f.height >= data.confirmations))
})
} else {
return result;
}
})
}
},

sign: {
permissions: ['sign'],
authorization: true,
Expand Down Expand Up @@ -798,7 +823,7 @@ var BastyonApps = function (app) {
margintop: document.documentElement.style.getPropertyValue('--app-margin-top') || document.documentElement.style.getPropertyValue('--app-margin-top-default') || '0px',
application: application.manifest,
project: project_config,
transactionsApiVersion: 4,
transactionsApiVersion: 5,
alttransport : app.hasTor || false
})
}
Expand Down
12 changes: 12 additions & 0 deletions js/lib/apps/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,18 @@ var BastyonSdk = function(settings = {}){
})
},

fromToTransactions : function (addressFrom, addressTo, options = {}) {
const data = {
addressFrom,
addressTo,
update: options?.update,
depth: options?.depth,
opreturn: options?.opreturn,
confirmations: options?.confirmations,
};
return action('fromToTransactions', data)
},

geolocation : function(){
return action('geolocation', {})
},
Expand Down
9 changes: 6 additions & 3 deletions js/satolist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17739,7 +17739,7 @@ Platform = function (app, listofnodes) {

},

getfromtotransactions : function(from, to, update){
getfromtotransactions : function(from, to, update, depth, opreturn){

return pretry(function () {
return self.currentBlock
Expand All @@ -17750,8 +17750,11 @@ Platform = function (app, listofnodes) {

return app.psdk.getfromtotransactions.request(() => {


return self.app.api.rpc('getfromtotransactions', [from, to, self.currentBlock - 43200 * 12])
depth = depth || (self.currentBlock - 43200 * 12);

const params = opreturn ? [from, to, depth, opreturn] : [from, to, depth];

return self.app.api.rpc('getfromtotransactions', params);

/*

Expand Down