@zkp2p/providers 3.0.0 → 4.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.
@@ -127,7 +127,7 @@
127
127
  "includeAdditionalCookieDomains": [],
128
128
  "useExternalAction": true,
129
129
  "external": {
130
- "actionLink": "squarecash://cash?recipient=${{RECEIVER_ID}}&amount={{AMOUNT}}",
130
+ "actionLink": "https://cash.app/{{RECIPIENT_ID}}/{{AMOUNT}}",
131
131
  "appStoreLink": "https://apps.apple.com/us/app/cash-app-mobile-banking/id711923939",
132
132
  "playStoreLink": "https://play.google.com/store/apps/details?id=com.squareup.cash"
133
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/providers",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Provider JSON templates for ZKP2P",
5
5
  "scripts": {
6
6
  "start": "node index.js"
@@ -5,6 +5,7 @@
5
5
  "method": "GET",
6
6
  "body": "",
7
7
  "metadata": {
8
+ "shouldReplayRequestInPage": true,
8
9
  "metadataUrl": "https://app.revolut.com/api/retail/user/current/transactions/last?count=20",
9
10
  "metadataUrlMethod": "GET",
10
11
  "metadataUrlBody": "",
@@ -104,6 +104,13 @@
104
104
  "actionLink": "venmo://paycharge?txn=pay&recipients={{RECIPIENT_ID}}&note=🎁&amount={{AMOUNT}}",
105
105
  "appStoreLink": "https://apps.apple.com/us/app/venmo/id351727428",
106
106
  "playStoreLink": "https://play.google.com/store/apps/details?id=com.venmo"
107
+ },
108
+ "login": {
109
+ "usernameSelector": "#email, input[name=\"login_email\"], input[name=\"username\"], input[type=\"email\"], input[data-testid=\"text-input-username\"]",
110
+ "passwordSelector": "#password, input[name=\"login_password\"][type=\"password\"][data-testid=\"text-input-password\"]",
111
+ "nextSelector": "#btnNext, button[data-testid=\"button-next\"], button.next_button[type=\"submit\"]",
112
+ "submitSelector": "#btnLogin, button[data-testid=\"button-submit\"][type=\"submit\"], button.login_button[type=\"submit\"]",
113
+ "revealTimeoutMs": 5000
107
114
  }
108
115
  }
109
116
  }
@@ -72,6 +72,14 @@
72
72
  "type": "regex",
73
73
  "value": "\"state\":\"OUTGOING_PAYMENT_SENT\",\"date\":(?<timestamp>[0-9]+)"
74
74
  },
75
+ {
76
+ "type": "regex",
77
+ "value": "\"sourceAmount\":(?<sourceAmount>[0-9\\.]+)"
78
+ },
79
+ {
80
+ "type": "regex",
81
+ "value": "\"sourceCurrency\":\"(?<sourceCurrency>[^\"]+)\""
82
+ },
75
83
  {
76
84
  "type": "regex",
77
85
  "value": "\"targetAmount\":(?<targetAmount>[0-9\\.]+)"
@@ -98,6 +106,14 @@
98
106
  "jsonPath": "$.stateHistory",
99
107
  "xPath": ""
100
108
  },
109
+ {
110
+ "jsonPath": "$.sourceAmount",
111
+ "xPath": ""
112
+ },
113
+ {
114
+ "jsonPath": "$.sourceCurrency",
115
+ "xPath": ""
116
+ },
101
117
  {
102
118
  "jsonPath": "$.targetAmount",
103
119
  "xPath": ""
@@ -117,16 +133,17 @@
117
133
  "android": "Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.207 Mobile Safari/537.36",
118
134
  "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"
119
135
  },
120
- "useExternalAction": false,
136
+ "useExternalAction": true,
121
137
  "external": {
122
138
  "actionLink": "transferwise://pay/me/{{RECIPIENT_ID}}",
123
139
  "appStoreLink": "https://apps.apple.com/us/app/wise-international-transfers/id612261027",
124
140
  "playStoreLink": "https://play.google.com/store/apps/details?id=com.transferwise.android"
125
141
  },
126
- "internal": {
127
- "actionLink": "https://wise.com/send/",
128
- "actionCompletedUrlRegex": "https://wise.com/transactions/activities/by-resource/TRANSFER/\\S+",
129
- "injectedJavaScript": "(function(){const style=document.createElement('style');style.textContent='.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:200px;}.zkp2p-dropdown-item{padding:12px 16px;cursor:pointer;}.zkp2p-dropdown-item:hover{background:#F5F5F5;}.zkp2p-dropdown-item:active{background:#E8E8E8;}.zkp2p-dropdown-name{font-weight:500;color:#333;font-size:16px;margin-bottom:2px;}.zkp2p-dropdown-type{color:#666;font-size:14px;}';document.head.appendChild(style);const fillSearchField=function(value){const searchInput=document.querySelector('input[placeholder=\"Name, Wisetag, email, phone number\"]');if(searchInput){searchInput.focus();const nativeInputValueSetter=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set;nativeInputValueSetter.call(searchInput,value);searchInput.dispatchEvent(new Event('input',{bubbles:true,cancelable:true}));searchInput.dispatchEvent(new Event('change',{bubbles:true,cancelable:true}));setTimeout(()=>{nativeInputValueSetter.call(searchInput,value+' ');searchInput.dispatchEvent(new Event('input',{bubbles:true}));setTimeout(()=>{nativeInputValueSetter.call(searchInput,value);searchInput.dispatchEvent(new Event('input',{bubbles:true}));searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',keyCode:13,bubbles:true,cancelable:true}));},50);},50);}};const createDropdown=function(input){const existing=document.getElementById('zkp2p-dropdown');if(existing)existing.remove();const rect=input.getBoundingClientRect();const dropdown=document.createElement('div');dropdown.className='zkp2p-dropdown';dropdown.id='zkp2p-dropdown';dropdown.style.position='absolute';dropdown.style.top=(rect.bottom+window.scrollY+4)+'px';dropdown.style.left=(rect.left-20)+'px';dropdown.style.display='block';const item=document.createElement('div');item.className='zkp2p-dropdown-item';const recipientId='@{{RECIPIENT_ID}}';item.innerHTML='<div class=\"zkp2p-dropdown-content\"><div class=\"zkp2p-dropdown-name\">'+recipientId+'</div><div class=\"zkp2p-dropdown-type\">Wisetag for ZKP2P</div></div>';item.addEventListener('click',function(){fillSearchField(recipientId);dropdown.remove();});dropdown.appendChild(item);document.body.appendChild(dropdown);setTimeout(()=>{document.addEventListener('click',function hideDropdown(e){if(!dropdown.contains(e.target)&&e.target!==input){dropdown.remove();document.removeEventListener('click',hideDropdown);}});},100);};const setupDropdown=function(){const searchInput=document.querySelector('input[placeholder=\"Name, Wisetag, email, phone number\"]');if(searchInput&&!searchInput.hasAttribute('data-zkp2p')){searchInput.setAttribute('data-zkp2p','true');searchInput.addEventListener('focus',function(){createDropdown(this);});}};setTimeout(setupDropdown,1500);const observer=new MutationObserver(setupDropdown);observer.observe(document.body,{childList:true,subtree:true});})();"
142
+ "login": {
143
+ "usernameSelector": "#email, input[name=\"email\"][type=\"email\"], input.cs-email[type=\"email\"]",
144
+ "passwordSelector": "#password, input[name=\"password\"][type=\"password\"], input.cs-password[type=\"password\"]",
145
+ "submitSelector": "button[type=\"submit\"]",
146
+ "revealTimeoutMs": 5000
130
147
  }
131
148
  }
132
149
  }