{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[],"examples":{"codes":[]},"apiSetting":null},"next":{"description":"","pages":[]},"title":"Onboarding ACH Widget","type":"basic","slug":"onboarding-ach-widget","excerpt":"Widgetized account and payment method creation","body":"The Wyre Onboarding and ACH Widget allows you to quickly deploy a KYC/AML widget to your web-supporting application. This involves prompting the customer for their name and address, banking information, uploading any necessary documentation (such as passports scans or video authorizations). The result is a private, secure profile the customer may use to prove their compliance status and gain access to gated services.\n\nAs a partner developer, you will not have direct access to the customer's personal information. The underlying personal information is exposed only in response to demands made to Wyre lawfully (or, in some cases, in support of security authorization).\n\nThe widget may be deployed on a page within your dApp, within a traditional web application, in an embedded iOS WebView, or any other modern web engine view. By passing configuration parameters to the widget in Javascript when you initialize it, you may control its behavior and the resulting customer experience.\n\nIts operation has **three distinct phases**:\n\n**[Authorization](doc:onboarding-ach-widget#authorization)**: Allow the customer to form a secure session with Wyre. This might be done through a wallet browser extension, MetaMask, or device-held secret key. You have control over the scheme used.\n\n**[Compliance On-Boarding](doc:onboarding-ach-widget#compliance-on-boarding)**: Request information from the customer in order to meet some specific level of compliance for a particular country. This will vary depending on your payment method used. ACH will require more information than a debit card flow.\n\n**[User Operation](doc:onboarding-ach-widget#operation)**: The flow presented to the user after on-boarding is complete. Presently, only `\"onramp\"` is available, which enables the user to withdraw fiat funds from a bank account, convert them into a specific target currency, and finally transfer them to a blockchain address or Wyre account.\n\nOnce the widget has concluded, it provides hooks to let you know it's complete, and why. It may close preemptively due to error, or because the user closed it. When it completes successfully, you may proceed with the assurance that Wyre knows the customer and holds evidence to prove it.\n[block:api-header]\n{\n  \"title\": \"Widget Loader Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<html>\\n    <head>\\n        <title>Verify with Wyre</title>\\n        <link rel=\\\"stylesheet\\\" href=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\\\" integrity=\\\"sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO\\\" crossorigin=\\\"anonymous\\\">\\n\\n    </head>\\n    <body>\\n        <div class=\\\"container\\\">\\n            <button id=\\\"verify-button\\\" class=\\\"btn btn-primary mt-5\\\">Verify with Wyre</button>\\n        </div>\\n\\n        <script src=\\\"https://code.jquery.com/jquery-3.3.1.slim.min.js\\\" integrity=\\\"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\\\" crossorigin=\\\"anonymous\\\"></script>\\n        <script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js\\\" integrity=\\\"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49\\\" crossorigin=\\\"anonymous\\\"></script>\\n        <script src=\\\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\\\" integrity=\\\"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy\\\" crossorigin=\\\"anonymous\\\"></script>\\n        <script src=\\\"https://verify.sendwyre.com/js/verify-module-init.js\\\"></script>\\n        <script type=\\\"text/javascript\\\">\\n            (function($) {\\n                var deviceToken = localStorage.getItem(\\\"DEVICE_TOKEN\\\");\\n                if (!deviceToken) {\\n                    var array = new Uint8Array(25);\\n                    window.crypto.getRandomValues(array);\\n                    deviceToken = Array.prototype.map\\n                        .call(array, x => (\\\"00\\\" + x.toString(16)).slice(-2))\\n                        .join(\\\"\\\");\\n                    localStorage.setItem(\\\"DEVICE_TOKEN\\\", deviceToken);\\n                }\\n                var handler = new Wyre({\\n                        env: \\\"prod\\\",//or \\\"test\\\"\\n                        auth: {\\n                            type: \\\"secretKey\\\",\\n                            secretKey: deviceToken\\n                        },\\n                        operation: {\\n                            type: \\\"onramp\\\",\\n                            destCurrency: \\\"ETH\\\",\\n                            dest: \\\"ethereum:0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413\\\",\\n                            sourceAmount: 10.0\\n                        },\\n                        onExit: function (error) {\\n                            if (error != null)\\n                                console.error(error)\\n                            else\\n                                console.log(\\\"exited!\\\")\\n                        },\\n                        onSuccess: function () {\\n                            console.log(\\\"success!\\\")\\n                        }\\n                    });\\n                $('#verify-button').on('click', function(e) {\\n                    handler.open();\\n                });\\n            })(jQuery);\\n        </script>\\n    </body>\\n</html>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Loader Script\",\n  \"body\": \"Always use the loading script from the URL we have supplied.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Widget Initialization Parameters\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"0-0\": \"`env`\",\n    \"0-1\": \"Defines which Wyre environment the widget operates against\\n\\nOptional, defaults to `\\\"prod\\\"`\",\n    \"1-0\": \"`auth`\",\n    \"1-1\": \"The authorization object that defines how the widget connects to a Wyre account\\n\\n**Required**\",\n    \"0-2\": \"`prod`: Our real environment, live at [sendwyre.com](https://www.sendwyre.com)\\n\\n`test`: Our partner testing environment, available at [testwyre.com](https://www.testwyre.com)\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Values\",\n    \"1-2\": \"See [authorization](doc:onboarding-ach-widget#authorization) below for details.\\n```\\nauth: {\\n   type: \\\"secretKey\\\",\\n   secretKey: deviceToken\\n},\\n```\",\n    \"2-0\": \"`operation`\",\n    \"2-2\": \"See [operation](doc:onboarding-ach-widget#operation) below for details\\n\\nExample: \\n```\\noperation: {\\n   type: \\\"onramp\\\",\\n   destCurrency: \\\"ETH\\\",\\n   dest: \\\"ethereum:0x\\\",\\n   sourceAmount: 10.0\\n},\\n```\",\n    \"2-1\": \"Defines the user operation to perform after on-boarding/compliance requirements have been achieved\\n\\n**Required**\",\n    \"3-0\": \"transferNotifyUrl\",\n    \"3-2\": \"Specify this parameter if you need to get webhook callbacks when transfer change status.\",\n    \"3-1\": \"Webhook callback Url for transfer updates.\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Authorization\"\n}\n[/block]\nProvided in the widget initialization object via the `auth` parameter, this object tells the widget how to form a connection with a Wyre account. The following table describes the different types of objects you may provide:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`metamask`\",\n    \"0-1\": \"Support for any customer with [Metamask](https://metamask.io/) installed\\n\\n`auth: { type: \\\"metamask\\\" }`\",\n    \"h-0\": \"Type\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"`secretKey`\",\n    \"1-1\": \"Secret key authorization uses a client-defined secret token to establish authentication. The token is intended to remain as a secret on the target device.\\n\\n[Parameter Details](doc:onboarding-ach-widget#section-secret-key-authentication)\",\n    \"h-2\": \"Details\",\n    \"1-2\": \"\",\n    \"0-2\": \"Example: \\n\\n`auth: {type: \\\"default\\\"}`\",\n    \"2-0\": \"`default`\",\n    \"2-1\": \"Presently a synonym for `\\\"metamask\\\"` but this may change in the future\\n\\n`auth: { type: \\\"default\\\" }`\",\n    \"3-0\": \"\",\n    \"3-1\": \"\",\n    \"4-1\": \"Signature-based handshake. Similar in theory to a web3 integration, except entirely over message-passing, without the need for a web3 implementation.\\n\\n*Coming soon, please contact [support:::at:::sendwyre.com](mailto:[email protected]) to let us know this would be helpful to you!*\",\n    \"4-0\": \"`signature`\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Secret Key Auth\nSecret key authentication is a form of bearer token authentication where the client generates its own secret token. This is useful in particular to clients that do not support web3. Example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var deviceToken = localStorage.getItem(\\\"DEVICE_TOKEN\\\");\\nif (!deviceToken) {\\n    var array = new Uint8Array(25);\\n    window.crypto.getRandomValues(array);\\n    deviceToken = Array.prototype.map\\n        .call(array, x => (\\\"00\\\" + x.toString(16)).slice(-2))\\n        .join(\\\"\\\");\\n    localStorage.setItem(\\\"DEVICE_TOKEN\\\", deviceToken);\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n```\nauth: {\n  type: \"secretKey\",\n  secretKey: deviceToken\n}\n```\n\nThe following table describes the attributes of the secret key auth object\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`type`\",\n    \"0-1\": \"Value: `\\\"secretKey\\\"`\\n\\n**Required**\",\n    \"1-0\": \"`secretKey`\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description / Value\",\n    \"1-1\": \"Supply a 25-35 character cryptographically random generated unique string which identifies the device being used\\n\\n**Required**\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Callback Events\"\n}\n[/block]\nThe widget will emit several different events at various points throughout its lifecycle. You can register an event handler like this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"onExit: function (error) {\\n    if (error != null)\\n        console.error(error)\\n    else\\n        console.log(\\\"exited!\\\")\\n},\\n  onSuccess: function () {\\n    console.log(\\\"success!\\\")\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Compliance On-Boarding\"\n}\n[/block]\nPresently, there is only available a single tier of US compliance available.\n[block:api-header]\n{\n  \"title\": \"Operation\"\n}\n[/block]\nAfter the compliance requirements have been met, the `operation` field of the initialization object defines the flow presented to the user.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`onramp`\",\n    \"h-2\": \"Parameters\",\n    \"h-0\": \"Type\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Directs your user to a KYC and ACH payment processing flow for a specific type of currency. The resulting purchased balanced can be sent to a blockchain address or a Wyre account. [details](doc:onboarding-ach-widget#section-onramp)\",\n    \"1-1\": \"After on-boarding has concluded, the widget will close with no further customer actions\",\n    \"1-0\": \"`none`\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Onramp (ACH)\nThe following table describes the valid attributes of the `onramp` operation object:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`type`\",\n    \"h-0\": \"Parameter\",\n    \"0-1\": \"`\\\"onramp\\\"` for ACH\",\n    \"1-0\": \"`destCurrency`\",\n    \"2-0\": \"`dest`\",\n    \"2-2\": \"**Required**\\n\\nExample ETH Address: \\n`\\\"ethereum:0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413\\\"`\\n\\nExample Wyre Account ID:\\n`\\\"account:AC-BAAA2222\\\"`\\n\\n*Note: * When setting a BTC address SRN as the dest make sure you use a valid address for the network you are attached to. For example, in our test environment use a valid testnet3 address, and in production use a valid main net address. For ETH, we use Kovan in test and and mainnet for production.\",\n    \"1-2\": \"**Required**\\n\\nExamples: `\\\"DAI\\\"`, `\\\"ETH\\\"`, `\\\"BTC\\\"`\",\n    \"1-1\": \"Specifies the currency to present for purchase to the user\",\n    \"0-2\": \"**Required**\",\n    \"2-1\": \"An [SRN](doc:srns) which is where the funds will be sent after the completes\",\n    \"3-0\": \"`destAmount` or `sourceAmount`\",\n    \"3-1\": \"`destAmount`\\nSpecifies the total amount of currency to deposit (as defined in `destCurrency`. \\n\\n`sourceAmount`\\nThe amount to withdrawal from the source, in units of sourceCurrency\",\n    \"3-2\": \"ACH - Optional\\n\\nOnly include sourceAmount OR destAmount, not both.\\n\\nIf a sourceAmount is not provided, an UI screen will allow the users to add an amount within the transaction limits.\",\n    \"4-0\": \"`sourceCurrency`\",\n    \"4-2\": \"ACH - **Optional**\\n\\nDefaults to USD\",\n    \"4-1\": \"Specifies the currency to draws funds from. Take a read [here](https://docs.sendwyre.com/docs/supported-currencies-1) for the supported source currencies.\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Value\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]","updates":[],"order":33,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5c0f3c0cde5eb8004ade42bf","project":"550f74bb6fc8130d0038aad3","version":{"version":"3","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded","5e8127d61c906800374eeb1c","5f2768c98622b8005106544a","5f2768d05702ca0011f7655e","5f276e5348d2b600321aef9b","5f276fd300e519001139200a","5f9a2cb79dafe500259281a7","5fd92bf362bb7301b00e48ba","60ef489344d5cf002cd7414d"],"_id":"550f75de61d9d30d00af9e01","__v":25,"releaseDate":"2015-03-23T02:09:34.221Z","project":"550f74bb6fc8130d0038aad3","createdAt":"2015-03-23T02:09:34.221Z","forked_from":"550f74bb6fc8130d0038aad6"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Wyre Checkout","slug":"wyre-sdk","order":3,"from_sync":false,"reference":true,"_id":"5bc63538e5a6ba000d22ee6d","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","createdAt":"2018-10-16T19:00:08.331Z","__v":1},"user":"54eb8076867e1917009b7160","createdAt":"2018-12-11T04:24:44.800Z","__v":0,"parentDoc":null}

Onboarding ACH Widget

Widgetized account and payment method creation

The Wyre Onboarding and ACH Widget allows you to quickly deploy a KYC/AML widget to your web-supporting application. This involves prompting the customer for their name and address, banking information, uploading any necessary documentation (such as passports scans or video authorizations). The result is a private, secure profile the customer may use to prove their compliance status and gain access to gated services. As a partner developer, you will not have direct access to the customer's personal information. The underlying personal information is exposed only in response to demands made to Wyre lawfully (or, in some cases, in support of security authorization). The widget may be deployed on a page within your dApp, within a traditional web application, in an embedded iOS WebView, or any other modern web engine view. By passing configuration parameters to the widget in Javascript when you initialize it, you may control its behavior and the resulting customer experience. Its operation has **three distinct phases**: **[Authorization](doc:onboarding-ach-widget#authorization)**: Allow the customer to form a secure session with Wyre. This might be done through a wallet browser extension, MetaMask, or device-held secret key. You have control over the scheme used. **[Compliance On-Boarding](doc:onboarding-ach-widget#compliance-on-boarding)**: Request information from the customer in order to meet some specific level of compliance for a particular country. This will vary depending on your payment method used. ACH will require more information than a debit card flow. **[User Operation](doc:onboarding-ach-widget#operation)**: The flow presented to the user after on-boarding is complete. Presently, only `"onramp"` is available, which enables the user to withdraw fiat funds from a bank account, convert them into a specific target currency, and finally transfer them to a blockchain address or Wyre account. Once the widget has concluded, it provides hooks to let you know it's complete, and why. It may close preemptively due to error, or because the user closed it. When it completes successfully, you may proceed with the assurance that Wyre knows the customer and holds evidence to prove it. [block:api-header] { "title": "Widget Loader Example" } [/block] [block:code] { "codes": [ { "code": "<html>\n <head>\n <title>Verify with Wyre</title>\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\" integrity=\"sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO\" crossorigin=\"anonymous\">\n\n </head>\n <body>\n <div class=\"container\">\n <button id=\"verify-button\" class=\"btn btn-primary mt-5\">Verify with Wyre</button>\n </div>\n\n <script src=\"https://code.jquery.com/jquery-3.3.1.slim.min.js\" integrity=\"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\" crossorigin=\"anonymous\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js\" integrity=\"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49\" crossorigin=\"anonymous\"></script>\n <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\" integrity=\"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy\" crossorigin=\"anonymous\"></script>\n <script src=\"https://verify.sendwyre.com/js/verify-module-init.js\"></script>\n <script type=\"text/javascript\">\n (function($) {\n var deviceToken = localStorage.getItem(\"DEVICE_TOKEN\");\n if (!deviceToken) {\n var array = new Uint8Array(25);\n window.crypto.getRandomValues(array);\n deviceToken = Array.prototype.map\n .call(array, x => (\"00\" + x.toString(16)).slice(-2))\n .join(\"\");\n localStorage.setItem(\"DEVICE_TOKEN\", deviceToken);\n }\n var handler = new Wyre({\n env: \"prod\",//or \"test\"\n auth: {\n type: \"secretKey\",\n secretKey: deviceToken\n },\n operation: {\n type: \"onramp\",\n destCurrency: \"ETH\",\n dest: \"ethereum:0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413\",\n sourceAmount: 10.0\n },\n onExit: function (error) {\n if (error != null)\n console.error(error)\n else\n console.log(\"exited!\")\n },\n onSuccess: function () {\n console.log(\"success!\")\n }\n });\n $('#verify-button').on('click', function(e) {\n handler.open();\n });\n })(jQuery);\n </script>\n </body>\n</html>", "language": "html" } ] } [/block] [block:callout] { "type": "info", "title": "Loader Script", "body": "Always use the loading script from the URL we have supplied." } [/block] [block:api-header] { "title": "Widget Initialization Parameters" } [/block] [block:parameters] { "data": { "h-0": "Parameter", "0-0": "`env`", "0-1": "Defines which Wyre environment the widget operates against\n\nOptional, defaults to `\"prod\"`", "1-0": "`auth`", "1-1": "The authorization object that defines how the widget connects to a Wyre account\n\n**Required**", "0-2": "`prod`: Our real environment, live at [sendwyre.com](https://www.sendwyre.com)\n\n`test`: Our partner testing environment, available at [testwyre.com](https://www.testwyre.com)", "h-1": "Description", "h-2": "Values", "1-2": "See [authorization](doc:onboarding-ach-widget#authorization) below for details.\n```\nauth: {\n type: \"secretKey\",\n secretKey: deviceToken\n},\n```", "2-0": "`operation`", "2-2": "See [operation](doc:onboarding-ach-widget#operation) below for details\n\nExample: \n```\noperation: {\n type: \"onramp\",\n destCurrency: \"ETH\",\n dest: \"ethereum:0x\",\n sourceAmount: 10.0\n},\n```", "2-1": "Defines the user operation to perform after on-boarding/compliance requirements have been achieved\n\n**Required**", "3-0": "transferNotifyUrl", "3-2": "Specify this parameter if you need to get webhook callbacks when transfer change status.", "3-1": "Webhook callback Url for transfer updates." }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "title": "Authorization" } [/block] Provided in the widget initialization object via the `auth` parameter, this object tells the widget how to form a connection with a Wyre account. The following table describes the different types of objects you may provide: [block:parameters] { "data": { "0-0": "`metamask`", "0-1": "Support for any customer with [Metamask](https://metamask.io/) installed\n\n`auth: { type: \"metamask\" }`", "h-0": "Type", "h-1": "Description", "1-0": "`secretKey`", "1-1": "Secret key authorization uses a client-defined secret token to establish authentication. The token is intended to remain as a secret on the target device.\n\n[Parameter Details](doc:onboarding-ach-widget#section-secret-key-authentication)", "h-2": "Details", "1-2": "", "0-2": "Example: \n\n`auth: {type: \"default\"}`", "2-0": "`default`", "2-1": "Presently a synonym for `\"metamask\"` but this may change in the future\n\n`auth: { type: \"default\" }`", "3-0": "", "3-1": "", "4-1": "Signature-based handshake. Similar in theory to a web3 integration, except entirely over message-passing, without the need for a web3 implementation.\n\n*Coming soon, please contact [[email protected]](mailto:[email protected]com) to let us know this would be helpful to you!*", "4-0": "`signature`" }, "cols": 2, "rows": 2 } [/block] ## Secret Key Auth Secret key authentication is a form of bearer token authentication where the client generates its own secret token. This is useful in particular to clients that do not support web3. Example: [block:code] { "codes": [ { "code": "var deviceToken = localStorage.getItem(\"DEVICE_TOKEN\");\nif (!deviceToken) {\n var array = new Uint8Array(25);\n window.crypto.getRandomValues(array);\n deviceToken = Array.prototype.map\n .call(array, x => (\"00\" + x.toString(16)).slice(-2))\n .join(\"\");\n localStorage.setItem(\"DEVICE_TOKEN\", deviceToken);\n}", "language": "javascript" } ] } [/block] ``` auth: { type: "secretKey", secretKey: deviceToken } ``` The following table describes the attributes of the secret key auth object [block:parameters] { "data": { "0-0": "`type`", "0-1": "Value: `\"secretKey\"`\n\n**Required**", "1-0": "`secretKey`", "h-0": "Parameter", "h-1": "Description / Value", "1-1": "Supply a 25-35 character cryptographically random generated unique string which identifies the device being used\n\n**Required**" }, "cols": 2, "rows": 2 } [/block] [block:api-header] { "title": "Callback Events" } [/block] The widget will emit several different events at various points throughout its lifecycle. You can register an event handler like this: [block:code] { "codes": [ { "code": "onExit: function (error) {\n if (error != null)\n console.error(error)\n else\n console.log(\"exited!\")\n},\n onSuccess: function () {\n console.log(\"success!\")\n}", "language": "javascript" } ] } [/block] [block:api-header] { "title": "Compliance On-Boarding" } [/block] Presently, there is only available a single tier of US compliance available. [block:api-header] { "title": "Operation" } [/block] After the compliance requirements have been met, the `operation` field of the initialization object defines the flow presented to the user. [block:parameters] { "data": { "0-0": "`onramp`", "h-2": "Parameters", "h-0": "Type", "h-1": "Description", "0-1": "Directs your user to a KYC and ACH payment processing flow for a specific type of currency. The resulting purchased balanced can be sent to a blockchain address or a Wyre account. [details](doc:onboarding-ach-widget#section-onramp)", "1-1": "After on-boarding has concluded, the widget will close with no further customer actions", "1-0": "`none`" }, "cols": 2, "rows": 2 } [/block] ## Onramp (ACH) The following table describes the valid attributes of the `onramp` operation object: [block:parameters] { "data": { "0-0": "`type`", "h-0": "Parameter", "0-1": "`\"onramp\"` for ACH", "1-0": "`destCurrency`", "2-0": "`dest`", "2-2": "**Required**\n\nExample ETH Address: \n`\"ethereum:0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413\"`\n\nExample Wyre Account ID:\n`\"account:AC-BAAA2222\"`\n\n*Note: * When setting a BTC address SRN as the dest make sure you use a valid address for the network you are attached to. For example, in our test environment use a valid testnet3 address, and in production use a valid main net address. For ETH, we use Kovan in test and and mainnet for production.", "1-2": "**Required**\n\nExamples: `\"DAI\"`, `\"ETH\"`, `\"BTC\"`", "1-1": "Specifies the currency to present for purchase to the user", "0-2": "**Required**", "2-1": "An [SRN](doc:srns) which is where the funds will be sent after the completes", "3-0": "`destAmount` or `sourceAmount`", "3-1": "`destAmount`\nSpecifies the total amount of currency to deposit (as defined in `destCurrency`. \n\n`sourceAmount`\nThe amount to withdrawal from the source, in units of sourceCurrency", "3-2": "ACH - Optional\n\nOnly include sourceAmount OR destAmount, not both.\n\nIf a sourceAmount is not provided, an UI screen will allow the users to add an amount within the transaction limits.", "4-0": "`sourceCurrency`", "4-2": "ACH - **Optional**\n\nDefaults to USD", "4-1": "Specifies the currency to draws funds from. Take a read [here](https://docs.sendwyre.com/docs/supported-currencies-1) for the supported source currencies.", "h-1": "Description", "h-2": "Value" }, "cols": 3, "rows": 5 } [/block]