UNPKG

react-native-bynn-sdk

Version:

Bynn Mobile SDK for React Native - Identity verification and KYC

1 lines 13.3 kB
'use strict';const _0x158242=_0x2877;(function(_0x263f89,_0x415440){const _0x23ef13=_0x2877,_0x4bcedc=_0x263f89();while(!![]){try{const _0x3286d4=-parseInt(_0x23ef13(0x227))/0x1*(-parseInt(_0x23ef13(0x234))/0x2)+parseInt(_0x23ef13(0x201))/0x3*(-parseInt(_0x23ef13(0x216))/0x4)+parseInt(_0x23ef13(0x20f))/0x5*(-parseInt(_0x23ef13(0x238))/0x6)+parseInt(_0x23ef13(0x217))/0x7*(-parseInt(_0x23ef13(0x22b))/0x8)+parseInt(_0x23ef13(0x222))/0x9+parseInt(_0x23ef13(0x1f2))/0xa+-parseInt(_0x23ef13(0x1f8))/0xb*(-parseInt(_0x23ef13(0x1f9))/0xc);if(_0x3286d4===_0x415440)break;else _0x4bcedc['push'](_0x4bcedc['shift']());}catch(_0xbb9523){_0x4bcedc['push'](_0x4bcedc['shift']());}}}(_0x2f56,0x4329c));Object['defineProperty'](exports,_0x158242(0x237),{'value':!![]}),exports['ProofOfFundsView']=void 0x0;var _react=_interopRequireWildcard(require('react')),_reactNative=require('react-native'),_dimensions=require('../utils/dimensions'),_useBynnSession=require('../useBynnSession'),_api=require(_0x158242(0x23b)),_BynnProvider=require(_0x158242(0x203)),ImagePicker=_interopRequireWildcard(require('react-native-image-picker')),_ExitView=_interopRequireDefault(require(_0x158242(0x211))),_reactI18next=require('react-i18next');function _0x2877(_0xce0cf2,_0x4e450c){const _0x2f560d=_0x2f56();return _0x2877=function(_0x2877c7,_0x4998de){_0x2877c7=_0x2877c7-0x1f2;let _0x376726=_0x2f560d[_0x2877c7];return _0x376726;},_0x2877(_0xce0cf2,_0x4e450c);}require('../i18n');function _0x2f56(){const _0x10d2fd=['#15181E','../api','Camera\x20Permission','1813580CKfHoO','base64','90%','progressOverlay','relative','warn','143FRwPKX','339156JRLqEL','alert','has','Failed\x20to\x20pick\x20image','Font','Height','View','Alert','148947VsQIWT','#BDBDBD','../BynnProvider','CAMERA','useState','RESULTS','useBynnSession','TouchableOpacity','Text','object','proof_of_funds_description','rgba(0,0,0,0.5)','GRANTED','createElement','25ZfygPZ','now','./ExitView','Failed\x20to\x20take\x20photo','600','#FFFFF','#374255','12IImOAL','2941379cIQeHL','Error','large','No\x20session','ActivityIndicator','95%','photo','Error\x20taking\x20photo:','take_photo','absolute','useEffect','639018UuElAf','error','message','set','didCancel','1237xEaVLk','hasOwnProperty','useTranslation','Width','8wSloMG','assets','contain','center','PERMISSIONS','SafeAreaView','default','black','white','660aRnZPx','flex-start','create','__esModule','220494XKoKtj','uri'];_0x2f56=function(){return _0x10d2fd;};return _0x2f56();}function _interopRequireDefault(_0x8438a5){const _0x1bf1ca=_0x158242;return _0x8438a5&&_0x8438a5[_0x1bf1ca(0x237)]?_0x8438a5:{'default':_0x8438a5};}function _interopRequireWildcard(_0x4cd7a8,_0x2401a1){if('function'==typeof WeakMap)var _0x1a3626=new WeakMap(),_0x8fa075=new WeakMap();return(_interopRequireWildcard=function(_0xe1efcb,_0x983113){const _0xd9e159=_0x2877;if(!_0x983113&&_0xe1efcb&&_0xe1efcb['__esModule'])return _0xe1efcb;var _0x42a3d4,_0x15ae6a,_0x675a61={'__proto__':null,'default':_0xe1efcb};if(null===_0xe1efcb||_0xd9e159(0x20a)!=typeof _0xe1efcb&&'function'!=typeof _0xe1efcb)return _0x675a61;if(_0x42a3d4=_0x983113?_0x8fa075:_0x1a3626){if(_0x42a3d4[_0xd9e159(0x1fb)](_0xe1efcb))return _0x42a3d4['get'](_0xe1efcb);_0x42a3d4[_0xd9e159(0x225)](_0xe1efcb,_0x675a61);}for(const _0x421699 in _0xe1efcb)_0xd9e159(0x231)!==_0x421699&&{}[_0xd9e159(0x228)]['call'](_0xe1efcb,_0x421699)&&((_0x15ae6a=(_0x42a3d4=Object['defineProperty'])&&Object['getOwnPropertyDescriptor'](_0xe1efcb,_0x421699))&&(_0x15ae6a['get']||_0x15ae6a['set'])?_0x42a3d4(_0x675a61,_0x421699,_0x15ae6a):_0x675a61[_0x421699]=_0xe1efcb[_0x421699]);return _0x675a61;})(_0x4cd7a8,_0x2401a1);}const ProofOfFundsView=()=>{const _0xbb2f1f=_0x158242,[_0x447317,_0x43e3a1]=(0x0,_react['useState'])(null),[_0x525874,_0x4ed360]=(0x0,_react['useState'])(null),[_0x1d6fe,_0x1d4ae5]=(0x0,_react[_0xbb2f1f(0x205)])(![]),{sessionId:_0x54c69c}=(0x0,_useBynnSession[_0xbb2f1f(0x207)])(),{setGlobalLoading:_0x1394ed,globalLoading:_0x25a695}=(0x0,_BynnProvider['useBynn'])(),[_0x64a77,_0x35a383]=(0x0,_react[_0xbb2f1f(0x205)])(0x0),[_0x39638b,_0x2f6e3e]=(0x0,_react[_0xbb2f1f(0x205)])(![]),[_0x369fc9,_0x1fa7e1]=(0x0,_react[_0xbb2f1f(0x205)])(Date[_0xbb2f1f(0x210)]()),[_0x4e48a2,_0x198d59]=(0x0,_react['useState'])(![]),{t:_0x4d9ae4}=(0x0,_reactI18next[_0xbb2f1f(0x229)])();(0x0,_react[_0xbb2f1f(0x221)])(()=>{const _0x49bd54=_0xbb2f1f;_0x1d6fe==!![]?(_0x1fa7e1(Date[_0x49bd54(0x210)]()),_0x53d419()):null;},[_0x1d6fe]),(0x0,_react[_0xbb2f1f(0x221)])(()=>{let _0x244a91;return _0x39638b&&(_0x35a383(0x0),_0x244a91=setInterval(()=>{_0x35a383(_0xe1e632=>{if(_0xe1e632>=0x64)return clearInterval(_0x244a91),_0x2f6e3e(![]),0x64;return _0xe1e632+0x1;});},49.5)),()=>clearInterval(_0x244a91);},[_0x39638b]);const _0x53d419=async()=>{const _0x2a9e20=_0xbb2f1f;try{if(!_0x54c69c)throw new Error(_0x2a9e20(0x21a));_0x2f6e3e(!![]),await(0x0,_api['submitFundsVerification'])(_0x54c69c,_0x525874?_0x525874:''),_0x1394ed(!![]),_0x1d4ae5(![]);}catch(_0x4e254a){console[_0x2a9e20(0x223)](_0x4e254a),_0x2f6e3e(![]),_0x1394ed(![]),_0x1d4ae5(![]),_reactNative[_0x2a9e20(0x200)]['alert'](_0x2a9e20(0x218),_0x4e254a[_0x2a9e20(0x224)]),setTimeout(()=>{_0x1394ed(![]);},0x3e8);}},_0x26e8fa=async()=>{const _0x4faf00=_0xbb2f1f;if(_reactNative['Platform']['OS']==='android')try{const _0x4fbe07=await _reactNative['PermissionsAndroid']['request'](_reactNative['PermissionsAndroid'][_0x4faf00(0x22f)][_0x4faf00(0x204)],{'title':_0x4faf00(0x23c),'message':'App\x20needs\x20access\x20to\x20your\x20camera','buttonNeutral':'Ask\x20Me\x20Later','buttonNegative':'Cancel','buttonPositive':'OK'});return _0x4fbe07===_reactNative['PermissionsAndroid'][_0x4faf00(0x206)][_0x4faf00(0x20d)];}catch(_0x2b5e1d){return console[_0x4faf00(0x1f7)](_0x2b5e1d),![];}return!![];},_0x2c304f=async()=>{const _0x21e735=_0xbb2f1f;try{if(_reactNative['Platform']['OS']!=='web'){const _0x1bbdee=await _0x26e8fa();if(!_0x1bbdee){_reactNative[_0x21e735(0x200)]['alert']('Permission\x20needed','Camera\x20permission\x20is\x20required\x20to\x20take\x20photos');return;}const _0x300a6b=await ImagePicker['launchCamera']({'mediaType':_0x21e735(0x21d),'quality':0.8,'includeBase64':!![]});!_0x300a6b[_0x21e735(0x226)]&&_0x300a6b['assets']&&_0x300a6b['assets']['length']>0x0&&(_0x43e3a1(_0x300a6b['assets'][0x0][_0x21e735(0x239)]),setTimeout(()=>{const _0x11dc1f=_0x21e735;_0x4ed360(_0x300a6b[_0x11dc1f(0x22c)][0x0][_0x11dc1f(0x1f3)]),_0x1d4ae5(!![]);},0x3e8));}else _reactNative[_0x21e735(0x200)][_0x21e735(0x1fa)]('Not\x20supported','Camera\x20is\x20not\x20available\x20on\x20web');}catch(_0x4ed690){console[_0x21e735(0x223)](_0x21e735(0x21e),_0x4ed690),_reactNative[_0x21e735(0x200)][_0x21e735(0x1fa)](_0x21e735(0x218),_0x21e735(0x212));}},_0x4d58a4=async()=>{const _0x485c64=_0xbb2f1f;try{const _0x2367a9=await ImagePicker['launchImageLibrary']({'mediaType':'photo','quality':0.8,'includeBase64':!![]});!_0x2367a9['didCancel']&&_0x2367a9[_0x485c64(0x22c)]&&_0x2367a9[_0x485c64(0x22c)]['length']>0x0&&(_0x43e3a1(_0x2367a9[_0x485c64(0x22c)][0x0]['uri']),setTimeout(()=>{const _0x563212=_0x485c64;_0x4ed360(_0x2367a9[_0x563212(0x22c)][0x0]['base64']),_0x1d4ae5(!![]);},0x3e8));}catch(_0x5de5e1){console[_0x485c64(0x223)]('Error\x20picking\x20image:',_0x5de5e1),_reactNative['Alert']['alert']('Error',_0x485c64(0x1fc));}};return _react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x230)],{'style':{'flex':0x1,'alignItems':_0xbb2f1f(0x22e),'backgroundColor':'#FFFFFF'}},!_0x39638b&&_0x25a695&&_react['default']['createElement'](_reactNative[_0xbb2f1f(0x1ff)],{'style':styles[_0xbb2f1f(0x1f5)]},_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x21b)],{'size':_0xbb2f1f(0x219),'color':_0xbb2f1f(0x233)})),_0x39638b&&_react[_0xbb2f1f(0x231)]['createElement'](_reactNative[_0xbb2f1f(0x1ff)],{'style':styles['progressOverlay']},_react['default']['createElement'](_reactNative['Image'],{'key':_0x369fc9,'style':{'height':(0x0,_dimensions['Height'])(0x12c),'width':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x12c),'justifyContent':'center','alignItems':'center','position':_0xbb2f1f(0x1f6)},'source':require('../assets/img.gif')}),_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x209)],{'style':{'position':'absolute','fontSize':(0x0,_dimensions[_0xbb2f1f(0x1fd)])(0x22),'fontWeight':'bold','color':_0xbb2f1f(0x233)}},_0x64a77,'%')),_react[_0xbb2f1f(0x231)]['createElement'](_reactNative['View'],{'style':{'flexDirection':'row','justifyContent':'space-between','width':'90%'}},_react['default']['createElement'](_reactNative['TouchableOpacity'],{'onPress':()=>_0x198d59(!![])},_react[_0xbb2f1f(0x231)]['createElement'](_reactNative['Image'],{'resizeMode':_0xbb2f1f(0x22d),'style':{'height':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x18),'width':(0x0,_dimensions[_0xbb2f1f(0x22a)])(0x18)},'source':require('../assets/leftIcon.png')}))),_react['default'][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x209)],{'style':{'fontSize':(0x0,_dimensions[_0xbb2f1f(0x1fd)])(0x19),'marginBottom':(0x0,_dimensions['Height'])(0x14),'fontWeight':_0xbb2f1f(0x213),'lineHeight':(0x0,_dimensions['Height'])(0x20),'textAlign':'left','alignSelf':_0xbb2f1f(0x235),'marginLeft':'4%','paddingHorizontal':(0x0,_dimensions[_0xbb2f1f(0x22a)])(0x5),'marginTop':(0x0,_dimensions['Height'])(0xf)}},_0x4d9ae4('proof_of_funds')),_react[_0xbb2f1f(0x231)]['createElement'](_reactNative[_0xbb2f1f(0x209)],{'style':{'fontSize':(0x0,_dimensions[_0xbb2f1f(0x1fd)])(0x11),'fontWeight':'400','lineHeight':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x18),'color':_0xbb2f1f(0x215),'width':_0xbb2f1f(0x1f4)}},_0x4d9ae4(_0xbb2f1f(0x20b))),_0x447317?_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative['View'],{'style':{'marginTop':(0x0,_dimensions['Height'])(0x14),'alignItems':'center'}},_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative['Image'],{'resizeMode':'contain','source':{'uri':_0x447317},'style':{'width':0.9*_dimensions['fullWidth'],'height':(0x0,_dimensions['Height'])(0x190),'borderRadius':(0x0,_dimensions['Height'])(0x0),'marginBottom':(0x0,_dimensions['Height'])(0xa)}})):_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative['View'],null),_react['default']['createElement'](_reactNative[_0xbb2f1f(0x1ff)],{'style':{'justifyContent':_0xbb2f1f(0x22e),'alignItems':_0xbb2f1f(0x22e),'position':_0xbb2f1f(0x220),'bottom':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x1e)}},_react[_0xbb2f1f(0x231)][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x208)],{'onPress':_0x2c304f,'style':{'height':(0x0,_dimensions['Height'])(0x38),'width':(0x0,_dimensions[_0xbb2f1f(0x22a)])(0x168),'backgroundColor':_0xbb2f1f(0x23a),'justifyContent':'center','alignItems':'center','borderRadius':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x38),'marginVertical':(0x0,_dimensions['Height'])(0xa),'flexDirection':'row','columnGap':0x5}},_react['default']['createElement'](_reactNative[_0xbb2f1f(0x209)],{'style':{'color':'#FFFFFF','fontSize':(0x0,_dimensions['Font'])(0x10),'lineHeight':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x18),'fontWeight':'500'}},_0x4d9ae4(_0xbb2f1f(0x21f)))),_react['default'][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x208)],{'onPress':_0x4d58a4,'style':{'height':(0x0,_dimensions['Height'])(0x38),'width':(0x0,_dimensions['Width'])(0x168),'borderColor':'#15181E','borderWidth':0x1,'justifyContent':_0xbb2f1f(0x22e),'alignItems':_0xbb2f1f(0x22e),'borderRadius':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x38),'marginVertical':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0xa),'flexDirection':'row','columnGap':0x5}},_react['default'][_0xbb2f1f(0x20e)](_reactNative[_0xbb2f1f(0x209)],{'style':{'color':'#15181E','fontSize':(0x0,_dimensions['Font'])(0x10),'lineHeight':(0x0,_dimensions[_0xbb2f1f(0x1fe)])(0x18),'fontWeight':'500'}},_0x4d9ae4('upload_from_device')))),_react['default']['createElement'](_ExitView['default'],{'visible':_0x4e48a2,'onCancel':()=>_0x198d59(![]),'onConfirm':()=>_0x198d59(![])}));};exports['ProofOfFundsView']=ProofOfFundsView;const styles=_reactNative['StyleSheet'][_0x158242(0x236)]({'container':{'flex':0x1,'backgroundColor':_0x158242(0x214)},'textInputContainer':{'justifyContent':'center','borderRadius':(0x0,_dimensions[_0x158242(0x1fe)])(0x5),'marginBottom':(0x0,_dimensions[_0x158242(0x1fe)])(0x5),'width':'90%','height':(0x0,_dimensions['Height'])(0x39),'borderWidth':(0x0,_dimensions[_0x158242(0x1fe)])(0x2),'zIndex':-0xc8,'padding':0x1},'textInputText':{'fontSize':(0x0,_dimensions[_0x158242(0x1fd)])(0x11),'color':_0x158242(0x232)},'textInputContainerAndroid':{'justifyContent':_0x158242(0x22e),'borderRadius':(0x0,_dimensions[_0x158242(0x1fe)])(0x5),'marginBottom':(0x0,_dimensions[_0x158242(0x1fe)])(0x14),'width':_0x158242(0x21c),'height':(0x0,_dimensions['Height'])(0x37),'borderWidth':(0x0,_dimensions[_0x158242(0x1fe)])(0x1),'borderColor':_0x158242(0x202),'padding':0x1},'textInputTextAndroid':{'fontSize':(0x0,_dimensions[_0x158242(0x1fd)])(0x11),'color':'black','position':_0x158242(0x220),'top':0x2,'left':(0x0,_dimensions['Width'])(0x41),'width':(0x0,_dimensions[_0x158242(0x22a)])(0x96)},'flagButton':{'flexDirection':'row','width':'20%','justifyContent':_0x158242(0x22e),'paddingLeft':(0x0,_dimensions[_0x158242(0x22a)])(0xf)},'progressOverlay':{'position':_0x158242(0x220),'top':0x0,'bottom':0x0,'left':0x0,'right':0x0,'backgroundColor':_0x158242(0x20c),'justifyContent':'center','alignItems':_0x158242(0x22e),'zIndex':0x270f}});