@zkp2p/providers 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,7 +126,17 @@
126
126
  ],
127
127
  "mobile": {
128
128
  "includeAdditionalCookieDomains": [],
129
+ "additionalClientOptions": {
130
+ "cipherSuites": [
131
+ "TLS_CHACHA20_POLY1305_SHA256",
132
+ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
133
+ "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
134
+ ]
135
+ },
129
136
  "useExternalAction": true,
137
+ "userAgent": {
138
+ "android": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15"
139
+ },
130
140
  "external": {
131
141
  "actionLink": "https://cash.app/{{RECIPIENT_ID}}/{{AMOUNT}}",
132
142
  "appStoreLink": "https://apps.apple.com/us/app/cash-app-mobile-banking/id711923939",
@@ -7,13 +7,13 @@
7
7
  "body": "",
8
8
  "metadata": {
9
9
  "platform": "mercadopago",
10
- "urlRegex": "https://www.mercadopago.com.ar/home",
10
+ "urlRegex": "^https://www\\.mercadopago\\.com\\.ar/home(?:/)?(?:\\?.*)?$",
11
11
  "method": "GET",
12
12
  "fallbackUrlRegex": "",
13
13
  "fallbackMethod": "",
14
14
  "preprocessRegex": "<script\\s+[^>]*id=[\"']__PRELOADED_STATE__[\"'][^>]*>([\\s\\S]*?)</script>",
15
15
  "transactionsExtraction": {
16
- "transactionJsonPathListSelector": "$.pageState.mpHome.result.sections.activities.content.activities_container.results",
16
+ "transactionJsonPathListSelector": "$.pageState.mpHome.result.sections.hs_activities.content.content",
17
17
  "transactionJsonPathSelectors": {
18
18
  "recipient": "$.title",
19
19
  "amount": "$.amount.fraction",
@@ -25,15 +25,15 @@
25
25
  "proofMetadataSelectors": [
26
26
  {
27
27
  "type": "jsonPath",
28
- "value": "$.pageState.mpHome.result.sections.activities.content.activities_container.results[{{INDEX}}].title"
28
+ "value": "$.pageState.mpHome.result.sections.hs_activities.content.content[{{INDEX}}].title"
29
29
  },
30
30
  {
31
31
  "type": "jsonPath",
32
- "value": "$.pageState.mpHome.result.sections.activities.content.activities_container.results[{{INDEX}}].amount.fraction"
32
+ "value": "$.pageState.mpHome.result.sections.hs_activities.content.content[{{INDEX}}].amount.fraction"
33
33
  },
34
34
  {
35
35
  "type": "jsonPath",
36
- "value": "$.pageState.mpHome.result.sections.activities.content.activities_container.results[{{INDEX}}].id"
36
+ "value": "$.pageState.mpHome.result.sections.hs_activities.content.content[{{INDEX}}].id"
37
37
  }
38
38
  ]
39
39
  },
@@ -44,11 +44,11 @@
44
44
  "paramSelectors": [
45
45
  {
46
46
  "type": "jsonPath",
47
- "value": "$.pageState.mpHome.result.sections.activities.content.activities_container.results[{{INDEX}}].id"
47
+ "value": "$.pageState.mpHome.result.sections.hs_activities.content.content[{{INDEX}}].id"
48
48
  },
49
49
  {
50
50
  "type": "regex",
51
- "value": "(mp-home)"
51
+ "value": "from=([^&\\\"]+)"
52
52
  }
53
53
  ],
54
54
  "skipRequestHeaders": [
@@ -89,7 +89,7 @@
89
89
  {
90
90
  "jsonPath": "",
91
91
  "xPath": "",
92
- "regex": "<span class=\"andes-money-amount__fraction\" aria-hidden=\"true\">(.*?)<\/span><span aria-hidden=\"true\">,<\/span><span class=\"andes-money-amount__cents\" aria-hidden=\"true\">(.*?)<\/span>"
92
+ "regex": "<span class=\"andes-money-amount__fraction\" aria-hidden=\"true\">(.*?)</span><span aria-hidden=\"true\">,</span><span class=\"andes-money-amount__cents\" aria-hidden=\"true\">(.*?)</span>"
93
93
  },
94
94
  {
95
95
  "jsonPath": "",
@@ -108,6 +108,13 @@
108
108
  }
109
109
  ],
110
110
  "mobile": {
111
+ "additionalClientOptions": {
112
+ "cipherSuites": [
113
+ "TLS_AES_128_GCM_SHA256",
114
+ "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
115
+ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
116
+ ]
117
+ },
111
118
  "includeAdditionalCookieDomains": [
112
119
  "mercadolibre.com",
113
120
  "www.mercadolibre.com"
@@ -115,7 +122,7 @@
115
122
  "internal": {
116
123
  "actionLink": "https://www.mercadopago.com.ar/money-out/transfer/",
117
124
  "actionCompletedUrlRegex": "https://www.mercadopago.com.ar/money-out/transfer/congrats\\?data=\\S+",
118
- "injectedJavaScript": "(function(){const style=document.createElement('style');style.textContent='.zkp2p-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:24px;height:24px;background:#007AFF;border-radius:4px;cursor:pointer;z-index:9999;display:flex;align-items:center;justify-content:center;color:white;font-weight:bold;font-size:12px;}.zkp2p-dropdown{position:absolute;background:#FFF;border:1px solid #E0E0E0;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.15);z-index:99999;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;font-size:14px;color:#333;width:auto;min-width:250px;}.zkp2p-dropdown-item{padding:12px 16px;cursor:pointer;}.zkp2p-dropdown-item:hover{background:#F5F5F5;}.zkp2p-dropdown-item:active{background:#E8E8E8;}.zkp2p-dropdown-label{color:#666;font-size:12px;margin-bottom:4px;}.zkp2p-dropdown-value{font-weight:500;color:#333;font-size:16px;}.zkp2p-toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#333;color:white;padding:10px 20px;border-radius:6px;z-index:999999;font-family:system-ui;}';document.head.appendChild(style);const copyToClipboard=function(text){const textArea=document.createElement('textarea');textArea.value=text;textArea.style.position='fixed';textArea.style.top='-9999px';document.body.appendChild(textArea);textArea.select();textArea.setSelectionRange(0,99999);document.execCommand('copy');document.body.removeChild(textArea);const toast=document.createElement('div');toast.className='zkp2p-toast';toast.textContent='Copied!';document.body.appendChild(toast);setTimeout(()=>toast.remove(),2000);};const createDropdown=function(input,label,value){const rect=input.getBoundingClientRect();const dropdown=document.createElement('div');dropdown.className='zkp2p-dropdown';dropdown.id='zkp2p-dropdown-'+Date.now();dropdown.style.position='absolute';dropdown.style.top=(rect.bottom+window.scrollY+4)+'px';dropdown.style.left=rect.left+'px';dropdown.style.display='block';const item=document.createElement('div');item.className='zkp2p-dropdown-item';item.innerHTML='<div class=\"zkp2p-dropdown-label\">'+label+'</div><div class=\"zkp2p-dropdown-value\">'+value+'</div>';item.addEventListener('click',function(){copyToClipboard(value);dropdown.remove();});dropdown.appendChild(item);document.body.appendChild(dropdown);setTimeout(()=>{document.addEventListener('click',function hideDropdown(e){if(!dropdown.contains(e.target)&&e.target!==input&&!e.target.classList.contains('zkp2p-icon')){dropdown.remove();document.removeEventListener('click',hideDropdown);}});},100);};const addIcon=function(input,label,value){const container=input.closest('.andes-amount-field__input-container')||input.parentElement;container.style.position='relative';const icon=document.createElement('div');icon.className='zkp2p-icon';icon.textContent='Z';icon.addEventListener('click',function(e){e.stopPropagation();const existing=document.querySelector('.zkp2p-dropdown');if(existing)existing.remove();createDropdown(input,label,value);});container.appendChild(icon);createDropdown(input,label,value);};const swap=function(a){try{a=String(a||'');if(!a)return a;return a.split('.').join('#').split(',').join('.').split('#').join(',');}catch(_){return String(a||'');}};const setupFields=function(){const cvuInput=document.querySelector('input[name=\"identification_account\"]');if(cvuInput&&!cvuInput.hasAttribute('data-zkp2p')){cvuInput.setAttribute('data-zkp2p','true');addIcon(cvuInput,'CVU for ZKP2P:','{{RECIPIENT_ID}}');}const amountInput=document.querySelector('#amount-field-input');if(amountInput&&!amountInput.hasAttribute('data-zkp2p')){amountInput.setAttribute('data-zkp2p','true');var swapped=swap('{{AMOUNT}}');addIcon(amountInput,'Amount for ZKP2P:',swapped);}};setTimeout(setupFields,1500);const observer=new MutationObserver(setupFields);observer.observe(document.body,{childList:true,subtree:true});})();"
125
+ "injectedJavaScript": "(function(){\n try{\n var DETAILS={RECIPIENT_ID:'{{RECIPIENT_ID}}',AMOUNT:'{{AMOUNT}}'};\n function xFirst(xpath){try{var r=document.evaluate(xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);return r&&r.singleNodeValue?r.singleNodeValue:null;}catch(e){return null;}}\n function q(sel){try{return document.querySelector(sel);}catch(e){return null;}}\n\n function setNative(node,val){\n try{var desc=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value');if(desc&&desc.set)desc.set.call(node,String(val));else node.value=String(val);}catch(e){node.value=String(val);} \n try{node.dispatchEvent(new Event('input',{bubbles:true}));}catch(e){}\n }\n function typeChars(node, seq){\n try{\n node.focus&&node.focus();\n setNative(node,'');\n try{node.setSelectionRange(0,0);}catch(e){}\n for(var i=0;i<seq.length;i++){\n var c=seq[i];\n try{node.dispatchEvent(new InputEvent('beforeinput',{inputType:'insertText',data:c,bubbles:true,cancelable:true}))}catch(e){}\n try{node.dispatchEvent(new KeyboardEvent('keydown',{key:c,bubbles:true}))}catch(e){}\n setNative(node,(node.value||'')+c);\n try{node.dispatchEvent(new KeyboardEvent('keyup',{key:c,bubbles:true}))}catch(e){}\n }\n try{node.dispatchEvent(new Event('change',{bubbles:true}))}catch(e){}\n return true;\n }catch(e){return false;}\n }\n\n // ===== Amount helpers (comma-decimal, no thousands dots typed) =====\n function getHiddenValue(node){\n try{var h=node&&node.parentElement&&node.parentElement.querySelector('.andes-amount-field__hidden-content');return h?String(h.textContent||'').trim():String(node.value||'');}catch(e){return String(node&&node.value||'');}\n }\n function stripDots(s){return String(s||'').replace(/\\./g,'');}\n function normalizeAmountCommaOnly(raw){\n try{\n var s=String(raw||'').trim(); if(!s) return '';\n s=s.replace(/\\s+/g,'');\n var lastDot=s.lastIndexOf('.');\n var lastComma=s.lastIndexOf(',');\n var dec=(lastDot>lastComma)?'.':','; // whichever appears last is decimal\n var parts=dec==='.'?s.split('.') : s.split(',');\n var intPart=parts[0].replace(/[.,]/g,''); // remove all separators\n var fracPart=(parts[1]||'').replace(/[.,]/g,'').slice(0,2);\n return fracPart? (intPart+','+fracPart) : intPart; // use comma as decimal, no dots\n }catch(e){return String(raw||'');}\n }\n function hvMatchesExpected(node, expected){\n var hv=getHiddenValue(node);\n return stripDots(hv)===stripDots(expected) && expected.length>0;\n }\n function typeAmountCommaOnly(node, raw){\n var expected=normalizeAmountCommaOnly(raw); // e.g., '1000,12'\n typeChars(node, expected.split(''));\n try{ node.focus&&node.focus(); }catch(e){}\n setTimeout(function(){\n try{ if(!hvMatchesExpected(node, expected)){ setNative(node,''); typeChars(node, expected.split('')); try{ node.focus&&node.focus(); }catch(e){} }\n }catch(e){}\n }, 160);\n // Persist for a few seconds in case mask clears it again\n try{\n if(!node.__zkp2p_amt_norm_guard){\n node.__zkp2p_amt_norm_guard=true;\n var until=Date.now()+8000;\n var t=setInterval(function(){\n if(Date.now()>until){ clearInterval(t); return; }\n try{ if(!hvMatchesExpected(node, expected)){ setNative(node,''); typeChars(node, expected.split('')); } }catch(e){}\n }, 300);\n }\n }catch(e){}\n }\n\n // ===== CVU stabilizers (unchanged) =====\n function attachStabilizers(node,want,ms){\n try{\n if(node.__zkp2p_stable) return; node.__zkp2p_stable=true;\n var until = Date.now() + (ms||5000);\n var wantStr = String(want||'');\n function reassert(){\n try{\n if(Date.now()>until) return;\n var now=String(node.value||'');\n if(now!==wantStr && wantStr){ setNative(node,wantStr); try{node.setAttribute('value',wantStr)}catch(e){} try{node.defaultValue=wantStr}catch(e){} try{node.dispatchEvent(new Event('change',{bubbles:true}))}catch(e){} }\n }catch(e){}\n }\n node.addEventListener('blur',function(){ setTimeout(reassert,20); }, true);\n node.addEventListener('focus',function(){ setTimeout(reassert,80); }, true);\n node.addEventListener('input',function(){ setTimeout(reassert,120); }, true);\n setTimeout(reassert,100);\n var t=setInterval(function(){ if(Date.now()>until){clearInterval(t);} else { reassert(); } }, 300);\n }catch(e){}\n }\n\n function fill(){\n var ok=true;\n // CVU (unchanged)\n var cvu=DETAILS.RECIPIENT_ID||DETAILS.recipient||DETAILS.recipientId||DETAILS.cvu||'';\n if(cvu){\n var cvuEl=xFirst(\"//section[contains(@class,'new-account-form')]//input[contains(@class,'andes-form-control__field')]\")||q(\"input[name='identification_account']\")||q('section.new-account-form input.andes-form-control__field');\n if(cvuEl&&!cvuEl.getAttribute('data-zkp2p-filled')){\n typeChars(cvuEl, String(cvu).split(''));\n attachStabilizers(cvuEl,cvu,6000);\n try{ cvuEl.focus && cvuEl.focus(); }catch(e){}\n cvuEl.setAttribute('data-zkp2p-filled','1');\n } else if(!cvuEl){ ok=false; }\n }\n // Amount (comma-decimal, no thousands dots typed)\n var amtRaw=DETAILS.AMOUNT||DETAILS.amount||DETAILS.amt||'';\n if(amtRaw){\n var amtEl=q('#amount-field-input')||q('input.andes-amount-field__input');\n if(amtEl&&!amtEl.getAttribute('data-zkp2p-filled')){\n typeAmountCommaOnly(amtEl, amtRaw);\n try{ amtEl.focus && amtEl.focus(); }catch(e){}\n amtEl.setAttribute('data-zkp2p-filled','1');\n } else if(!amtEl){ ok=false; }\n }\n return ok;\n }\n\n if(!fill()){\n var tries=0; var t=setInterval(function(){ tries++; if(fill()||tries>500){ clearInterval(t); } }, 120);\n }\n (function(){var push=history.pushState,rep=history.replaceState,emit=function(){try{window.dispatchEvent(new Event('locationchange'));}catch(e){}};history.pushState=function(){var r=push.apply(this,arguments);emit();return r;};history.replaceState=function(){var r=rep.apply(this,arguments);emit();return r;};window.addEventListener('popstate',emit);window.addEventListener('locationchange',function(){fill();});})();\n }catch(e){}\n return true;\n})();"
119
126
  }
120
127
  }
121
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/providers",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Provider JSON templates for ZKP2P",
5
5
  "scripts": {
6
6
  "start": "node index.js"
@@ -117,6 +117,13 @@
117
117
  ],
118
118
  "mobile": {
119
119
  "includeAdditionalCookieDomains": [],
120
+ "additionalClientOptions": {
121
+ "cipherSuites": [
122
+ "TLS_CHACHA20_POLY1305_SHA256",
123
+ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
124
+ "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
125
+ ]
126
+ },
120
127
  "useExternalAction": true,
121
128
  "external": {
122
129
  "actionLink": "https://revolut.me/{{RECIPIENT_ID}}",
@@ -96,12 +96,19 @@
96
96
  ],
97
97
  "mobile": {
98
98
  "includeAdditionalCookieDomains": [],
99
+ "additionalClientOptions": {
100
+ "cipherSuites": [
101
+ "TLS_AES_128_GCM_SHA256",
102
+ "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
103
+ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
104
+ ]
105
+ },
99
106
  "useExternalAction": true,
100
107
  "userAgent": {
101
108
  "ios": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15"
102
109
  },
103
110
  "external": {
104
- "actionLink": "venmo://paycharge?txn=pay&recipients={{RECIPIENT_ID}}&note=🎁&amount={{AMOUNT}}",
111
+ "actionLink": "venmo://paycharge?txn=pay&recipients={{RECIPIENT_ID}}&note=Thx&amount={{AMOUNT}}",
105
112
  "appStoreLink": "https://apps.apple.com/us/app/venmo/id351727428",
106
113
  "playStoreLink": "https://play.google.com/store/apps/details?id=com.venmo"
107
114
  },
@@ -130,6 +130,13 @@
130
130
  ],
131
131
  "mobile": {
132
132
  "includeAdditionalCookieDomains": [],
133
+ "additionalClientOptions": {
134
+ "cipherSuites": [
135
+ "TLS_CHACHA20_POLY1305_SHA256",
136
+ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
137
+ "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
138
+ ]
139
+ },
133
140
  "userAgent": {
134
141
  "android": "Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.207 Mobile Safari/537.36",
135
142
  "ios": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15"