diff --git a/.circleci/config.yml b/.circleci/config.yml index 86746e5dc2ab..c7e50f7c42d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,6 +70,7 @@ commands: - "packages/hooks/node_modules" - "packages/cfd/node_modules" - "packages/indicators/node_modules" + - "packages/integration/node_modules" - "packages/p2p/node_modules" - "packages/reports/node_modules" - "packages/shared/node_modules" @@ -271,6 +272,9 @@ jobs: - run: name: "Check TypeScript for @deriv/stores" command: npx tsc --project packages/stores/tsconfig.json -noEmit + - run: + name: "Check TypeScript for @deriv/integration" + command: npx tsc --project packages/integration/tsconfig.json -noEmit # - run: # name: "Check TypeScript for @deriv/cashier" # command: npx tsc --project packages/cashier/tsconfig.json -noEmit @@ -283,6 +287,9 @@ jobs: - run: name: "Check tests for @deriv/analytics" command: bash ./scripts/check-tests.sh packages/analytics/src + # - run: + # name: "Check tests for @deriv/integration" + # command: bash ./scripts/check-tests.sh packages/integration/src - build - run: name: "Run tests" diff --git a/end-to-end-test/.github/workflows/playwright.yml b/.github/workflows/playwright.yml similarity index 90% rename from end-to-end-test/.github/workflows/playwright.yml rename to .github/workflows/playwright.yml index f5138e1f1c5d..90b6b700d4fe 100644 --- a/end-to-end-test/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [ master ] + branches: [ main, master ] pull_request: - branches: [ master ] + branches: [ main, master ] jobs: test: timeout-minutes: 60 diff --git a/.gitignore b/.gitignore index 53be93a5a629..e1543300d1db 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ packages/appstore/lib/ packages/appstore/.out .env nx-cloud.env - +/test-results/ +/playwright-report/ +/playwright/.cache/ diff --git a/end-to-end-test/.env.example b/end-to-end-test/.env.example deleted file mode 100644 index 063f3a2b06a2..000000000000 --- a/end-to-end-test/.env.example +++ /dev/null @@ -1,16 +0,0 @@ -# To have needed env variables you need to make a copy out of this file and rename it to `.env` -# you can change any of values listed here to your desired ones -# also you can pass any environment variable to this file and have access to them using `process.env.[ENVIRONMENT_VARIABLE_NAME] (eg. process.env.APPID) -ENDPOINT_PAGE_APP_STORE=false -ENDPOINT_PAGE_DBOT_DASHBOARD=false -ENDPOINT_PAGE_DEBUG_SERVICE_WORKER=false -APPID= -ENDPOINT= -APP_URL= -QA_EMAIL_INBOX_USER_NAME= -QA_EMAIL_INBOX_PASSWORD = -ACCOUNT_RESIDENCE_HIGH_RISK= -ACCOUNT_CITIZENSHIP_HIGH_RISK= -ACCOUNT_RESIDENCE_LOW_RISK= -ACCOUNT_CITIZENSHIP_LOW_RISK= -RISK_LEVEL=low_risk # This stores the risk level that can be either high_risk or low_risk diff --git a/end-to-end-test/.gitignore b/end-to-end-test/.gitignore deleted file mode 100644 index 75e854d8dcf7..000000000000 --- a/end-to-end-test/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -/test-results/ -/playwright-report/ -/playwright/.cache/ diff --git a/end-to-end-test/README.md b/end-to-end-test/README.md deleted file mode 100644 index 8bd0390d5226..000000000000 --- a/end-to-end-test/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Deriv App End to End test - -This directory is just to implement and run the E2E tests over the app. - -This uses [playwright](https://playwright.dev/) as its main framework and you can simply write test with it. -We strongly suggest you to read the [documentation](https://playwright.dev/docs/intro) of playwright once before you get started. - -## Run the test cases - -To run the End to End test you need to first install playwright on your machine using: - -`npx install playwright` to install the dependencies on your machine. - -then - -`npx playwright test` to start the tests to run. (You also can pass `--debug` option to this command to it to run them in headless browser and check them visually separated by different browsers eg. Chromium, Firefox or Edge) - -`npm run test:e2e` to run the tests from within the root `directory`. - -`npm run test:e2e-dev` to run the tests from within the root `directory` with trace enabled and show the test report. - -## Project structure - -### `.env` file - -It's mandatory to create this file to pass the needed environment variables to the framework to run the tests. The defined variables are these - -| # | Env Variable Name | Functionality | Type | Required | -| --- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | -| 1 | `ENDPOINT_PAGE_APP_STORE` | This variable enables the AppStore in the `AppURL/endpoint` page | Boolean | | -| 2 | `ENDPOINT_PAGE_DBOT_DASHBOARD` | enables the DBot dashboard in the `AppURL/endpoint` page | Boolean | | -| 3 | `ENDPOINT_PAGE_DEBUG_SERVICE_WORKER` | enables the Debug service worker in the `AppURL/endpoint` page | Boolean | | -| 4 | `APPID` | App ID of the qabox that we want to test with, On local machine it should be `9999` to redirect to localhost.binary.sx after sign up(Company convention) | Number | \* | -| 5 | `ENDPOINT` | Endpoint of qabox server | String | \* | -| 6 | `APP_URL` | App URL which tests should run on. Local machine URL is `localhost.binary.sx` | String | \* | -| 7 | `QA_EMAIL_INBOX_USER_NAME` | Username of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* | -| 8 | `QA_EMAIL_INBOX_PASSWORD` | Password of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* | -| 9 | `ACCOUNT_RESIDENCE_HIGH_RISK` | Account residence to use when creating high risk accounts it | String | \* | -| 10 | `ACCOUNT_RESIDENCE_LOW_RISK` | Account residence to use when creating low risk accounts | String | \* | -| 11 | `ACCOUNT_CITIZENSHIP_HIGH_RISK` | Account citizenship to use when creating high risk accounts | String | \* | -| 12 | `ACCOUNT_CITIZENSHIP_LOW_RISK` | Account citizenship to use when creating low risk accounts | String | \* | -| 13 | `RISK_LEVEL` | Risk level for the particular account i.e. high risk or low risk | String | \* | - -### `onboarding.ts` file - -This is the main components which runs before any test suit runs, the main goal of this is to create one account for all of the test cases, save it to a context and use the created context in all of the browsers and before all of the test cases start to run. -`global-setup.ts` runs the mentioned onboarding flow and save the state. Refer to `globalSetup` option in `plauwright.config.ts` to see how its bound to the app. - -So in each test suit that you want to write you need to worry that if you are logged in or not. You just need to get the page from `describe` method like below: - -``` -import { test, expect } from '@playwright/test'; - -test.describe('Change endpoint, Signup and login', () => { - test('Should change the endpoint and sign up', async ({ page }) => { - await page.goto(process.env.APP_URL!); - // now we are logged in to the app and ready to test. YAY! - await expect(page).toHaveTitle('Trader | Deriv'); - // created a new user account and logged in - // Also you can get access to created email account name using `process.env.email` - }); -}); -``` diff --git a/end-to-end-test/global-setup.ts b/end-to-end-test/global-setup.ts deleted file mode 100644 index 8ffa6efe69e2..000000000000 --- a/end-to-end-test/global-setup.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { chromium, FullConfig } from '@playwright/test'; -import OnboardingFlow from './tests/onboarding/onboarding'; - -async function globalSetup(config: FullConfig) { - const browser = await chromium.launch(); - const page = await browser.newPage({ - ignoreHTTPSErrors: true, - httpCredentials: { - username: `${process.env.QA_EMAIL_INBOX_USER_NAME}`, - password: `${process.env.QA_EMAIL_INBOX_PASSWORD}`, - }, - }); - const onboarding = new OnboardingFlow(page); - await onboarding.signUp(); - await page.context().storageState({ path: '/tmp/storage-state.json' }); - await browser.close(); -} -export default globalSetup; diff --git a/end-to-end-test/package.json b/end-to-end-test/package.json deleted file mode 100644 index ca933001abb8..000000000000 --- a/end-to-end-test/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "end-to-end-test", - "version": "1.0.0", - "description": "", - "scripts": { - "test": "npx playwright test" - }, - "keywords": [], - "author": "", - "license": "ISC", - "eslintConfig": { - "rules": { - "testing-library/no-await-sync-query": "off", - "testing-library/prefer-screen-queries": "off" - } - }, - "dependencies": { - "dotenv": "^16.0.3", - "@playwright/test": "^1.33.0" - } -} diff --git a/end-to-end-test/playwright.config.ts b/end-to-end-test/playwright.config.ts deleted file mode 100644 index 01f7c939eb17..000000000000 --- a/end-to-end-test/playwright.config.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { PlaywrightTestConfig } from '@playwright/test'; -import { devices } from '@playwright/test'; -import { config as dotenvConf } from 'dotenv'; - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -dotenvConf(); -// globalSetup: process.env.CI ? undefined : require.resolve('./global-setup'), - -/** - * See https://playwright.dev/docs/test-configuration. - */ -const config: PlaywrightTestConfig = { - globalSetup: process.env.CI ? undefined : require.resolve('./global-setup'), - testDir: './tests', - /* Maximum time one test can run for. */ - timeout: 100 * 1000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 5000, - }, - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - storageState: '/tmp/storage-state.json', - ignoreHTTPSErrors: true, - - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 0, - /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: process.env.CI ? process.env.test_link : 'https://localhost.binary.sx', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { - ignoreHTTPSErrors: true, - ...devices['Desktop Chrome'], - }, - }, - - // { - // name: 'firefox', - // use: { - // ignoreHTTPSErrors: true, - // ...devices['Desktop Firefox'], - // }, - // }, - - // { - // name: 'webkit', - // use: { - // ignoreHTTPSErrors: true, - // ...devices['Desktop Safari'], - // }, - // }, - - // /* Test against mobile viewports. */ - // // { - // // name: 'Mobile Chrome', - // // use: { - // // ...devices['Pixel 5'], - // // }, - // // }, - // // { - // // name: 'Mobile Safari', - // // use: { - // // ...devices['iPhone 12'], - // // }, - // // }, - - // /* Test against branded browsers. */ - // // { - // // name: 'Microsoft Edge', - // // use: { - // // channel: 'msedge', - // // }, - // // }, - // // { - // // name: 'Google Chrome', - // // use: { - // // channel: 'chrome', - // // }, - // // }, - ], - - /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - // outputDir: 'test-results/', - - /* Run your local dev server before starting the tests */ - webServer: { - command: 'cd .. && npm run serve core', - url: 'https://localhost.binary.sx/', - ignoreHTTPSErrors: true, - reuseExistingServer: true, - }, -}; - -export default config; diff --git a/end-to-end-test/tests/change-endpoint/change-endpoint.tsx b/end-to-end-test/tests/change-endpoint/change-endpoint.tsx deleted file mode 100644 index 2ffea42a3803..000000000000 --- a/end-to-end-test/tests/change-endpoint/change-endpoint.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { expect, Page } from '@playwright/test'; - -export default class ChangeEndpoint { - readonly page: Page; - - constructor(page: Page) { - this.page = page; - } - async cookieDialogHandler() { - const elem = this.page.locator('.cookie-banner'); - if (await elem.isVisible()) - await this.page.locator('.cookie-banner > button[type=submit]', { hasText: /Accept/ }).click(); - } - - async changeEndpoint() { - await this.page.goto(process.env.APP_URL!); - await expect(this.page).toHaveTitle('Trader | Deriv'); - await this.cookieDialogHandler(); - await this.page.goto(`${process.env.APP_URL!}/endpoint`); - await this.page.waitForSelector( - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field' - ); - await this.page.click( - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field' - ); - - await this.page.waitForSelector( - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field' - ); - await this.page.click( - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field' - ); - - await this.page.waitForSelector( - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field' - ); - const first_input_selector = - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(2) > .dc-input__container > .dc-input__field'; - await this.page.click(first_input_selector, { clickCount: 3 }); - await this.page.keyboard.press('Backspace'); - - await this.page.click(first_input_selector); - - await this.page.type(first_input_selector, process.env.ENDPOINT!); - const second_input_selector = - '#app_contents > .dc-themed-scrollbars > form > .dc-input:nth-child(3) > .dc-input__container > .dc-input__field'; - await this.page.click(second_input_selector, { clickCount: 3 }); - await this.page.keyboard.press('Backspace'); - await this.page.type(second_input_selector, process.env.APPID!); - if ( - !(await this.page.locator("input[name='is_appstore_enabled']").isChecked()) && - process.env.ENDPOINT_PAGE_APP_STORE === 'true' - ) { - await this.page.click('.dc-themed-scrollbars > form > div:nth-child(4) > .dc-checkbox > .dc-checkbox__box'); - } - if ( - !(await this.page.locator("input[name='show_dbot_dashboard']").isChecked()) && - process.env.ENDPOINT_PAGE_DBOT_DASHBOARD === 'true' - ) { - await this.page.click('.dc-themed-scrollbars > form > div:nth-child(5) > .dc-checkbox > .dc-checkbox__box'); - } - if ( - !(await this.page.locator("input[name='is_debug_service_worker_enabled']").isChecked()) && - process.env.ENDPOINT_PAGE_DEBUG_SERVICE_WORKER === 'true' - ) { - await this.page.click('.dc-themed-scrollbars > form > div:nth-child(6) > .dc-checkbox > .dc-checkbox__box'); - } - - await this.page.waitForSelector('#deriv_app > #app_contents > .dc-themed-scrollbars > form > .dc-btn--primary'); - await this.page.click('#deriv_app > #app_contents > .dc-themed-scrollbars > form > .dc-btn--primary'); - } -} diff --git a/end-to-end-test/tests/onboarding/onboarding.ts b/end-to-end-test/tests/onboarding/onboarding.ts deleted file mode 100644 index 0fa449f06e47..000000000000 --- a/end-to-end-test/tests/onboarding/onboarding.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { Page, expect, chromium } from '@playwright/test'; -import { suspend } from '../../utils'; -import ChangeEndpoint from '../change-endpoint/change-endpoint'; - -export default class OnboardingFlow { - readonly page: Page; - readonly ChangeEndpoint: ChangeEndpoint; - readonly email: string; - private signupPage: Page | null; - - constructor(page: Page) { - const randomString = new Date().getTime(); - this.page = page; - this.email = `deriv-fe-e2e-${randomString}@deriv.com`; - this.signupPage = null; - this.ChangeEndpoint = new ChangeEndpoint(page); - } - - async updateServerURLAndAppIDInLocalStorage() { - const server = process.env.ENDPOINT; - const app_id = process.env.APPID; - await this?.signupPage?.evaluate(`localStorage.setItem('config.server_url', '${server}');`); - await this?.signupPage?.evaluate(`localStorage.setItem('config.app_id', '${app_id}');`); - await this?.signupPage?.evaluate(`window.location.reload();`); - const server_url = await this?.signupPage?.evaluate(() => { - const result = localStorage.getItem('config.server_url'); - return Promise.resolve(result); - }); - expect(server_url).toBe(process.env.ENDPOINT); - await suspend(1000); - } - async demoWizardHandler() { - await this.page.locator('.static-dashboard-wrapper__header > h2', { hasText: 'CFDs' }); - await this.page.locator('.static-dashboard-wrapper__header > h2', { hasText: 'Multipliers' }); - await this.page.locator('button[type="submit"]', { hasText: 'Next' }).click(); - await this.page.locator('button[type="submit"]', { hasText: 'Next' }).click(); - await this.page.locator('button[type="submit"]', { hasText: 'Next' }).click(); - await this.page.locator('button[type="submit"]', { hasText: 'Next' }).click(); - } - async signUp() { - await this.ChangeEndpoint.changeEndpoint(); - await this.page.goto(process.env.APP_URL!); - await this.page.waitForSelector('#dt_signup_button'); - const [newPage] = await Promise.all([ - this.page.context().waitForEvent('page'), // get `context` by destructuring with `page` in the test params; 'page' is a built-in event, and **you must wait for this like this,**, or `newPage` will just be the response object, rather than an actual Playwright page object. - await this.page.click('#dt_signup_button'), - ]); - this.signupPage = newPage; - await suspend(10000); - await this.updateServerURLAndAppIDInLocalStorage(); - await this.signupPage.waitForLoadState(); - await this.signupPage.locator('input[name=email]#dm-email-input').isVisible(); - await this.signupPage.locator('input[name=email]#dm-email-input').type(this.email); - process.env.email = this.email; - await this.signupPage.locator('//*[@id="gatsby-focus-wrapper"]/main/section/form/div/label/div'); - await this.signupPage.locator('//*[@id="gatsby-focus-wrapper"]/main/section/form/div/label/div').click(); - await this.signupPage.waitForSelector('#dm-new-signup'); - await this.signupPage.click('#dm-new-signup'); - const browser = await chromium.launch(); - const mailPage = await browser.newPage({ - ignoreHTTPSErrors: true, - httpCredentials: { - username: `${process.env.QA_EMAIL_INBOX_USER_NAME}`, - password: `${process.env.QA_EMAIL_INBOX_PASSWORD}`, - }, - }); - await mailPage.goto(`https://${process.env.ENDPOINT!}/events`); - let hrefs = await mailPage.evaluate(() => { - return Array.from(document.links) - .filter(item => item.href.endsWith('_account_opening_new.html')) - .map(item => item.href); - }); - hrefs = hrefs.slice().reverse(); - // TODO need to find a better approach instead of this - // eslint-disable-next-line no-restricted-syntax - for await (const item of hrefs) { - await mailPage.goto(item); - if (await mailPage.getByText(this.email).isVisible()) { - const element = await mailPage.locator('a', { hasText: 'redirect?action=signup' }); - const val = await element.getAttribute('href'); - if (val) await this.page.goto(val); - await mailPage.close(); - await this.signupPage.close(); - break; - } - } - - this.page.waitForSelector('#dt_core_set-residence-form_signup-residence-select').then(async () => { - await this.page.click('#dt_core_set-residence-form_signup-residence-select'); - }); - - const RISK_LEVEL = process.env.RISK_LEVEL; - - const ACCOUNT_CITIZENSHIP = - (RISK_LEVEL === 'low_risk' - ? process.env.ACCOUNT_CITIZENSHIP_LOW_RISK - : process.env.ACCOUNT_CITIZENSHIP_HIGH_RISK) || ''; - - const ACCOUNT_RESIDENCE = - (RISK_LEVEL === 'low_risk' - ? process.env.ACCOUNT_RESIDENCE_LOW_RISK - : process.env.ACCOUNT_RESIDENCE_HIGH_RISK) || ''; - - await expect(this.page.getByText(ACCOUNT_RESIDENCE)).toBeVisible(); - await this.page.getByText(ACCOUNT_RESIDENCE).click(); - await this.page.click('#dt_core_set-citizenship-form_signup-citizenship-select'); - await expect(this.page.getByText(ACCOUNT_CITIZENSHIP)).toBeVisible(); - await this.page.getByText(ACCOUNT_CITIZENSHIP).click(); - await this.page.getByRole('dialog').getByRole('button', { name: 'Next' }).click(); - await expect(this.page.getByText(/Keep your account secure/)).toBeVisible(); - await this.page.locator('#dt_core_account-signup-modal_account-signup-password-field'); - await expect(this.page.getByText(/Start trading/)).toBeDisabled(); - await this.page.locator('#dt_core_account-signup-modal_account-signup-password-field').type('Abcd2134'); - await expect(this.page.getByText(/Start trading/)).toBeEnabled(); - await this.page.getByText(/Start trading/).click(); - if (this.page.url().includes('onboarding')) await this.demoWizardHandler(); - } -} diff --git a/end-to-end-test/tests/sample-test/buy.spec.tsx b/end-to-end-test/tests/sample-test/buy.spec.tsx deleted file mode 100644 index 99d20438e45b..000000000000 --- a/end-to-end-test/tests/sample-test/buy.spec.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test.describe('Should signup and logged in, in the app', () => { - test('Title should be "Trader | Deriv"', async ({ page }) => { - await page.goto(process.env.APP_URL!); - // now we are logged in to the app and ready to write tests - await expect(page).toHaveTitle('Trader | Deriv'); - }); -}); diff --git a/end-to-end-test/tests/traders-hub/dashboard-demo.spec.tsx b/end-to-end-test/tests/traders-hub/dashboard-demo.spec.tsx deleted file mode 100644 index 101b39872100..000000000000 --- a/end-to-end-test/tests/traders-hub/dashboard-demo.spec.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { test, expect } from '@playwright/test'; -import { TRADERS_HUB_URL, switchAccountType } from '../../utils'; - -test.describe("Trader's Hub Dashboard", () => { - test.beforeEach(async ({ page }) => { - await page.goto(TRADERS_HUB_URL); - }); - test('It should switch from Demo to Real', async ({ page }) => { - await switchAccountType(page, 'Demo', 'Real'); - const get_deriv_account_button = await page.getByText('Get a Deriv account').first(); - expect(get_deriv_account_button).toBeDefined(); - }); -}); diff --git a/end-to-end-test/tests/traders-hub/dashboard-real.spec.tsx b/end-to-end-test/tests/traders-hub/dashboard-real.spec.tsx deleted file mode 100644 index 46e30c3ce60c..000000000000 --- a/end-to-end-test/tests/traders-hub/dashboard-real.spec.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { test, expect } from '@playwright/test'; -import { TRADERS_HUB_URL, switchAccountType } from '../../utils'; - -test.describe("Trader's Hub Dashboard", () => { - const HIGH_RISK_MULTIPLIER_TEXT = 'text=Multipliers trading platform.'; - const LOW_RISK_MULTIPLIER_TEXT = 'text=Options and multipliers trading platform.'; - test.beforeEach(async ({ page }) => { - await page.goto(TRADERS_HUB_URL); - await switchAccountType(page, 'Demo', 'Real'); - }); - - test('It should switch from Real to Demo', async ({ page }) => { - await switchAccountType(page, 'Real', 'Demo'); - const demo_count = await page.getByText(/Demo/).count(); - expect(demo_count).toBeGreaterThanOrEqual(1); - }); - - test('It should have the regulator switcher for low risk and no regulator switcher for high risk', async ({ - page, - }) => { - const regulator_switcher = await page.getByText('Regulation:').count(); - if (process.env.RISK_LEVEL === 'low_risk') { - expect(regulator_switcher).toEqual(1); - } else { - expect(regulator_switcher).toEqual(0); - } - }); - - test('It should switch to EU for low risk', async ({ page }) => { - if (process.env.RISK_LEVEL === 'low_risk') { - await page.getByText('EU', { exact: true }).first().click(); - expect(await page.locator(HIGH_RISK_MULTIPLIER_TEXT)).toBeDefined(); - } - }); - - test('It should show Non-EU content for low risk and EU content for high risk on load', async ({ page }) => { - if (process.env.RISK_LEVEL === 'low_risk') { - expect(await page.locator(LOW_RISK_MULTIPLIER_TEXT)).toBeDefined(); - } else { - expect(await page.locator(HIGH_RISK_MULTIPLIER_TEXT)).toBeDefined(); - } - }); -}); diff --git a/end-to-end-test/utils/helpers.ts b/end-to-end-test/utils/helpers.ts deleted file mode 100644 index dd264f3d51fe..000000000000 --- a/end-to-end-test/utils/helpers.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Page } from '@playwright/test'; - -export const switchAccountType = async (page: Page, from_type: string, to_type: string) => { - await page.waitForLoadState('domcontentloaded'); - await page.waitForSelector('.account-type-dropdown--parent', { timeout: 0 }); - await page.waitForSelector(`.account-type-dropdown--${from_type.toLowerCase()}`, { timeout: 0 }); - await page.getByTestId('dti_dropdown_display').getByText(from_type).click({ timeout: 0 }); - await page.locator(`#${to_type.toLocaleLowerCase()}`).click(); - await page.waitForLoadState('domcontentloaded'); -}; diff --git a/end-to-end-test/utils/index.ts b/end-to-end-test/utils/index.ts deleted file mode 100644 index 0d04acd1c841..000000000000 --- a/end-to-end-test/utils/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { TRADERS_HUB_URL } from './constants'; -import { switchAccountType } from './helpers'; -import suspend from './suspend/suspend'; - -export { TRADERS_HUB_URL, switchAccountType, suspend }; diff --git a/package-lock.json b/package-lock.json index 1432aab42fc0..55e98d9d5f3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "@types/qrcode.react": "^1.0.2", "@types/react-loadable": "^5.5.6", "@types/react-transition-group": "^4.4.4", + "@types/ws": "^8.5.5", "@xmldom/xmldom": "^0.8.4", "acorn": "^6.1.1", "babel-core": "^6.26.3", @@ -151,6 +152,7 @@ "sass-loader": "^12.6.0", "sass-resources-loader": "^2.1.1", "scratch-blocks": "0.1.0-prerelease.20200917235131", + "selfsigned": "^2.1.1", "shx": "^0.3.2", "source-map-loader": "^1.1.2", "style-loader": "^1.2.1", @@ -168,6 +170,7 @@ "webpack-manifest-plugin": "^4.0.2", "webpack-node-externals": "^2.5.2", "workbox-webpack-plugin": "^6.0.2", + "ws": "^8.13.0", "yup": "^0.32.11" }, "devDependencies": { @@ -190,6 +193,7 @@ "@deriv/eslint-config-deriv": "^1.0.0-beta.3", "@jest/globals": "^26.5.3", "@nrwl/nx-cloud": "latest", + "@playwright/test": "^1.37.1", "@testing-library/jest-dom": "^5.12.0", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^7.0.2", @@ -1960,9 +1964,9 @@ } }, "node_modules/@babel/standalone": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.22.10.tgz", - "integrity": "sha512-VmK2sWxUTfDDh9mPfCtFJPIehZToteqK+Zpwq8oJUjJ+WeeKIFTTQIrDzH7jEdom+cAaaguU7FI/FBsBWFkIeQ==", + "version": "7.22.12", + "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.22.12.tgz", + "integrity": "sha512-Od5EnOR/gvwwvLCaJCypkVW6C9PitK2tu/aHb+ZpPnwkVidmlJ+7jUf8YLm9BrNILfT9P8etZq/t6r1IrFauQw==", "engines": { "node": ">=6.9.0" } @@ -2863,9 +2867,9 @@ } }, "node_modules/@deriv/api-types": { - "version": "1.0.118", - "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.118.tgz", - "integrity": "sha512-+q/PEH/O3wRrJlDQWl8x03JCBhQQBZt343maDqDRAM//H2K7h4YT5ucnYHJiS+6xu5jGGeq7JR8lT4R14mfd3Q==" + "version": "1.0.120", + "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.120.tgz", + "integrity": "sha512-XorPckacsTVUsM2RN4jAUbuUgFDXLcSpGpqqBasvLG2ziZSqSbq1Nii6dxWXIdjUcj4dnGaM/z9uYCbNyN+1LA==" }, "node_modules/@deriv/deriv-api": { "version": "1.0.13", @@ -3083,9 +3087,9 @@ } }, "node_modules/@devtools-ds/themes/node_modules/@design-systems/utils/node_modules/@babel/runtime": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", - "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", + "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -7240,6 +7244,25 @@ "typescript": "^3 || ^4" } }, + "node_modules/@playwright/test": { + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.37.1.tgz", + "integrity": "sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "playwright-core": "1.37.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.11", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz", @@ -9593,9 +9616,9 @@ "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, "node_modules/@storybook/builder-webpack4/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/builder-webpack4/node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -10888,9 +10911,9 @@ } }, "node_modules/@storybook/builder-webpack5/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/builder-webpack5/node_modules/colorette": { "version": "1.4.0", @@ -11315,9 +11338,9 @@ } }, "node_modules/@storybook/core-common/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/core-common/node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -12139,9 +12162,9 @@ } }, "node_modules/@storybook/core-server/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/core-server/node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -13062,9 +13085,9 @@ "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, "node_modules/@storybook/manager-webpack4/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/manager-webpack4/node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -14342,9 +14365,9 @@ } }, "node_modules/@storybook/manager-webpack5/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/manager-webpack5/node_modules/ansi-styles": { "version": "4.3.0", @@ -14856,9 +14879,9 @@ "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==" }, "node_modules/@storybook/react/node_modules/@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "node_modules/@storybook/react/node_modules/acorn": { "version": "7.4.1", @@ -16270,6 +16293,14 @@ "node": ">= 8" } }, + "node_modules/@types/ws": { + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "15.0.14", "license": "MIT", @@ -19867,9 +19898,9 @@ } }, "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", "peer": true, "dependencies": { "assertion-error": "^1.1.0", @@ -35412,11 +35443,11 @@ } }, "node_modules/node-forge": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", "engines": { - "node": ">= 6.0.0" + "node": ">= 6.13.0" } }, "node_modules/node-gyp": { @@ -38162,6 +38193,18 @@ "node": ">=8" } }, + "node_modules/playwright-core": { + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.37.1.tgz", + "integrity": "sha512-17EuQxlSIYCmEMwzMqusJ2ztDgJePjrbttaefgdsiqeLWidjYz9BxXaTaZWxH1J95SHGk6tjE+dwgWILJoUZfA==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/please-upgrade-node": { "version": "3.2.0", "dev": true, @@ -43161,11 +43204,14 @@ "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==" }, "node_modules/selfsigned": { - "version": "1.10.14", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.14.tgz", - "integrity": "sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", + "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", "dependencies": { - "node-forge": "^0.10.0" + "node-forge": "^1" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver": { @@ -48478,6 +48524,14 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/webpack-dev-server/node_modules/node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/webpack-dev-server/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -48586,6 +48640,14 @@ "node": ">= 4" } }, + "node_modules/webpack-dev-server/node_modules/selfsigned": { + "version": "1.10.14", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.14.tgz", + "integrity": "sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA==", + "dependencies": { + "node-forge": "^0.10.0" + } + }, "node_modules/webpack-dev-server/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -50740,9 +50802,9 @@ } }, "@babel/standalone": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.22.10.tgz", - "integrity": "sha512-VmK2sWxUTfDDh9mPfCtFJPIehZToteqK+Zpwq8oJUjJ+WeeKIFTTQIrDzH7jEdom+cAaaguU7FI/FBsBWFkIeQ==" + "version": "7.22.12", + "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.22.12.tgz", + "integrity": "sha512-Od5EnOR/gvwwvLCaJCypkVW6C9PitK2tu/aHb+ZpPnwkVidmlJ+7jUf8YLm9BrNILfT9P8etZq/t6r1IrFauQw==" }, "@babel/template": { "version": "7.18.10", @@ -51287,9 +51349,9 @@ } }, "@deriv/api-types": { - "version": "1.0.118", - "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.118.tgz", - "integrity": "sha512-+q/PEH/O3wRrJlDQWl8x03JCBhQQBZt343maDqDRAM//H2K7h4YT5ucnYHJiS+6xu5jGGeq7JR8lT4R14mfd3Q==" + "version": "1.0.120", + "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.120.tgz", + "integrity": "sha512-XorPckacsTVUsM2RN4jAUbuUgFDXLcSpGpqqBasvLG2ziZSqSbq1Nii6dxWXIdjUcj4dnGaM/z9uYCbNyN+1LA==" }, "@deriv/deriv-api": { "version": "1.0.13", @@ -51462,9 +51524,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", - "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", + "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -54501,6 +54563,17 @@ "esquery": "^1.0.1" } }, + "@playwright/test": { + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.37.1.tgz", + "integrity": "sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==", + "dev": true, + "requires": { + "@types/node": "*", + "fsevents": "2.3.2", + "playwright-core": "1.37.1" + } + }, "@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.11", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz", @@ -55985,9 +56058,9 @@ "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "@webassemblyjs/ast": { "version": "1.9.0", @@ -57008,9 +57081,9 @@ }, "dependencies": { "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "colorette": { "version": "1.4.0", @@ -57306,9 +57379,9 @@ } }, "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "@webassemblyjs/ast": { "version": "1.9.0", @@ -57981,9 +58054,9 @@ }, "dependencies": { "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "@webassemblyjs/ast": { "version": "1.9.0", @@ -58738,9 +58811,9 @@ "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "@webassemblyjs/ast": { "version": "1.9.0", @@ -59750,9 +59823,9 @@ }, "dependencies": { "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "ansi-styles": { "version": "4.3.0", @@ -60083,9 +60156,9 @@ "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==" }, "@types/node": { - "version": "16.18.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.44.tgz", - "integrity": "sha512-PZXtT+wqSMHnLPVExTh+tMt1VK+GvjRLsGZMbcQ4Mb/cG63xJig/TUmgrDa9aborl2i22UnpIzHYNu7s97NbBQ==" + "version": "16.18.46", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" }, "acorn": { "version": "7.4.1", @@ -61187,6 +61260,14 @@ } } }, + "@types/ws": { + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", + "requires": { + "@types/node": "*" + } + }, "@types/yargs": { "version": "15.0.14", "requires": { @@ -63842,9 +63923,9 @@ "integrity": "sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==" }, "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", "peer": true, "requires": { "assertion-error": "^1.1.0", @@ -74778,9 +74859,9 @@ } }, "node-forge": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" }, "node-gyp": { "version": "9.3.0", @@ -76706,6 +76787,12 @@ } } }, + "playwright-core": { + "version": "1.37.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.37.1.tgz", + "integrity": "sha512-17EuQxlSIYCmEMwzMqusJ2ztDgJePjrbttaefgdsiqeLWidjYz9BxXaTaZWxH1J95SHGk6tjE+dwgWILJoUZfA==", + "dev": true + }, "please-upgrade-node": { "version": "3.2.0", "dev": true, @@ -80118,11 +80205,11 @@ "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==" }, "selfsigned": { - "version": "1.10.14", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.14.tgz", - "integrity": "sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", + "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", "requires": { - "node-forge": "^0.10.0" + "node-forge": "^1" } }, "semver": { @@ -83998,6 +84085,11 @@ "minimist": "^1.2.6" } }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -84079,6 +84171,14 @@ "ajv-keywords": "^3.1.0" } }, + "selfsigned": { + "version": "1.10.14", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.14.tgz", + "integrity": "sha512-lkjaiAye+wBZDCBsu5BGi0XiLRxeUlsGod5ZP924CRSEoGuZAw/f7y9RKu28rwTfiHVhdavhB0qH0INV6P1lEA==", + "requires": { + "node-forge": "^0.10.0" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", diff --git a/package.json b/package.json index ebf619fe94cf..6e9588013201 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@deriv/eslint-config-deriv": "^1.0.0-beta.3", "@jest/globals": "^26.5.3", "@nrwl/nx-cloud": "latest", + "@playwright/test": "^1.37.1", "@testing-library/jest-dom": "^5.12.0", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^7.0.2", @@ -80,9 +81,7 @@ "test": "f () { bash ./scripts/circleci-config.test.sh && npm run test:stylelint && npm run test:eslint-all && JEST_MAX_WORKERS=6 npm run test:jest ;}; f", "test:stylelint": "stylelint \"./packages/*/src/**/*.s(a|c)ss\"", "test:jest": "jest --all --maxWorkers=${JEST_MAX_WORKERS:-'45%'}", - "test:e2e": "cd end-to-end-test && npx playwright test", - "test:e2e-dev": "cd end-to-end-test && npx playwright test --trace on && npx playwright show-report", - "test:performance": "cd e2e_tests && jest -c ./jest.config.js --maxWorkers=2 --detectOpenHandles performance", + "test:performance": "jest -c ./jest.config.js --maxWorkers=2 --detectOpenHandles performance", "stylelint:fix": "stylelint \"./packages/*/src/**/*.s(a|c)ss\" --fix", "translate": "f () { lerna exec --scope @deriv/translations -- npm run translate ;}; f", "stylelint-check": "stylelint-config-prettier-check", diff --git a/packages/integration/README.md b/packages/integration/README.md new file mode 100644 index 000000000000..5ac97663c417 --- /dev/null +++ b/packages/integration/README.md @@ -0,0 +1,78 @@ +# @deriv/integration + +This package contains the necessary **E2E** tests configurations, you can easily install and use these configurations. + +It uses [playwright](https://playwright.dev/) as its main framework and you can simply write test with it. +We strongly suggest you to read the [documentation](https://playwright.dev/docs/intro) of playwright once before you get started. + +## Run tests + +- You can run your tests with UI Mode for a better developer experience with time travel debugging, watch mode and more. + +``` +npx playwright test --ui +``` + +- Running all tests + +``` +npx playwright test +``` + +- Running a single test file + +``` +npx playwright test landing-page.spec.ts +``` + +- Run a set of test files + +``` +npx playwright test tests/todo-page/ tests/landing-page/ +``` + +- Run files that have landing or login in the file name + +``` +npx playwright test landing login +``` + +- Run the test with the title + +``` +npx playwright test -g "add a todo item" +``` + +- Running tests in headed mode + +``` +npx playwright test landing-page.spec.ts --headed +``` + +- Running tests on a specific project + +``` +npx playwright test landing-page.ts --project=chromium +``` + +## Debugging Tests + +- Debugging all tests: + +``` +npx playwright test --debug +``` + +- Debugging one test file: + +``` +npx playwright test example.spec.ts --debug +``` + +- Debugging a test from the line number where the test(.. is defined: + +``` +npx playwright test example.spec.ts:10 --debug +``` + + diff --git a/packages/integration/package.json b/packages/integration/package.json new file mode 100644 index 000000000000..a2898346739a --- /dev/null +++ b/packages/integration/package.json @@ -0,0 +1,21 @@ +{ + "name": "@deriv/integration", + "version": "1.0.0", + "private": true, + "description": "This repo contains global files for our integration tests", + "author": "Niloofar Sadeghi ", + "main": "src/index.ts", + "eslintConfig": { + "rules": { + "testing-library/no-await-sync-query": "off", + "testing-library/prefer-screen-queries": "off" + } + }, + "devDependencies": { + "@playwright/test": "^1.37.1", + "typescript": "^4.6.3", + "selfsigned": "^2.1.1", + "ws": "^8.13.0", + "@types/ws": "^8.5.5" + } +} diff --git a/packages/integration/src/exampleMock.ts b/packages/integration/src/exampleMock.ts new file mode 100644 index 000000000000..92f3a455c451 --- /dev/null +++ b/packages/integration/src/exampleMock.ts @@ -0,0 +1,12 @@ +import { createMockServer } from './utils/mocks/mocks'; +import general from './mocks/general'; +import auth from './mocks/auth'; +import residents_list from './mocks/location/residents_list'; +import states_list from './mocks/location/states_list'; + +async function main() { + await createMockServer([general, auth, residents_list, states_list], { port: 10443 }); + process.stdout.write('Listening on localhost:10443'); +} + +main(); diff --git a/packages/integration/src/index.ts b/packages/integration/src/index.ts new file mode 100644 index 000000000000..5b0345d7f5dd --- /dev/null +++ b/packages/integration/src/index.ts @@ -0,0 +1,7 @@ +// TODO export files here +// TODO adding absoulte import for this package +// TODO Add jest configs to the package +// TODO update .md file for having a better documentation +// TODO fixing ts errors in the package +// TODO test this playwright configs in one of the packages +// TODO write test case for exampleMock file diff --git a/packages/integration/src/integration-test/personal-details.spec.tsx b/packages/integration/src/integration-test/personal-details.spec.tsx new file mode 100644 index 000000000000..016ab5d240fd --- /dev/null +++ b/packages/integration/src/integration-test/personal-details.spec.tsx @@ -0,0 +1,29 @@ +import { test, expect } from '@playwright/test'; +import setupMocks from '../utils/mocks/mocks'; +import mockGeneral from '../mocks/general'; +import mockLoggedIn from '../mocks/auth'; +import mockResidentsList from '../mocks/location/residents_list'; +import mockStatesList from '../mocks/location/states_list'; + +test.describe('Personal Details', () => { + test('it shows the current name', async ({ page, baseURL }) => { + await setupMocks({ + baseURL, + page, + mocks: [mockGeneral, mockLoggedIn, mockResidentsList, mockStatesList], + }); + await page.goto(`${baseURL}/account/personal-details`); + + const firstName = await page.getByLabel('First name*').first(); + expect(await firstName.inputValue()).toBe('Jane'); + + const lastName = await page.getByLabel('Last name*').first(); + expect(await lastName.inputValue()).toBe('Smith'); + + const dateOfBirth = await page.getByLabel('Date of birth*').first(); + expect(await dateOfBirth.inputValue()).toBe('01-01-1980'); + + const citizenship = await page.getByLabel('Citizenship').first(); + expect(await citizenship.inputValue()).toBe('Thailand'); + }); +}); diff --git a/packages/integration/src/mocks/auth/authorize.ts b/packages/integration/src/mocks/auth/authorize.ts new file mode 100644 index 000000000000..4c94dff5de85 --- /dev/null +++ b/packages/integration/src/mocks/auth/authorize.ts @@ -0,0 +1,70 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_authorize(context: Context) { + if ('authorize' in context.request) { + context.response = { + authorize: { + account_list: [ + { + account_category: 'trading', + account_type: 'binary', + created_at: 1688638657, + currency: 'USD', + is_disabled: 0, + is_virtual: 0, + landing_company_name: 'svg', + linked_to: [], + loginid: 'CR5712715', + }, + { + account_category: 'trading', + account_type: 'binary', + created_at: 1688638635, + currency: 'BTC', + is_disabled: 0, + is_virtual: 0, + landing_company_name: 'svg', + linked_to: [], + loginid: 'CR5712710', + }, + { + account_category: 'trading', + account_type: 'binary', + created_at: 1688638579, + currency: 'USD', + is_disabled: 0, + is_virtual: 1, + landing_company_name: 'virtual', + linked_to: [], + loginid: 'VRTC8420051', + }, + ], + balance: 0, + country: 'th', + currency: 'USD', + email: 'jane.smith@example.com', + fullname: ' Jane Smith', + is_virtual: 0, + landing_company_fullname: 'Deriv (SVG) LLC', + landing_company_name: 'svg', + linked_to: [], + local_currencies: { + THB: { + fractional_digits: 2, + }, + }, + loginid: 'CR5712715', + preferred_language: 'EN', + scopes: ['read', 'trade', 'trading_information', 'payments', 'admin'], + upgradeable_landing_companies: ['svg'], + user_id: 10000001, + }, + echo_req: { + authorize: '', + req_id: context.req_id, + }, + req_id: context.req_id, + msg_type: 'authorize', + }; + } +} diff --git a/packages/integration/src/mocks/auth/balance_all.ts b/packages/integration/src/mocks/auth/balance_all.ts new file mode 100644 index 000000000000..25fafa834a6b --- /dev/null +++ b/packages/integration/src/mocks/auth/balance_all.ts @@ -0,0 +1,69 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_balance_all(context: Context) { + if ('balance' in context.request && context.request.balance === 1 && context.request.account === 'all') { + context.response = { + balance: { + accounts: { + CR5712710: { + balance: 0, + converted_amount: 0, + currency: 'BTC', + demo_account: 0, + status: 1, + type: 'deriv', + }, + CR5712715: { + balance: 0, + converted_amount: 0, + currency: 'USD', + demo_account: 0, + status: 1, + type: 'deriv', + }, + VRTC8420051: { + balance: 10008.46, + converted_amount: 10008.46, + currency: 'USD', + demo_account: 1, + status: 1, + type: 'deriv', + }, + }, + balance: 0, + currency: 'USD', + id: 'd55abfb0-1f66-e9fc-b09d-9fc722186dee', + loginid: 'CR5712715', + total: { + deriv: { + amount: 0, + currency: 'USD', + }, + deriv_demo: { + amount: 10008.46, + currency: 'USD', + }, + mt5: { + amount: 0, + currency: 'USD', + }, + mt5_demo: { + amount: 0, + currency: 'USD', + }, + }, + }, + echo_req: { + account: 'all', + balance: 1, + req_id: context.req_id, + subscribe: 1, + }, + msg_type: 'balance', + req_id: context.req_id, + subscription: { + id: 'd55abfb0-1f66-e9fc-b09d-9fc722186dee', + }, + }; + } +} diff --git a/packages/integration/src/mocks/auth/balance_one.ts b/packages/integration/src/mocks/auth/balance_one.ts new file mode 100644 index 000000000000..bc8e67cb7fe1 --- /dev/null +++ b/packages/integration/src/mocks/auth/balance_one.ts @@ -0,0 +1,25 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function blalance_one(context: Context) { + if ('balance' in context.request && context.request.balance === 1 && context.request.account === 'CR5712715') { + context.response = { + balance: { + balance: 0, + currency: 'USD', + id: 'e5247f39-666e-9938-87d6-76415da2ffb4', + loginid: 'CR5712715', + }, + echo_req: { + account: 'CR5712715', + balance: 1, + req_id: context.req_id, + subscribe: 1, + }, + msg_type: 'balance', + req_id: context.req_id, + subscription: { + id: 'e5247f39-666e-9938-87d6-76415da2ffb4', + }, + }; + } +} diff --git a/packages/integration/src/mocks/auth/get_account_status.ts b/packages/integration/src/mocks/auth/get_account_status.ts new file mode 100644 index 000000000000..48972c950b2d --- /dev/null +++ b/packages/integration/src/mocks/auth/get_account_status.ts @@ -0,0 +1,74 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function get_account_status(context: Context) { + if ('get_account_status' in context.request && context.request.get_account_status === 1) { + context.response = { + echo_req: { + get_account_status: 1, + req_id: context.req_id, + }, + get_account_status: { + authentication: { + attempts: { + count: 0, + history: [], + latest: null, + }, + document: { + status: 'none', + }, + identity: { + services: { + idv: { + last_rejected: [], + reported_properties: {}, + status: 'none', + submissions_left: 3, + }, + manual: { + status: 'none', + }, + onfido: { + country_code: 'THA', + documents_supported: ['Driving Licence', 'National Identity Card', 'Passport'], + is_country_supported: 1, + last_rejected: [], + reported_properties: {}, + status: 'none', + submissions_left: 2, + }, + }, + status: 'none', + }, + income: { + status: 'none', + }, + needs_verification: [], + ownership: { + requests: [], + status: 'none', + }, + }, + currency_config: { + USD: { + is_deposit_suspended: 0, + is_withdrawal_suspended: 0, + }, + }, + p2p_status: 'active', + prompt_client_to_authenticate: 0, + risk_classification: 'low', + status: [ + 'allow_document_upload', + 'deposit_attempt', + 'dxtrade_password_not_set', + 'financial_information_not_complete', + 'mt5_password_not_set', + 'trading_experience_not_complete', + ], + }, + msg_type: 'get_account_status', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/get_financial_assessment.ts b/packages/integration/src/mocks/auth/get_financial_assessment.ts new file mode 100644 index 000000000000..df424d42e992 --- /dev/null +++ b/packages/integration/src/mocks/auth/get_financial_assessment.ts @@ -0,0 +1,15 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_get_financial_assessment(context: Context) { + if ('get_financial_assessment' in context.request && context.request.get_financial_assessment === 1) { + context.response = { + echo_req: { + get_financial_assessment: 1, + req_id: context.req_id, + }, + get_financial_assessment: {}, + msg_type: 'get_financial_assessment', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/get_limits.ts b/packages/integration/src/mocks/auth/get_limits.ts new file mode 100644 index 000000000000..7a0e6227ba25 --- /dev/null +++ b/packages/integration/src/mocks/auth/get_limits.ts @@ -0,0 +1,137 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_get_limits(context: Context) { + if ('get_limits' in context.request && context.request.get_limits === 1) { + context.response = { + echo_req: { + get_limits: 1, + req_id: context.req_id, + }, + get_limits: { + account_balance: null, + daily_cumulative_amount_transfers: { + dxtrade: { + allowed: 50000, + available: 50000, + }, + enabled: 0, + internal: { + allowed: 100000, + available: 100000, + }, + mt5: { + allowed: 200000, + available: 200000, + }, + }, + daily_transfers: { + ctrader: { + allowed: 10, + available: 10, + }, + derivez: { + allowed: 10, + available: 10, + }, + dxtrade: { + allowed: 10, + available: 10, + }, + internal: { + allowed: 10, + available: 10, + }, + mt5: { + allowed: 10, + available: 10, + }, + }, + lifetime_limit: 10000, + market_specific: { + commodities: [ + { + level: 'market', + name: 'Commodities', + payout_limit: 5000, + profile_name: 'moderate_risk', + turnover_limit: 50000, + }, + ], + cryptocurrency: [ + { + level: 'market', + name: 'Cryptocurrencies', + payout_limit: '100.00', + profile_name: 'extreme_risk', + turnover_limit: '1000.00', + }, + ], + forex: [ + { + level: 'submarket', + name: 'Minor Pairs', + payout_limit: 5000, + profile_name: 'moderate_risk', + turnover_limit: 50000, + }, + { + level: 'submarket', + name: 'Major Pairs', + payout_limit: 20000, + profile_name: 'medium_risk', + turnover_limit: 100000, + }, + { + level: 'market', + name: 'Forex', + payout_limit: 20000, + profile_name: 'medium_risk', + turnover_limit: 100000, + }, + ], + indices: [ + { + level: 'market', + name: 'Stock Indices', + payout_limit: 20000, + profile_name: 'medium_risk', + turnover_limit: 100000, + }, + ], + synthetic_index: [ + { + level: 'submarket', + name: 'Forex Basket', + payout_limit: 5000, + profile_name: 'moderate_risk', + turnover_limit: 50000, + }, + { + level: 'submarket', + name: 'Commodities Basket', + payout_limit: 5000, + profile_name: 'moderate_risk', + turnover_limit: 50000, + }, + { + level: 'market', + name: 'Derived', + payout_limit: 50000, + profile_name: 'low_risk', + turnover_limit: 500000, + }, + ], + }, + num_of_days: 30, + num_of_days_limit: 10000, + open_positions: 100, + payout: 50000, + remainder: 10000, + withdrawal_for_x_days_monetary: 0, + withdrawal_since_inception_monetary: 0, + }, + msg_type: 'get_limits', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/get_self_exclusion.ts b/packages/integration/src/mocks/auth/get_self_exclusion.ts new file mode 100644 index 000000000000..c767b00b84e7 --- /dev/null +++ b/packages/integration/src/mocks/auth/get_self_exclusion.ts @@ -0,0 +1,15 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_get_self_exclusion(context: Context) { + if ('get_self_exclusion' in context.request && context.request.get_self_exclusion === 1) { + context.response = { + echo_req: { + get_self_exclusion: 1, + req_id: context.req_id, + }, + get_self_exclusion: {}, + msg_type: 'get_self_exclusion', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/get_settings.ts b/packages/integration/src/mocks/auth/get_settings.ts new file mode 100644 index 000000000000..d236d7ab8d32 --- /dev/null +++ b/packages/integration/src/mocks/auth/get_settings.ts @@ -0,0 +1,50 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_get_settings(context: Context) { + if ('get_settings' in context.request && context.request.get_settings === 1) { + context.response = { + echo_req: { + get_settings: 1, + req_id: context.req_id, + }, + get_settings: { + account_opening_reason: '', + address_city: 'test', + address_line_1: 'test', + address_line_2: '', + address_postcode: '', + address_state: '', + allow_copiers: 0, + citizen: 'th', + client_tnc_status: 'Version 4.2.0 2020-08-07', + country: 'Thailand', + country_code: 'th', + date_of_birth: 315532859, + dxtrade_user_exception: 0, + email: 'jane.smith@example.com', + email_consent: 1, + feature_flag: { + wallet: 0, + }, + first_name: 'Jane', + has_secret_answer: 1, + immutable_fields: ['residence'], + is_authenticated_payment_agent: 0, + last_name: 'Smith', + non_pep_declaration: 1, + phone: '+66111111111', + place_of_birth: null, + preferred_language: 'EN', + request_professional_status: 0, + residence: 'Thailand', + salutation: '', + tax_identification_number: null, + tax_residence: null, + trading_hub: 0, + user_hash: 'kYk8h4q605qCEBgOdiarruohRrFZemZwhgkHedMQEQ6EDhEgScm25lFIK42dSMK5', + }, + msg_type: 'get_settings', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/index.ts b/packages/integration/src/mocks/auth/index.ts new file mode 100644 index 000000000000..4481d8b2ee85 --- /dev/null +++ b/packages/integration/src/mocks/auth/index.ts @@ -0,0 +1,35 @@ +import mock_authorize from './authorize'; +import mock_balance_all from './balance_all'; +import mock_balance_one from './balance_one'; +import mock_get_account_status from './get_account_status'; +import mock_get_self_exclusion from './get_self_exclusion'; +import mock_get_settings from './get_settings'; +import mock_get_financial_assessment from './get_financial_assessment'; +import mock_mt5_login_list from './mt5_login_list'; +import mock_landing_company from './landing_company'; +import mock_get_limits from './get_limits'; +import mock_paymentagent_list from './paymentagent_list'; +import mock_trading_platform_available_accounts from './trading_platform_available_accounts'; +import mock_platform_mt5 from './platform_mt5'; +import mock_platform_dxtrade from './platform_dxtrade'; +import mock_trading_platform_accounts from './trading_platform_accounts'; + +const loggedIn = async context => { + mock_authorize(context); + mock_balance_all(context); + mock_balance_one(context); + mock_get_account_status(context); + mock_get_self_exclusion(context); + mock_get_settings(context); + mock_get_financial_assessment(context); + mock_mt5_login_list(context); + mock_landing_company(context); + mock_get_limits(context); + mock_paymentagent_list(context); + mock_trading_platform_available_accounts(context); + mock_platform_mt5(context); + mock_platform_dxtrade(context); + mock_trading_platform_accounts(context); +}; + +export default loggedIn; diff --git a/packages/integration/src/mocks/auth/landing_company.ts b/packages/integration/src/mocks/auth/landing_company.ts new file mode 100644 index 000000000000..17fd223caeb0 --- /dev/null +++ b/packages/integration/src/mocks/auth/landing_company.ts @@ -0,0 +1,1841 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_landing_company(context: Context) { + if ('landing_company' in context.request && context.request.landing_company === 'th') { + context.response = { + echo_req: { + landing_company: 'th', + req_id: context.req_id, + }, + landing_company: { + all_company: 'svg', + config: {}, + ctrader: { + all: { + standard: 'svg', + }, + }, + derivez: { + all: { + standard: 'svg', + }, + }, + dxtrade_all_company: { + standard: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + }, + financial_company: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + gaming_company: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + id: 'th', + minimum_age: 18, + mt_all_company: { + swap_free: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + }, + mt_financial_company: { + financial: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + financial_stp: { + address: [ + 'Labuan Times Square', + 'Jalan Merdeka', + '87000 Federal Territory of Labuan', + 'Malaysia', + ], + changeable_fields: {}, + country: 'Malaysia', + currency_config: { + forex: { + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: ['callput'], + legal_allowed_currencies: ['USD'], + legal_allowed_markets: [], + legal_default_currency: 'USD', + name: 'Deriv (FX) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information', 'trading_experience'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: ['phone', 'citizen', 'account_opening_reason'], + }, + shortcode: 'labuan', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + }, + mt_gaming_company: { + financial: { + address: null, + changeable_fields: { + only_before_auth: [ + 'salutation', + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'account_opening_reason', + 'tax_residence', + 'tax_identification_number', + ], + personal_details_not_locked: [ + 'first_name', + 'last_name', + 'date_of_birth', + 'citizen', + 'place_of_birth', + ], + }, + country: 'Saint Vincent and the Grenadines', + currency_config: { + commodities: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + cryptocurrency: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + forex: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + indices: { + AUD: { + max_payout: 70000, + min_stake: 0.7, + }, + BTC: { + max_payout: 2, + min_stake: 0.00002, + }, + ETH: { + max_payout: 30, + min_stake: 0.0003, + }, + EUR: { + max_payout: 50000, + min_stake: 0.5, + }, + GBP: { + max_payout: 40000, + min_stake: 0.4, + }, + LTC: { + max_payout: 600, + min_stake: 0.006, + }, + USD: { + max_payout: 50000, + min_stake: 0.5, + }, + USDC: { + max_payout: 5000, + min_stake: 0.5, + }, + UST: { + max_payout: 5000, + min_stake: 0.5, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.5, + }, + }, + synthetic_index: { + AUD: { + max_payout: 70000, + min_stake: 0.5, + }, + BTC: { + max_payout: 2, + min_stake: 0.000013, + }, + ETH: { + max_payout: 30, + min_stake: 0.0002, + }, + EUR: { + max_payout: 50000, + min_stake: 0.3, + }, + GBP: { + max_payout: 40000, + min_stake: 0.3, + }, + LTC: { + max_payout: 600, + min_stake: 0.004, + }, + USD: { + max_payout: 50000, + min_stake: 0.35, + }, + USDC: { + max_payout: 5000, + min_stake: 0.3, + }, + UST: { + max_payout: 5000, + min_stake: 0.3, + }, + eUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + tUSDT: { + max_payout: 5000, + min_stake: 0.3, + }, + }, + }, + has_reality_check: 0, + legal_allowed_contract_categories: [ + 'asian', + 'callput', + 'callputequal', + 'callputspread', + 'digits', + 'endsinout', + 'highlowticks', + 'lookback', + 'multiplier', + 'reset', + 'runs', + 'staysinout', + 'touchnotouch', + ], + legal_allowed_currencies: [ + 'AUD', + 'BTC', + 'ETH', + 'EUR', + 'GBP', + 'LTC', + 'USD', + 'USDC', + 'UST', + 'eUSDT', + 'tUSDT', + ], + legal_allowed_markets: ['commodities', 'cryptocurrency', 'forex', 'indices', 'synthetic_index'], + legal_default_currency: 'USD', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + support_professional_client: 0, + tin_not_mandatory: 0, + }, + }, + name: 'Thailand', + virtual_company: 'virtual', + }, + msg_type: 'landing_company', + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/mt5_login_list.ts b/packages/integration/src/mocks/auth/mt5_login_list.ts new file mode 100644 index 000000000000..7739aa28758b --- /dev/null +++ b/packages/integration/src/mocks/auth/mt5_login_list.ts @@ -0,0 +1,15 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_mt5_login_list(context: Context) { + if ('mt5_login_list' in context.request && context.request.mt5_login_list === 1) { + context.response = { + echo_req: { + mt5_login_list: 1, + req_id: context.req_id, + }, + msg_type: 'mt5_login_list', + mt5_login_list: [], + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/paymentagent_list.ts b/packages/integration/src/mocks/auth/paymentagent_list.ts new file mode 100644 index 000000000000..649bb10c65a1 --- /dev/null +++ b/packages/integration/src/mocks/auth/paymentagent_list.ts @@ -0,0 +1,156 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_paymentagent_list(context: Context) { + if ( + 'paymentagent_list' in context.request && + context.request.paymentagent_list === 'th' && + context.request.currency === 'USD' + ) { + context.response = { + echo_req: { + currency: 'USD', + paymentagent_list: 'th', + req_id: context.req_id, + }, + msg_type: 'paymentagent_list', + paymentagent_list: { + available_countries: [ + ['af', 'Afghanistan'], + ['ao', 'Angola'], + ['ar', 'Argentina'], + ['au', 'Australia'], + ['bd', 'Bangladesh'], + ['bf', 'Burkina Faso'], + ['bi', 'Burundi'], + ['bj', 'Benin'], + ['bo', 'Bolivia'], + ['br', 'Brazil'], + ['bw', 'Botswana'], + ['cd', 'Congo - Kinshasa'], + ['cg', 'Congo - Brazzaville'], + ['ci', "Cote d'Ivoire"], + ['cl', 'Chile'], + ['cm', 'Cameroon'], + ['cn', 'China'], + ['co', 'Colombia'], + ['cu', 'Cuba'], + ['dj', 'Djibouti'], + ['do', 'Dominican Republic'], + ['dz', 'Algeria'], + ['ec', 'Ecuador'], + ['eg', 'Egypt'], + ['et', 'Ethiopia'], + ['ga', 'Gabon'], + ['ge', 'Georgia'], + ['gh', 'Ghana'], + ['gn', 'Guinea'], + ['gw', 'Guinea-Bissau'], + ['id', 'Indonesia'], + ['in', 'India'], + ['jp', 'Japan'], + ['ke', 'Kenya'], + ['kh', 'Cambodia'], + ['kr', 'South Korea'], + ['kw', 'Kuwait'], + ['la', 'Laos'], + ['lb', 'Lebanon'], + ['lk', 'Sri Lanka'], + ['ls', 'Lesotho'], + ['ly', 'Libya'], + ['ma', 'Morocco'], + ['mg', 'Madagascar'], + ['ml', 'Mali'], + ['mn', 'Mongolia'], + ['mv', 'Maldives'], + ['mw', 'Malawi'], + ['mz', 'Mozambique'], + ['na', 'Namibia'], + ['ne', 'Niger'], + ['ng', 'Nigeria'], + ['om', 'Oman'], + ['pe', 'Peru'], + ['ph', 'Philippines'], + ['pk', 'Pakistan'], + ['qa', 'Qatar'], + ['ru', 'Russia'], + ['sa', 'Saudi Arabia'], + ['sd', 'Sudan'], + ['sl', 'Sierra Leone'], + ['sn', 'Senegal'], + ['so', 'Somalia'], + ['ss', 'South Sudan'], + ['sz', 'Swaziland'], + ['tg', 'Togo'], + ['th', 'Thailand'], + ['tr', 'Turkey'], + ['tz', 'Tanzania'], + ['ug', 'Uganda'], + ['uy', 'Uruguay'], + ['vn', 'Vietnam'], + ['ws', 'Samoa'], + ['za', 'South Africa'], + ['zm', 'Zambia'], + ['zw', 'Zimbabwe'], + ], + list: [ + { + currencies: 'USD', + deposit_commission: '0', + email: 'teclasarojani@gmail.com', + further_information: + 'ආයුබෝවන් ඔබට අවශ්‍ය Binary / Deriv $ මිලට ගැනීමට අප සමග සමිබන්ධ වෙන්න. Bank Transfer( cash ), USDT Exchange , E-wallet Exchange සමග ඉතා කඩිනම් සුහදශීලී හා ලාබදායි ලෙස ඔබට අපගෙන් ලබාගත හැක. Binary/ Deriv Dollars,USDT, Crypto மாற்றம் அல்லது வாங்குதல் மற்றும் விற்பனை நோக்கங்களுக்காக என்னை தொடர்பு கொள்ளவும். குறைந்த விகிதங்கள் மற்றும் வேகமான சேவைகள் எங்களிடம் பெற்றுக்கொள்ளலாம். You are warmly welcome to my premium payment agent group. Whatsapp following Number for more details.', + max_withdrawal: '2000', + min_withdrawal: '10', + name: 'Chamara Madusanka Dharmasena', + paymentagent_loginid: 'CR2154875', + phone_numbers: [ + { + phone_number: '+94761540855', + }, + ], + summary: '', + supported_payment_methods: [ + { + payment_method: 'Bank transfer', + }, + { + payment_method: 'Boc Peoples Bank', + }, + { + payment_method: 'BTC', + }, + { + payment_method: 'Crypto Payment', + }, + { + payment_method: 'E-wallets', + }, + { + payment_method: 'HNB', + }, + { + payment_method: 'LOLC', + }, + { + payment_method: 'Sampath Bank', + }, + { + payment_method: 'USDT', + }, + ], + urls: [ + { + url: 'https://t.me/+b8-HyBzP09U3NDhl', + }, + { + url: 'https://www.facebook.com/m8az2z?mibextid=LQQJ4d', + }, + ], + withdrawal_commission: '0', + }, + ], + }, + req_id: context.req_id, + }; + } +} diff --git a/packages/integration/src/mocks/auth/platform_dxtrade.ts b/packages/integration/src/mocks/auth/platform_dxtrade.ts new file mode 100644 index 000000000000..00415c2a4539 --- /dev/null +++ b/packages/integration/src/mocks/auth/platform_dxtrade.ts @@ -0,0 +1,31 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_platform_dxtrade(context: Context) { + if ( + 'platform' in context.request && + context.request.platform === 'dxtrade' && + context.request.trading_servers === 1 + ) { + context.response = { + echo_req: { + platform: 'dxtrade', + req_id: context.req_id, + trading_servers: 1, + }, + msg_type: 'trading_servers', + req_id: context.req_id, + trading_servers: [ + { + account_type: 'real', + disabled: 0, + supported_accounts: ['all'], + }, + { + account_type: 'demo', + disabled: 0, + supported_accounts: ['all'], + }, + ], + }; + } +} diff --git a/packages/integration/src/mocks/auth/platform_mt5.ts b/packages/integration/src/mocks/auth/platform_mt5.ts new file mode 100644 index 000000000000..6013d7253539 --- /dev/null +++ b/packages/integration/src/mocks/auth/platform_mt5.ts @@ -0,0 +1,32 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_platform_mt5(context: Context) { + if ('platform' in context.request && context.request.platform === 'mt5' && context.request.trading_servers === 1) { + context.response = { + echo_req: { + platform: 'mt5', + req_id: context.req_id, + trading_servers: 1, + }, + msg_type: 'trading_servers', + req_id: context.req_id, + trading_servers: [ + { + account_type: 'real', + disabled: 0, + environment: 'Deriv-Server', + geolocation: { + group: 'asia_synthetic', + location: 'Singapore', + region: 'Asia', + sequence: 1, + }, + id: 'p01_ts03', + market_type: 'synthetic', + recommended: 1, + supported_accounts: ['gaming'], + }, + ], + }; + } +} diff --git a/packages/integration/src/mocks/auth/trading_platform_accounts.ts b/packages/integration/src/mocks/auth/trading_platform_accounts.ts new file mode 100644 index 000000000000..e3c243f54284 --- /dev/null +++ b/packages/integration/src/mocks/auth/trading_platform_accounts.ts @@ -0,0 +1,20 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_trading_platform_accounts(context: Context) { + if ( + 'trading_platform_accounts' in context.request && + context.request.trading_platform_accounts === 1 && + context.request.platform === 'derivez' + ) { + context.response = { + echo_req: { + platform: 'derivez', + req_id: context.req_id, + trading_platform_accounts: 1, + }, + msg_type: 'trading_platform_accounts', + req_id: context.req_id, + trading_platform_accounts: [], + }; + } +} diff --git a/packages/integration/src/mocks/auth/trading_platform_available_accounts.ts b/packages/integration/src/mocks/auth/trading_platform_available_accounts.ts new file mode 100644 index 000000000000..9fa7cff663ff --- /dev/null +++ b/packages/integration/src/mocks/auth/trading_platform_available_accounts.ts @@ -0,0 +1,151 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_trading_platform_available_accounts(context: Context) { + if ( + 'trading_platform_available_accounts' in context.request && + context.request.trading_platform_available_accounts === 1 && + context.request.platform === 'mt5' + ) { + context.response = { + echo_req: { + platform: 'mt5', + req_id: context.req_id, + trading_platform_available_accounts: 1, + }, + msg_type: 'trading_platform_available_accounts', + req_id: context.req_id, + trading_platform_available_accounts: [ + { + linkable_landing_companies: ['svg'], + market_type: 'all', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + sub_account_type: 'swap_free', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'financial', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + sub_account_type: 'standard', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'financial', + name: 'Deriv (BVI) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information', 'trading_experience'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: ['phone', 'citizen', 'account_opening_reason'], + }, + shortcode: 'bvi', + sub_account_type: 'standard', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'financial', + name: 'Deriv (V) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: [ + 'citizen', + 'place_of_birth', + 'tax_residence', + 'tax_identification_number', + 'account_opening_reason', + ], + }, + shortcode: 'vanuatu', + sub_account_type: 'standard', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'financial', + name: 'Deriv (FX) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information', 'trading_experience'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: ['phone', 'citizen', 'account_opening_reason'], + }, + shortcode: 'labuan', + sub_account_type: 'stp', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'gaming', + name: 'Deriv (SVG) LLC', + requirements: { + signup: ['first_name', 'last_name', 'residence', 'date_of_birth'], + withdrawal: ['address_city', 'address_line_1'], + }, + shortcode: 'svg', + sub_account_type: 'standard', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'gaming', + name: 'Deriv (BVI) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information', 'trading_experience'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: ['phone', 'citizen', 'account_opening_reason'], + }, + shortcode: 'bvi', + sub_account_type: 'standard', + }, + { + linkable_landing_companies: ['svg'], + market_type: 'gaming', + name: 'Deriv (V) Ltd', + requirements: { + after_first_deposit: { + financial_assessment: ['financial_information'], + }, + compliance: { + mt5: ['fully_authenticated', 'expiration_check'], + tax_information: ['tax_residence', 'tax_identification_number'], + }, + signup: [ + 'citizen', + 'place_of_birth', + 'tax_residence', + 'tax_identification_number', + 'account_opening_reason', + ], + }, + shortcode: 'vanuatu', + sub_account_type: 'standard', + }, + ], + }; + } +} diff --git a/packages/integration/src/mocks/general/exchange_rates.ts b/packages/integration/src/mocks/general/exchange_rates.ts new file mode 100644 index 000000000000..f44c0bcea59a --- /dev/null +++ b/packages/integration/src/mocks/general/exchange_rates.ts @@ -0,0 +1,160 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_exchange_rates(context: Context) { + if ('exchange_rates' in context.request && context.request.exchange_rates === 1) { + context.response = { + echo_req: { + req_id: context.req_id, + exchange_rates: 1, + }, + exchange_rates: { + base_currency: 'USD', + date: parseInt((Date.now() / 1000).toFixed(0)), + rates: { + AED: 3.6735, + AFN: 89.0052, + ALL: 93.575, + AMD: 386.25, + AOA: 509.3611, + ARS: 113.9705, + AUD: 1.48029724368653, + AWG: 1.79, + BAM: 1.7659, + BBD: 2, + BDT: 108.4525, + BHD: 0.377, + BMD: 1, + BND: 1.3266, + BRL: 4.6221, + BSD: 1, + BTC: 3.41233456575483e-5, + BTN: 81.9938, + BUSD: 1.000100010001, + BWP: 13.587, + BZD: 2, + CAD: 1.32249, + CHF: 0.86227, + CLP: 814.6, + CNY: 7.142, + COP: 3759.31, + CRC: 541.275, + CUP: 24, + CVE: 100.0963, + DAI: 1, + DJF: 178.0389, + DKK: 6.7279, + DOP: 55.916, + DZD: 134.6946, + ECS: 25000, + EGP: 30.8974, + ERN: 15, + ETB: 54.8732, + ETH: 0.000537650306863913, + EUR: 0.902869318694812, + EURS: 0.85247858147564, + FJD: 2.2183, + FKP: 0.773275595422208, + GBP: 0.773305494335537, + GEL: 2.568, + GHC: 113284.5, + GIP: 0.773275595422208, + GMD: 62.4125, + GNF: 8593.675, + GTQ: 7.8508, + HKD: 7.8015, + HNL: 24.6193, + HTG: 138.119, + IDK: 15.0325, + IDR: 15032.5, + ILS: 3.6939, + INR: 81.991, + IQD: 1460, + ISK: 131.375, + JMD: 153.8087, + JOD: 0.7091, + JPY: 140.39, + KES: 135.43, + KMF: 444.1867, + KRW: 1274.35, + KWD: 0.3078, + KYD: 0.82, + KZT: 444.365, + LAK: 18882.385, + LKR: 328.89, + LRD: 154.7192, + LSL: 17.6615, + LTC: 0.0111569786901707, + LYD: 4.8042, + MAD: 9.6871, + MDL: 17.763, + MGA: 4328.755, + MKD: 55.5267, + MMK: 2010.105, + MNT: 3442.345, + MOP: 8.0356, + MUR: 45.9622, + MXN: 16.8675, + MZM: 63920.4551, + NAD: 17.6615, + NGN: 775.755, + NIO: 36.5748, + NOK: 10.11731, + NPR: 131.1751, + NZD: 1.61064312980173, + OMR: 0.3854, + PAB: 1, + PAX: 1.0005623160216, + PEN: 3.7128, + PHP: 54.621, + PKR: 285.3395, + PLN: 3.9981, + QAR: 3.6466, + RUB: 81.2679, + RWF: 1077.2937, + SAR: 3.7506, + SBD: 8.16, + SCR: 13.7114, + SDG: 574.1082, + SEK: 10.4358, + SGD: 1.3266, + SHP: 0.773275595422208, + SLL: 19385.959, + SOS: 569.1501, + SVC: 8.75, + SZL: 17.6615, + THB: 34.2605, + TND: 3.0573, + TOP: 2.3249, + TRY: 26.9502, + TTD: 6.7814, + TUSD: 1.00091683982528, + TWD: 31.191, + TZS: 2404.7, + UAH: 36.8309, + UGX: 3640.025, + USB: 1, + USDC: 0.985940488632106, + USDK: 1, + UST: 0.998552099455789, + UYU: 40.675, + VND: 23651.7, + WST: 2.6921, + XAF: 592.2489, + XCD: 2.7, + XOF: 592.2489, + XPF: 107.6633, + YER: 250.2405, + ZAR: 17.6615, + ZMK: 18825, + eUSDT: 0.998552099455789, + tUSDT: 0.998552099455789, + }, + }, + msg_type: 'exchange_rates', + req_id: context.req_id, + subscription: { + id: '69eddd7e-9cf2-48d2-e951-a7008e724c2f', + }, + }; + } +} diff --git a/packages/integration/src/mocks/general/index.ts b/packages/integration/src/mocks/general/index.ts new file mode 100644 index 000000000000..8905fdaec166 --- /dev/null +++ b/packages/integration/src/mocks/general/index.ts @@ -0,0 +1,13 @@ +import mock_exchange_rates from './exchange_rates'; +import mock_payout_currencies from './payout_currencies'; +import mock_time from './time'; +import mock_website_status from './website_status'; + +const general = context => { + mock_exchange_rates(context); + mock_payout_currencies(context); + mock_time(context); + mock_website_status(context); +}; + +export default general; diff --git a/packages/integration/src/mocks/general/payout_currencies.ts b/packages/integration/src/mocks/general/payout_currencies.ts new file mode 100644 index 000000000000..9e3543b5328c --- /dev/null +++ b/packages/integration/src/mocks/general/payout_currencies.ts @@ -0,0 +1,15 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_payout_currencies(context: Context) { + if ('payout_currencies' in context.request && context.request.payout_currencies === 1) { + context.response = { + echo_req: { + req_id: context.req_id, + payout_currencies: 1, + }, + req_id: context.req_id, + msg_type: 'payout_currencies', + payout_currencies: ['USD'], + }; + } +} diff --git a/packages/integration/src/mocks/general/time.ts b/packages/integration/src/mocks/general/time.ts new file mode 100644 index 000000000000..ecf195d7326f --- /dev/null +++ b/packages/integration/src/mocks/general/time.ts @@ -0,0 +1,15 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_time(context: Context) { + if ('time' in context.request && context.request.time === 1) { + context.response = { + echo_req: { + req_id: context.req_id, + time: 1, + }, + req_id: context.req_id, + msg_type: 'time', + time: parseInt((Date.now() / 1000).toFixed(0)), + }; + } +} diff --git a/packages/integration/src/mocks/general/website_status.ts b/packages/integration/src/mocks/general/website_status.ts new file mode 100644 index 000000000000..0de4f288dc73 --- /dev/null +++ b/packages/integration/src/mocks/general/website_status.ts @@ -0,0 +1,1864 @@ +import { Context } from '../../utils/mocks/mocks'; + +export default function mock_website_status(context: Context) { + if ('website_status' in context.request && context.request.website_status === 1) { + context.response = { + echo_req: { + req_id: context.req_id, + website_status: 1, + }, + msg_type: 'website_status', + req_id: context.req_id, + website_status: { + api_call_limits: { + max_proposal_subscription: { + applies_to: 'subscribing to proposal concurrently', + max: 5, + }, + max_requestes_general: { + applies_to: 'rest of calls', + hourly: 14400, + minutely: 180, + }, + max_requests_outcome: { + applies_to: 'portfolio, statement and proposal', + hourly: 1500, + minutely: 25, + }, + max_requests_pricing: { + applies_to: 'proposal and proposal_open_contract', + hourly: 3600, + minutely: 80, + }, + }, + broker_codes: ['CRW', 'MX', 'VRW', 'CH', 'MFW', 'VRTC', 'VRCH', 'MLT', 'MF', 'CRA', 'CR'], + clients_country: 'my', + currencies_config: { + AUD: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Australian Dollar', + stake_default: 15, + transfer_between_accounts: { + fees: { + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 0, + EURS: 2, + GBP: 0, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 0, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 7402.03, + min: 1.48, + }, + limits_ctrader: { + max: 22206.1, + min: 0.01, + }, + limits_derivez: { + max: 22206.1, + min: 0.01, + }, + limits_dxtrade: { + max: 3701.02, + min: 0.01, + }, + limits_mt5: { + max: 22206.1, + min: 0.01, + }, + }, + type: 'fiat', + }, + BTC: { + fractional_digits: 8, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Bitcoin', + stake_default: 0.0004, + transfer_between_accounts: { + fees: { + AUD: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 0.17060625, + min: 3.412e-5, + }, + limits_ctrader: { + max: 0.51181875, + min: 3.4e-7, + }, + limits_derivez: { + max: 0.51181875, + min: 3.4e-7, + }, + limits_dxtrade: { + max: 0.08530312, + min: 3.4e-7, + }, + limits_mt5: { + max: 0.51181875, + min: 3.4e-7, + }, + }, + type: 'crypto', + }, + BUSD: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'Binance USD', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5000.5, + min: 1, + }, + limits_ctrader: { + max: 15001.5, + min: 0.01, + }, + limits_derivez: { + max: 15001.5, + min: 0.01, + }, + limits_dxtrade: { + max: 2500.25, + min: 0.01, + }, + limits_mt5: { + max: 15001.5, + min: 0.01, + }, + }, + type: 'crypto', + }, + DAI: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'Multi-Collateral DAI', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5000, + min: 1, + }, + limits_ctrader: { + max: 15000, + min: 0.01, + }, + limits_derivez: { + max: 15000, + min: 0.01, + }, + limits_dxtrade: { + max: 2500, + min: 0.01, + }, + limits_mt5: { + max: 15000, + min: 0.01, + }, + }, + type: 'crypto', + }, + ETH: { + fractional_digits: 8, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Ethereum', + stake_default: 0.005, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 2.68833826, + min: 0.00053767, + }, + limits_ctrader: { + max: 8.06501477, + min: 5.38e-6, + }, + limits_derivez: { + max: 8.06501477, + min: 5.38e-6, + }, + limits_dxtrade: { + max: 1.34416913, + min: 5.38e-6, + }, + limits_mt5: { + max: 8.06501477, + min: 5.38e-6, + }, + }, + type: 'crypto', + }, + EUR: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Euro', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 0, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EURS: 2, + GBP: 0, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 0, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 4513.78, + min: 0.9, + }, + limits_ctrader: { + max: 13541.33, + min: 0.01, + }, + limits_derivez: { + max: 13541.33, + min: 0.01, + }, + limits_dxtrade: { + max: 2256.89, + min: 0.01, + }, + limits_mt5: { + max: 13541.33, + min: 0.01, + }, + }, + type: 'fiat', + }, + EURS: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'STATIS Euro', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 4262.39, + min: 0.85, + }, + limits_ctrader: { + max: 12787.18, + min: 0.01, + }, + limits_derivez: { + max: 12787.18, + min: 0.01, + }, + limits_dxtrade: { + max: 2131.2, + min: 0.01, + }, + limits_mt5: { + max: 12787.18, + min: 0.01, + }, + }, + type: 'crypto', + }, + GBP: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Pound Sterling', + stake_default: 8, + transfer_between_accounts: { + fees: { + AUD: 0, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 0, + EURS: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 0, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 3867.16, + min: 0.77, + }, + limits_ctrader: { + max: 11601.47, + min: 0.01, + }, + limits_derivez: { + max: 11601.47, + min: 0.01, + }, + limits_dxtrade: { + max: 1933.58, + min: 0.01, + }, + limits_mt5: { + max: 11601.47, + min: 0.01, + }, + }, + type: 'fiat', + }, + IDK: { + fractional_digits: 0, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'IDK', + stake_default: 150, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 75163, + min: 15, + }, + limits_ctrader: { + max: 225488, + min: 0, + }, + limits_derivez: { + max: 225488, + min: 0, + }, + limits_dxtrade: { + max: 37581, + min: 0, + }, + limits_mt5: { + max: 225488, + min: 0, + }, + }, + type: 'crypto', + }, + LTC: { + fractional_digits: 8, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Litecoin', + stake_default: 0.13, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 55.79111805, + min: 0.01115822, + }, + limits_ctrader: { + max: 167.37335416, + min: 0.00011158, + }, + limits_derivez: { + max: 167.37335416, + min: 0.00011158, + }, + limits_dxtrade: { + max: 27.89555903, + min: 0.00011158, + }, + limits_mt5: { + max: 167.37335416, + min: 0.00011158, + }, + }, + type: 'crypto', + }, + PAX: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'Paxos Standard', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5002.81, + min: 1, + }, + limits_ctrader: { + max: 15008.43, + min: 0.01, + }, + limits_derivez: { + max: 15008.43, + min: 0.01, + }, + limits_dxtrade: { + max: 2501.41, + min: 0.01, + }, + limits_mt5: { + max: 15008.43, + min: 0.01, + }, + }, + type: 'crypto', + }, + TUSD: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'True USD', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5004.58, + min: 1, + }, + limits_ctrader: { + max: 15013.75, + min: 0.01, + }, + limits_derivez: { + max: 15013.75, + min: 0.01, + }, + limits_dxtrade: { + max: 2502.29, + min: 0.01, + }, + limits_mt5: { + max: 15013.75, + min: 0.01, + }, + }, + type: 'crypto', + }, + USB: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'Binary Coin', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5000, + min: 1, + }, + limits_ctrader: { + max: 15000, + min: 0.01, + }, + limits_derivez: { + max: 15000, + min: 0.01, + }, + limits_dxtrade: { + max: 2500, + min: 0.01, + }, + limits_mt5: { + max: 15000, + min: 0.01, + }, + }, + type: 'crypto', + }, + USD: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'US Dollar', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 0, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 0, + EURS: 2, + GBP: 0, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5000, + min: 1, + }, + limits_ctrader: { + max: 15000, + min: 0.01, + }, + limits_derivez: { + max: 15000, + min: 0.01, + }, + limits_dxtrade: { + max: 2500, + min: 0.01, + }, + limits_mt5: { + max: 15000, + min: 0.01, + }, + }, + type: 'fiat', + }, + USDC: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'USD Coin', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 4940, + min: 0.99, + }, + limits_ctrader: { + max: 14820.01, + min: 0.01, + }, + limits_derivez: { + max: 14820.01, + min: 0.01, + }, + limits_dxtrade: { + max: 2470, + min: 0.01, + }, + limits_mt5: { + max: 14820.01, + min: 0.01, + }, + }, + type: 'crypto', + }, + USDK: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'USDK', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + UST: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 5000, + min: 1, + }, + limits_ctrader: { + max: 15000, + min: 0.01, + }, + limits_derivez: { + max: 15000, + min: 0.01, + }, + limits_dxtrade: { + max: 2500, + min: 0.01, + }, + limits_mt5: { + max: 15000, + min: 0.01, + }, + }, + type: 'crypto', + }, + UST: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Tether Omni', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + eUSDT: 2, + tUSDT: 2, + }, + limits: { + max: 4992.76, + min: 1, + }, + limits_ctrader: { + max: 14978.28, + min: 0.01, + }, + limits_derivez: { + max: 14978.28, + min: 0.01, + }, + limits_dxtrade: { + max: 2496.38, + min: 0.01, + }, + limits_mt5: { + max: 14978.28, + min: 0.01, + }, + }, + type: 'crypto', + }, + eUSDT: { + fractional_digits: 2, + is_deposit_suspended: 0, + is_suspended: 0, + is_withdrawal_suspended: 0, + name: 'Tether ERC20', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + tUSDT: 2, + }, + limits: { + max: 4992.76, + min: 1, + }, + limits_ctrader: { + max: 14978.28, + min: 0.01, + }, + limits_derivez: { + max: 14978.28, + min: 0.01, + }, + limits_dxtrade: { + max: 2496.38, + min: 0.01, + }, + limits_mt5: { + max: 14978.28, + min: 0.01, + }, + }, + type: 'crypto', + }, + tUSDT: { + fractional_digits: 2, + is_deposit_suspended: 1, + is_suspended: 1, + is_withdrawal_suspended: 1, + name: 'Tether TRC20', + stake_default: 10, + transfer_between_accounts: { + fees: { + AUD: 2, + BTC: 2, + BUSD: 2, + DAI: 2, + ETH: 2, + EUR: 2, + EURS: 2, + GBP: 2, + IDK: 2, + LTC: 2, + PAX: 2, + TUSD: 2, + USB: 2, + USD: 2, + USDC: 2, + USDK: 2, + UST: 2, + eUSDT: 2, + }, + limits: { + max: 4992.76, + min: 1, + }, + limits_ctrader: { + max: 14978.28, + min: 0.01, + }, + limits_derivez: { + max: 14978.28, + min: 0.01, + }, + limits_dxtrade: { + max: 2496.38, + min: 0.01, + }, + limits_mt5: { + max: 14978.28, + min: 0.01, + }, + }, + type: 'crypto', + }, + }, + dxtrade_status: { + all: 0, + demo: 0, + real: 0, + }, + mt5_status: { + demo: [ + { + all: 0, + platform: 1, + server_number: 1, + }, + { + all: 0, + platform: 1, + server_number: 2, + }, + { + all: 0, + platform: 1, + server_number: 3, + }, + { + all: 0, + platform: 1, + server_number: 4, + }, + ], + real: [ + { + all: 0, + deposits: 0, + platform: 1, + server_number: 1, + withdrawals: 0, + }, + { + all: 0, + deposits: 0, + platform: 1, + server_number: 2, + withdrawals: 0, + }, + { + all: 0, + deposits: 0, + platform: 1, + server_number: 3, + withdrawals: 0, + }, + { + all: 0, + deposits: 0, + platform: 1, + server_number: 4, + withdrawals: 0, + }, + { + all: 0, + deposits: 0, + platform: 2, + server_number: 1, + withdrawals: 0, + }, + { + all: 0, + deposits: 0, + platform: 2, + server_number: 2, + withdrawals: 0, + }, + ], + }, + p2p_config: { + adverts_active_limit: 3, + adverts_archive_period: 3, + block_trade: { + disabled: 1, + maximum_advert_amount: 20000, + }, + cancellation_block_duration: 24, + cancellation_count_period: 24, + cancellation_grace_period: 0, + cancellation_limit: 3, + cross_border_ads_enabled: 1, + disabled: 0, + feature_level: 2, + fixed_rate_adverts: 'disabled', + fixed_rate_adverts_end_date: '2022-08-31', + float_rate_adverts: 'enabled', + float_rate_offset_limit: 10, + local_currencies: [ + { + display_name: 'Antarctic Dollar', + has_adverts: 0, + symbol: 'AAD', + }, + { + display_name: 'Afghan Afghani', + has_adverts: 1, + symbol: 'AFN', + }, + { + display_name: 'Albanian Lek', + has_adverts: 0, + symbol: 'ALL', + }, + { + display_name: 'Armenian Dram', + has_adverts: 0, + symbol: 'AMD', + }, + { + display_name: 'Netherlands Antillean Guilder', + has_adverts: 0, + symbol: 'ANG', + }, + { + display_name: 'Angolan Kwanza', + has_adverts: 0, + symbol: 'AOA', + }, + { + display_name: 'Argentine Peso', + has_adverts: 1, + symbol: 'ARS', + }, + { + display_name: 'Australian Dollar', + has_adverts: 0, + symbol: 'AUD', + }, + { + display_name: 'Aruban Florin', + has_adverts: 0, + symbol: 'AWG', + }, + { + display_name: 'Azerbaijan Manat', + has_adverts: 0, + symbol: 'AZN', + }, + { + display_name: 'Convertible Mark', + has_adverts: 0, + symbol: 'BAM', + }, + { + display_name: 'Barbados Dollar', + has_adverts: 1, + symbol: 'BBD', + }, + { + display_name: 'Bangladeshi Taka', + has_adverts: 1, + symbol: 'BDT', + }, + { + display_name: 'Bahraini Dinar', + has_adverts: 0, + symbol: 'BHD', + }, + { + display_name: 'Burundi Franc', + has_adverts: 1, + symbol: 'BIF', + }, + { + display_name: 'Bermudian Dollar', + has_adverts: 0, + symbol: 'BMD', + }, + { + display_name: 'Brunei Dollar', + has_adverts: 0, + symbol: 'BND', + }, + { + display_name: 'Boliviano', + has_adverts: 1, + symbol: 'BOB', + }, + { + display_name: 'Brazilian Real', + has_adverts: 1, + symbol: 'BRL', + }, + { + display_name: 'Bahamian Dollar', + has_adverts: 0, + symbol: 'BSD', + }, + { + display_name: 'Bhutanese Ngultrum', + has_adverts: 0, + symbol: 'BTN', + }, + { + display_name: 'Botswana Pula', + has_adverts: 1, + symbol: 'BWP', + }, + { + display_name: 'Belarusian Ruble', + has_adverts: 0, + symbol: 'BYN', + }, + { + display_name: 'Belize Dollar', + has_adverts: 0, + symbol: 'BZD', + }, + { + display_name: 'Congolese Franc', + has_adverts: 1, + symbol: 'CDF', + }, + { + display_name: 'Swiss Franc', + has_adverts: 0, + symbol: 'CHF', + }, + { + display_name: 'Chilean Peso', + has_adverts: 1, + symbol: 'CLP', + }, + { + display_name: 'Yuan Renminbi', + has_adverts: 1, + symbol: 'CNY', + }, + { + display_name: 'Colombian Peso', + has_adverts: 1, + symbol: 'COP', + }, + { + display_name: 'Costa Rican Colon', + has_adverts: 1, + symbol: 'CRC', + }, + { + display_name: 'Cabo Verde Escudo', + has_adverts: 0, + symbol: 'CVE', + }, + { + display_name: 'Djibouti Franc', + has_adverts: 0, + symbol: 'DJF', + }, + { + display_name: 'Danish Krone', + has_adverts: 0, + symbol: 'DKK', + }, + { + display_name: 'Dominican Peso', + has_adverts: 1, + symbol: 'DOP', + }, + { + display_name: 'Algerian Dinar', + has_adverts: 0, + symbol: 'DZD', + }, + { + display_name: 'Ecuadorian Sucre', + has_adverts: 0, + symbol: 'ECS', + }, + { + display_name: 'Egyptian Pound', + has_adverts: 0, + symbol: 'EGP', + }, + { + display_name: 'Eritrean Nakfa', + has_adverts: 0, + symbol: 'ERN', + }, + { + display_name: 'Ethiopian Birr', + has_adverts: 0, + symbol: 'ETB', + }, + { + display_name: 'Euro', + has_adverts: 0, + symbol: 'EUR', + }, + { + display_name: 'Fiji Dollar', + has_adverts: 0, + symbol: 'FJD', + }, + { + display_name: 'Falkland Islands Pound', + has_adverts: 0, + symbol: 'FKP', + }, + { + display_name: 'Pound Sterling', + has_adverts: 0, + symbol: 'GBP', + }, + { + display_name: 'Georgian Lari', + has_adverts: 0, + symbol: 'GEL', + }, + { + display_name: 'Ghanaian Cedi (old)', + has_adverts: 0, + symbol: 'GHC', + }, + { + display_name: 'Ghana Cedi', + has_adverts: 1, + symbol: 'GHS', + }, + { + display_name: 'Gibraltar Pound', + has_adverts: 0, + symbol: 'GIP', + }, + { + display_name: 'Gambian Dalasi', + has_adverts: 0, + symbol: 'GMD', + }, + { + display_name: 'Guinean Franc', + has_adverts: 1, + symbol: 'GNF', + }, + { + display_name: 'Guatemalan Quetzal', + has_adverts: 0, + symbol: 'GTQ', + }, + { + display_name: 'Guyana Dollar', + has_adverts: 0, + symbol: 'GYD', + }, + { + display_name: 'Honduran Lempira', + has_adverts: 0, + symbol: 'HNL', + }, + { + display_name: 'Haitian Gourde', + has_adverts: 1, + symbol: 'HTG', + }, + { + display_name: 'Indonesian Rupiah', + has_adverts: 1, + symbol: 'IDR', + }, + { + display_name: 'New Israeli Sheqel', + has_adverts: 0, + symbol: 'ILS', + }, + { + display_name: 'Indian Rupee', + has_adverts: 1, + symbol: 'INR', + }, + { + display_name: 'Iraqi Dinar', + has_adverts: 0, + symbol: 'IQD', + }, + { + display_name: 'Iceland Krona', + has_adverts: 0, + symbol: 'ISK', + }, + { + display_name: 'Jamaican Dollar', + has_adverts: 1, + symbol: 'JMD', + }, + { + display_name: 'Jordanian Dinar', + has_adverts: 0, + symbol: 'JOD', + }, + { + display_name: 'Japanese Yen', + has_adverts: 0, + symbol: 'JPY', + }, + { + display_name: 'Kenyan Shilling', + has_adverts: 1, + symbol: 'KES', + }, + { + display_name: 'Kyrgyzstani Som', + has_adverts: 0, + symbol: 'KGS', + }, + { + display_name: 'Cambodian Riel', + has_adverts: 0, + symbol: 'KHR', + }, + { + display_name: 'Comorian Franc', + has_adverts: 0, + symbol: 'KMF', + }, + { + display_name: 'South Korean Won', + has_adverts: 0, + symbol: 'KRW', + }, + { + display_name: 'Kuwaiti Dinar', + has_adverts: 0, + symbol: 'KWD', + }, + { + display_name: 'Kazakhstani Tenge', + has_adverts: 0, + symbol: 'KZT', + }, + { + display_name: 'Lao Kip', + has_adverts: 0, + symbol: 'LAK', + }, + { + display_name: 'Lebanese Pound', + has_adverts: 0, + symbol: 'LBP', + }, + { + display_name: 'Sri Lanka Rupee', + has_adverts: 1, + symbol: 'LKR', + }, + { + display_name: 'Liberian Dollar', + has_adverts: 1, + symbol: 'LRD', + }, + { + display_name: 'Lesotho Loti', + has_adverts: 0, + symbol: 'LSL', + }, + { + display_name: 'Libyan Dinar', + has_adverts: 0, + symbol: 'LYD', + }, + { + display_name: 'Moroccan Dirham', + has_adverts: 0, + symbol: 'MAD', + }, + { + display_name: 'Moldovan Leu', + has_adverts: 0, + symbol: 'MDL', + }, + { + display_name: 'Malagasy Ariary', + has_adverts: 0, + symbol: 'MGA', + }, + { + display_name: 'Macedonian Denar', + has_adverts: 0, + symbol: 'MKD', + }, + { + display_name: 'Mongolian Tögrög', + has_adverts: 0, + symbol: 'MNT', + }, + { + display_name: 'Macanese Pataca', + has_adverts: 0, + symbol: 'MOP', + }, + { + display_name: 'Mauritanian Ouguiya', + has_adverts: 0, + symbol: 'MRU', + }, + { + display_name: 'Mauritius Rupee', + has_adverts: 1, + symbol: 'MUR', + }, + { + display_name: 'Maldivian Rufiyaa', + has_adverts: 0, + symbol: 'MVR', + }, + { + display_name: 'Malawi Kwacha', + has_adverts: 1, + symbol: 'MWK', + }, + { + display_name: 'Mexican Peso', + has_adverts: 1, + symbol: 'MXN', + }, + { + display_name: 'Mozambique Metical (old)', + has_adverts: 0, + symbol: 'MZM', + }, + { + display_name: 'Mozambique Metical', + has_adverts: 1, + symbol: 'MZN', + }, + { + display_name: 'Namibia Dollar', + has_adverts: 1, + symbol: 'NAD', + }, + { + display_name: 'Cordoba Oro', + has_adverts: 1, + symbol: 'NIO', + }, + { + display_name: 'Norwegian Krone', + has_adverts: 0, + symbol: 'NOK', + }, + { + display_name: 'Nepalese Rupee', + has_adverts: 0, + symbol: 'NPR', + }, + { + display_name: 'New Zealand Dollar', + has_adverts: 1, + symbol: 'NZD', + }, + { + display_name: 'Omani Rial', + has_adverts: 1, + symbol: 'OMR', + }, + { + display_name: 'Panamanian Balboa', + has_adverts: 1, + symbol: 'PAB', + }, + { + display_name: 'Peruvian Sol', + has_adverts: 1, + symbol: 'PEN', + }, + { + display_name: 'Papua New Guinean Kina', + has_adverts: 0, + symbol: 'PGK', + }, + { + display_name: 'Philippine Peso', + has_adverts: 1, + symbol: 'PHP', + }, + { + display_name: 'Pakistan Rupee', + has_adverts: 1, + symbol: 'PKR', + }, + { + display_name: 'Qatari Riyal', + has_adverts: 1, + symbol: 'QAR', + }, + { + display_name: 'Serbian Dinar', + has_adverts: 0, + symbol: 'RSD', + }, + { + display_name: 'Russian Ruble', + has_adverts: 1, + symbol: 'RUB', + }, + { + display_name: 'Saudi Riyal', + has_adverts: 0, + symbol: 'SAR', + }, + { + display_name: 'Solomon Islands Dollar', + has_adverts: 0, + symbol: 'SBD', + }, + { + display_name: 'Seychelles Rupee', + has_adverts: 0, + symbol: 'SCR', + }, + { + display_name: 'Sudanese Pound', + has_adverts: 0, + symbol: 'SDG', + }, + { + display_name: 'Singapore Dollar', + has_adverts: 0, + symbol: 'SGD', + }, + { + display_name: 'Saint Helena Pound', + has_adverts: 0, + symbol: 'SHP', + }, + { + display_name: 'Sierra Leonean Leone', + has_adverts: 0, + symbol: 'SLL', + }, + { + display_name: 'Somali Shilling', + has_adverts: 1, + symbol: 'SOS', + }, + { + display_name: 'Surinam Dollar', + has_adverts: 0, + symbol: 'SRD', + }, + { + display_name: 'South Sudanese Pound', + has_adverts: 0, + symbol: 'SSP', + }, + { + display_name: 'São Tomé and Príncipe Dobra', + has_adverts: 0, + symbol: 'STN', + }, + { + display_name: 'El Salvador Colon', + has_adverts: 0, + symbol: 'SVC', + }, + { + display_name: 'Swazi Lilangeni', + has_adverts: 1, + symbol: 'SZL', + }, + { + display_name: 'Thai Baht', + has_adverts: 0, + is_default: 1, + symbol: 'THB', + }, + { + display_name: 'Tajikistani Somoni', + has_adverts: 0, + symbol: 'TJS', + }, + { + display_name: 'Turkmenistan New Manat', + has_adverts: 0, + symbol: 'TMT', + }, + { + display_name: 'Tunisian Dinar', + has_adverts: 0, + symbol: 'TND', + }, + { + display_name: 'Tongan Paʻanga', + has_adverts: 0, + symbol: 'TOP', + }, + { + display_name: 'Turkish Lira', + has_adverts: 1, + symbol: 'TRY', + }, + { + display_name: 'Trinidad and Tobago Dollar', + has_adverts: 0, + symbol: 'TTD', + }, + { + display_name: 'New Taiwan Dollar', + has_adverts: 0, + symbol: 'TWD', + }, + { + display_name: 'Tanzanian Shilling', + has_adverts: 1, + symbol: 'TZS', + }, + { + display_name: 'Ukrainian Hryvnia', + has_adverts: 0, + symbol: 'UAH', + }, + { + display_name: 'Uganda Shilling', + has_adverts: 1, + symbol: 'UGX', + }, + { + display_name: 'US Dollar', + has_adverts: 1, + symbol: 'USD', + }, + { + display_name: 'Uruguayan Peso', + has_adverts: 1, + symbol: 'UYU', + }, + { + display_name: 'Uzbekistan Sum', + has_adverts: 0, + symbol: 'UZS', + }, + { + display_name: 'Venezuelan Bolívar', + has_adverts: 0, + symbol: 'VEB', + }, + { + display_name: 'Venezuelan Bolívar Fuente', + has_adverts: 0, + symbol: 'VEF', + }, + { + display_name: 'Venezuelan Bolívar Soberano', + has_adverts: 1, + symbol: 'VES', + }, + { + display_name: 'Vietnamese Đồng', + has_adverts: 0, + symbol: 'VND', + }, + { + display_name: 'Samoan Tala', + has_adverts: 0, + symbol: 'WST', + }, + { + display_name: 'CFA Franc BEAC', + has_adverts: 1, + symbol: 'XAF', + }, + { + display_name: 'East Caribbean Dollar', + has_adverts: 0, + symbol: 'XCD', + }, + { + display_name: 'CFA Franc BCEAO', + has_adverts: 1, + symbol: 'XOF', + }, + { + display_name: 'CFP Franc', + has_adverts: 0, + symbol: 'XPF', + }, + { + display_name: 'Yemeni Rial', + has_adverts: 0, + symbol: 'YER', + }, + { + display_name: 'South African Rand', + has_adverts: 1, + symbol: 'ZAR', + }, + { + display_name: 'Zambian Kwacha (old)', + has_adverts: 0, + symbol: 'ZMK', + }, + { + display_name: 'Zambian Kwacha', + has_adverts: 1, + symbol: 'ZMW', + }, + { + display_name: 'Zimbabwe Dollar', + has_adverts: 0, + symbol: 'ZWD', + }, + { + display_name: 'Zimbabwe Dollar', + has_adverts: 1, + symbol: 'ZWL', + }, + ], + maximum_advert_amount: 5001, + maximum_order_amount: 1000, + order_daily_limit: 200, + order_payment_period: 60, + payment_methods_enabled: 1, + review_period: 24, + supported_currencies: ['usd'], + }, + payment_agents: { + initial_deposit_per_country: { + BR: 3000, + BW: 2000, + ID: 3000, + IN: 3000, + KE: 3000, + LK: 3000, + NG: 3000, + TZ: 3000, + ZA: 3000, + ZW: 2000, + default: 500, + }, + }, + site_status: 'up', + supported_languages: [ + 'EN', + 'ID', + 'RU', + 'ES', + 'FR', + 'IT', + 'PT', + 'PL', + 'DE', + 'ZH_CN', + 'VI', + 'ZH_TW', + 'TH', + 'TR', + 'KO', + 'AR', + 'BN', + 'SI', + ], + terms_conditions_version: 'Version 4.2.0 2020-08-07', + }, + }; + } +} diff --git a/packages/integration/src/mocks/location/residents_list.ts b/packages/integration/src/mocks/location/residents_list.ts new file mode 100644 index 000000000000..d42273c6de48 --- /dev/null +++ b/packages/integration/src/mocks/location/residents_list.ts @@ -0,0 +1,6972 @@ +import { Context } from '../../utils/mocks/mocks'; + +function mock_residents_list(context: Context) { + if (context.request.residence_list === 1) { + context.response = { + echo_req: { + req_id: context.req_id, + residence_list: 1, + }, + msg_type: 'residence_list', + req_id: context.req_id, + residence_list: [ + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '93', + text: 'Afghanistan', + value: 'af', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '35818', + text: 'Aland Islands', + value: 'ax', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '355', + text: 'Albania', + tin_format: ['^[A-Ta-t0-9]\\d{8}[A-Wa-w]$'], + value: 'al', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '213', + text: 'Algeria', + value: 'dz', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '684', + text: 'American Samoa', + value: 'as', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '376', + text: 'Andorra', + tin_format: ['^[FfEeAaLlCcDdGgOoPpUu]\\d{6}[a-zA-Z]$'], + value: 'ad', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '244', + text: 'Angola', + value: 'ao', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1264', + text: 'Anguilla', + value: 'ai', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '672', + selected: 'selected', + text: 'Antarctica', + value: 'aq', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1268', + text: 'Antigua and Barbuda', + tin_format: ['^\\d{6}$'], + value: 'ag', + }, + { + identity: { + services: { + idv: { + documents_supported: { + dni: { + display_name: 'Documento Nacional de Identidad', + format: '^\\d{7,8}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '54', + text: 'Argentina', + tin_format: ['^(20|23|24|25|26|27|30|33)\\d{9}$'], + value: 'ar', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '374', + text: 'Armenia', + value: 'am', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '297', + text: 'Aruba', + tin_format: ['^\\d{8}$'], + value: 'aw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + immigration_status_document: { + display_name: 'Immigration Status Document', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '61', + text: 'Australia', + value: 'au', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + asylum_registration_card: { + display_name: 'Asylum Registration Card', + }, + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '43', + text: 'Austria', + tin_format: ['^\\d{9}$'], + value: 'at', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '994', + text: 'Azerbaijan', + tin_format: ['^\\d{10}$'], + value: 'az', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1242', + text: 'Bahamas', + value: 'bs', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '973', + text: 'Bahrain', + value: 'bh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '880', + text: 'Bangladesh', + value: 'bd', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1246', + text: 'Barbados', + value: 'bb', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '375', + text: 'Belarus', + value: 'by', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '32', + text: 'Belgium', + value: 'be', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '501', + text: 'Belize', + tin_format: ['^\\d{6}(10|13|66)$'], + value: 'bz', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '229', + text: 'Benin', + value: 'bj', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1441', + text: 'Bermuda', + value: 'bm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '975', + text: 'Bhutan', + value: 'bt', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '591', + text: 'Bolivia', + value: 'bo', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '387', + text: 'Bosnia and Herzegovina', + value: 'ba', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '267', + text: 'Botswana', + value: 'bw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + text: 'Bouvet Island', + value: 'bv', + }, + { + identity: { + services: { + idv: { + documents_supported: { + cpf: { + display_name: 'CPF', + format: '^[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]{2}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '55', + text: 'Brazil', + tin_format: ['^(\\d{11}|\\d{14})$'], + value: 'br', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '246', + text: 'British Indian Ocean Territory', + value: 'io', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1284', + text: 'British Virgin Islands', + value: 'vg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '673', + text: 'Brunei', + value: 'bn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '359', + text: 'Bulgaria', + tin_format: ['^\\d{10}$'], + value: 'bg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '226', + text: 'Burkina Faso', + value: 'bf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '257', + text: 'Burundi', + value: 'bi', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '855', + text: 'Cambodia', + value: 'kh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '237', + text: 'Cameroon', + value: 'cm', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1', + text: 'Canada', + value: 'ca', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '238', + text: 'Cape Verde', + value: 'cv', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '599', + text: 'Caribbean Netherlands', + value: 'bq', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1345', + text: 'Cayman Islands', + value: 'ky', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '236', + text: 'Central African Republic', + value: 'cf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '235', + text: 'Chad', + value: 'td', + }, + { + identity: { + services: { + idv: { + documents_supported: { + national_id: { + display_name: 'National ID Number', + format: '^\\d{8}[A-Za-z0-9]$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '56', + text: 'Chile', + tin_format: ['^\\d{7,8}[0-9Kk]$'], + value: 'cl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + immigration_status_document: { + display_name: 'Immigration Status Document', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '86', + text: 'China', + tin_format: [ + '^\\d{17}[Xx\\d]$', + '^[CcWwHhMmTt]\\d{16}[xX\\d]$', + '^[Jj]\\d{14}$', + '^(\\d{15}|\\d{18})$', + '^\\d{8}\\w{10}$', + ], + value: 'cn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '618', + text: 'Christmas Island', + value: 'cx', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '6189162', + text: 'Cocos (Keeling) Islands', + value: 'cc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '57', + text: 'Colombia', + tin_format: ['^\\d{8,10}$'], + value: 'co', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '269', + text: 'Comoros', + value: 'km', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '242', + text: 'Congo - Brazzaville', + value: 'cg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '243', + text: 'Congo - Kinshasa', + value: 'cd', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '682', + text: 'Cook Islands', + tin_format: ['^\\d{5}$'], + value: 'ck', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '506', + text: 'Costa Rica', + tin_format: ['^\\d{9,12}$'], + value: 'cr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '225', + text: "Cote d'Ivoire", + value: 'ci', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '385', + text: 'Croatia', + tin_format: ['^\\d{11}$'], + value: 'hr', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '53', + text: 'Cuba', + value: 'cu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '5999', + text: 'Curacao', + value: 'cw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '357', + text: 'Cyprus', + tin_format: ['^\\d{8}[A-Za-z]$'], + value: 'cy', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '420', + text: 'Czech Republic', + tin_format: ['^\\d{9,10}$'], + value: 'cz', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '45', + text: 'Denmark', + tin_format: ['^\\d{10}$'], + value: 'dk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '253', + text: 'Djibouti', + value: 'dj', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1767', + text: 'Dominica', + tin_format: ['^[1-9]\\d{5}$'], + value: 'dm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1809', + text: 'Dominican Republic', + value: 'do', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '593', + text: 'Ecuador', + tin_format: ['^\\d{10}001$', '^\\d{2}6\\d{6}0001$'], + value: 'ec', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '20', + text: 'Egypt', + value: 'eg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '503', + text: 'El Salvador', + value: 'sv', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '240', + text: 'Equatorial Guinea', + value: 'gq', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '291', + text: 'Eritrea', + value: 'er', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '372', + text: 'Estonia', + tin_format: ['^\\d{11}$'], + value: 'ee', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '251', + text: 'Ethiopia', + value: 'et', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '500', + text: 'Falkland Islands', + value: 'fk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '298', + text: 'Faroe Islands', + tin_format: ['^\\d{9}$'], + value: 'fo', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '679', + text: 'Fiji', + value: 'fj', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '358', + text: 'Finland', + tin_format: ['^\\d{6}[-+A]\\d{3}\\w$'], + value: 'fi', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + asylum_registration_card: { + display_name: 'Asylum Registration Card', + }, + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '33', + text: 'France', + tin_format: ['^\\d{13}$'], + value: 'fr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '594', + text: 'French Guiana', + value: 'gf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '689', + text: 'French Polynesia', + value: 'pf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + text: 'French Southern Territories', + value: 'tf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '241', + text: 'Gabon', + value: 'ga', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '220', + text: 'Gambia', + value: 'gm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '995', + text: 'Georgia', + value: 'ge', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '49', + text: 'Germany', + tin_format: ['^\\d{11}$'], + value: 'de', + }, + { + identity: { + services: { + idv: { + documents_supported: { + drivers_license: { + display_name: 'Drivers License', + format: '^((\\d{8}[a-zA-Z]{1}\\d{1})|([a-zA-Z]{1}\\d{7})|([a-zA-Z]{3}\\-\\d{8}\\-\\d{5}))$', + }, + passport: { + display_name: 'Passport', + format: '^(?i)G[a-zA-Z0-9]{7,9}$', + }, + ssnit: { + display_name: 'Social Security and National Insurance Trust (SSNIT)', + format: '^[a-zA-Z]{1}[0-9]{12,14}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '233', + text: 'Ghana', + tin_format: ['^(GHA)-[0-9]{8,9}-[0-9]{1}$', '^(GRA|P00|C00|G00|Q00|V00)[A-Za-z0-9]{8}$'], + value: 'gh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '350', + text: 'Gibraltar', + tin_format: ['^\\d{6}$'], + value: 'gi', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '30', + text: 'Greece', + tin_format: ['^\\d{9}$'], + value: 'gr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '299', + text: 'Greenland', + tin_format: ['^\\d{10}$'], + value: 'gl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1473', + text: 'Grenada', + tin_format: ['^\\d{8}$'], + value: 'gd', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '590', + text: 'Guadeloupe', + value: 'gp', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '671', + text: 'Guam', + value: 'gu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '502', + text: 'Guatemala', + value: 'gt', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '441481', + text: 'Guernsey', + value: 'gg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '224', + text: 'Guinea', + value: 'gn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '245', + text: 'Guinea-Bissau', + value: 'gw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '592', + text: 'Guyana', + value: 'gy', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '509', + text: 'Haiti', + value: 'ht', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + text: 'Heard & McDonald Islands', + value: 'hm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '504', + text: 'Honduras', + value: 'hn', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '852', + text: 'Hong Kong SAR China', + value: 'hk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '36', + text: 'Hungary', + tin_format: ['^\\d{10}$'], + value: 'hu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '354', + text: 'Iceland', + tin_format: ['^\\d{10}$'], + value: 'is', + }, + { + identity: { + services: { + idv: { + documents_supported: { + aadhaar: { + additional: { + display_name: 'PAN Card', + format: '^[a-zA-Z]{5}\\d{4}[a-zA-Z]{1}$', + }, + display_name: 'Aadhaar Card', + format: '^[0-9]{12}$', + }, + drivers_license: { + display_name: 'Drivers License', + format: '^[a-zA-Z0-9]{10,17}$', + }, + epic: { + display_name: 'Voter ID', + format: '^[a-zA-Z]{3}[0-9]{7}$', + }, + pan: { + display_name: 'PAN Card', + format: '^[a-zA-Z]{5}\\d{4}[a-zA-Z]{1}$', + }, + passport: { + additional: { + display_name: 'File Number', + format: '^.{15}$', + }, + display_name: 'Passport', + format: '^.{8}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '91', + text: 'India', + tin_format: ['^[a-zA-Z]{5}\\d{4}[a-zA-Z]$'], + value: 'in', + }, + { + identity: { + services: { + idv: { + documents_supported: { + nik: { + display_name: 'Nomor Induk Kependudukan', + format: '^\\d{16}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '62', + text: 'Indonesia', + tin_format: ['^\\d{15}$'], + value: 'id', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '98', + text: 'Iran', + value: 'ir', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '964', + text: 'Iraq', + value: 'iq', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '353', + text: 'Ireland', + tin_format: ['^\\d{7}[A-Za-z]{1,2}$'], + value: 'ie', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '44', + text: 'Isle of Man', + value: 'im', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '972', + text: 'Israel', + value: 'il', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '39', + text: 'Italy', + tin_format: [ + '^[A-Za-z]{6}\\d{2}[A-Za-z]\\d{2}[A-Za-z]\\d{3}[A-Za-z]$', + '^[A-Za-z]{6}\\d{2}[A-Za-z]\\d{2}[A-Za-z0-9]{4}[A-Za-z]$', + ], + value: 'it', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1876', + text: 'Jamaica', + value: 'jm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '81', + text: 'Japan', + value: 'jp', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '441534', + text: 'Jersey', + value: 'je', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '962', + text: 'Jordan', + value: 'jo', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '7', + text: 'Kazakhstan', + tin_format: ['^\\d{12}$'], + value: 'kz', + }, + { + identity: { + services: { + idv: { + documents_supported: { + alien_card: { + display_name: 'Alien Card', + format: '^[0-9]{6,9}$', + }, + national_id: { + display_name: 'National ID Number', + format: '^[0-9]{1,9}$', + }, + passport: { + display_name: 'Passport', + format: '^[A-Z0-9]{7,9}$', + }, + }, + has_visual_sample: 1, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '254', + text: 'Kenya', + value: 'ke', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '686', + text: 'Kiribati', + value: 'ki', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '965', + text: 'Kuwait', + tin_format: ['^\\d{12}$'], + value: 'kw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '996', + text: 'Kyrgyzstan', + value: 'kg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '856', + text: 'Laos', + value: 'la', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '371', + text: 'Latvia', + tin_format: ['^\\d{11}$', '^32\\d{9}$'], + value: 'lv', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '961', + text: 'Lebanon', + tin_format: ['^\\d+$'], + value: 'lb', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '266', + text: 'Lesotho', + value: 'ls', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '231', + text: 'Liberia', + value: 'lr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '218', + text: 'Libya', + value: 'ly', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '417', + text: 'Liechtenstein', + tin_format: ['^\\d{1,12}$'], + value: 'li', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '370', + text: 'Lithuania', + tin_format: ['^\\d{11}$'], + value: 'lt', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '352', + text: 'Luxembourg', + tin_format: ['^\\d{13}$'], + value: 'lu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '853', + text: 'Macau SAR China', + tin_format: ['^\\d+$'], + value: 'mo', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '389', + text: 'Macedonia', + value: 'mk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '261', + text: 'Madagascar', + value: 'mg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '265', + text: 'Malawi', + value: 'mw', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '60', + text: 'Malaysia', + value: 'my', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '960', + text: 'Maldives', + value: 'mv', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '223', + text: 'Mali', + value: 'ml', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '356', + text: 'Malta', + value: 'mt', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '692', + text: 'Marshall Islands', + tin_format: ['^\\d{7,8}$'], + value: 'mh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '596', + text: 'Martinique', + value: 'mq', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '222', + text: 'Mauritania', + value: 'mr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '230', + text: 'Mauritius', + tin_format: ['^[17823]\\d{7}$'], + value: 'mu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '262269', + text: 'Mayotte', + value: 'yt', + }, + { + identity: { + services: { + idv: { + documents_supported: { + curp: { + display_name: 'Clave Única de Registro de Población', + format: '^[a-zA-Z]{4}[0-9]{6}[MmHh]{1}[a-zA-Z]{5}[a-zA-Z0-9]{2}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '52', + text: 'Mexico', + tin_format: ['^[a-zA-Z]{3,4}\\d{6}\\w{3}$'], + value: 'mx', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '691', + text: 'Micronesia', + value: 'fm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '373', + text: 'Moldova', + value: 'md', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '377', + text: 'Monaco', + value: 'mc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '976', + text: 'Mongolia', + value: 'mn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '382', + text: 'Montenegro', + value: 'me', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1664', + text: 'Montserrat', + value: 'ms', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '212', + text: 'Morocco', + value: 'ma', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '258', + text: 'Mozambique', + value: 'mz', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '95', + text: 'Myanmar (Burma)', + value: 'mm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '264', + text: 'Namibia', + value: 'na', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '674', + text: 'Nauru', + tin_format: ['^\\d{9}$'], + value: 'nr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '977', + text: 'Nepal', + value: 'np', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + asylum_registration_card: { + display_name: 'Asylum Registration Card', + }, + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '31', + text: 'Netherlands', + tin_format: ['^\\d{9}$'], + value: 'nl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '687', + text: 'New Caledonia', + value: 'nc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '64', + text: 'New Zealand', + tin_format: ['^\\d{8,9}$'], + value: 'nz', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '505', + text: 'Nicaragua', + value: 'ni', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '227', + text: 'Niger', + value: 'ne', + }, + { + identity: { + services: { + idv: { + documents_supported: { + drivers_license: { + display_name: 'Drivers License', + format: '^[a-zA-Z]{3}([ -]{1})?[A-Z0-9]{6,12}$', + }, + nin_slip: { + display_name: 'National ID Number Slip', + format: '^[0-9]{11}$', + }, + }, + has_visual_sample: 1, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '234', + text: 'Nigeria', + tin_format: ['^\\d{10}$', '^\\d{8}$', '^[A-Za-z]\\d{4,8}$', '^\\d{11}$', '^\\d{12}$'], + value: 'ng', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '683', + text: 'Niue', + value: 'nu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '6723', + text: 'Norfolk Island', + value: 'nf', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '850', + text: 'North Korea', + value: 'kp', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1670', + text: 'Northern Mariana Islands', + value: 'mp', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + asylum_registration_card: { + display_name: 'Asylum Registration Card', + }, + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '47', + text: 'Norway', + value: 'no', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '968', + text: 'Oman', + value: 'om', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '92', + text: 'Pakistan', + tin_format: ['^\\d{13}$', '^\\d{7}$'], + value: 'pk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '680', + text: 'Palau', + value: 'pw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '970', + text: 'Palestinian Territories', + value: 'ps', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '507', + text: 'Panama', + tin_format: ['^[a-zA-Z0-9]\\d{7}$'], + value: 'pa', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '675', + text: 'Papua New Guinea', + value: 'pg', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '595', + text: 'Paraguay', + value: 'py', + }, + { + identity: { + services: { + idv: { + documents_supported: { + national_id: { + display_name: 'National ID Number', + format: '^\\d{8}$', + }, + }, + has_visual_sample: 0, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '51', + text: 'Peru', + value: 'pe', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + visa: { + display_name: 'Visa', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '63', + text: 'Philippines', + value: 'ph', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '649', + text: 'Pitcairn Islands', + value: 'pn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '48', + text: 'Poland', + tin_format: ['^\\d{10,11}$'], + value: 'pl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '351', + text: 'Portugal', + tin_format: ['^\\d{9}$'], + value: 'pt', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1787', + text: 'Puerto Rico', + value: 'pr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '974', + text: 'Qatar', + value: 'qa', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '262', + text: 'Reunion', + value: 're', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '40', + text: 'Romania', + tin_format: ['^\\d{13}$'], + value: 'ro', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '7', + text: 'Russia', + tin_format: ['^\\d{12}$'], + value: 'ru', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '250', + text: 'Rwanda', + value: 'rw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '590', + text: 'Saint Barthelemy', + value: 'bl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '290', + text: 'Saint Helena', + value: 'sh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1869', + text: 'Saint Kitts and Nevis', + value: 'kn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1758', + text: 'Saint Lucia', + tin_format: ['^\\d{1,6}$'], + value: 'lc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '590', + text: 'Saint Martin', + value: 'mf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '508', + text: 'Saint Pierre and Miquelon', + value: 'pm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '685', + text: 'Samoa', + value: 'ws', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '378', + text: 'San Marino', + tin_format: ['^\\d{8,9}$', '^[SsMm]\\d{5}$'], + value: 'sm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '239', + text: 'Sao Tome and Principe', + value: 'st', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '966', + text: 'Saudi Arabia', + tin_format: ['^\\d{10}$'], + value: 'sa', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '221', + text: 'Senegal', + value: 'sn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '381', + text: 'Serbia', + value: 'rs', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '248', + text: 'Seychelles', + tin_format: ['^\\d{2}[1-7]\\d{6}$'], + value: 'sc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '232', + text: 'Sierra Leone', + value: 'sl', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '65', + text: 'Singapore', + tin_format: [ + '^[SsTtFfGg]\\d{7}[A-Za-z]$', + '^[A-Za-z]{9,10}$', + '^[Ff]0000\\d{6}$', + '^[Ff]\\d{9}$', + '^([Ss]|[Tt][4])\\d{9}$', + '^[Aa]\\d{9}$', + ], + value: 'sg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '1721', + text: 'Sint Maarten', + value: 'sx', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '421', + text: 'Slovakia', + tin_format: ['^\\d{9,10}$'], + value: 'sk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '386', + text: 'Slovenia', + tin_format: ['^\\d{8}$'], + value: 'si', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '677', + text: 'Solomon Islands', + value: 'sb', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '252', + text: 'Somalia', + value: 'so', + }, + { + identity: { + services: { + idv: { + documents_supported: { + national_id: { + display_name: 'National ID Number', + format: '^[0-9]{13}$', + }, + }, + has_visual_sample: 1, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '27', + text: 'South Africa', + tin_format: ['^[01239]\\d{3}\\/?\\d{3}\\/?\\d{3}$'], + value: 'za', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '500', + text: 'South Georgia & South Sandwich Islands', + value: 'gs', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '82', + text: 'South Korea', + tin_format: ['^\\d{13}$'], + value: 'kr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '211', + text: 'South Sudan', + value: 'ss', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '34', + text: 'Spain', + tin_format: ['^[KkLlMmXxYyZz]\\d{7}[A-Za-z]$', '^\\d{8}[A-Za-z]$'], + value: 'es', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '94', + text: 'Sri Lanka', + value: 'lk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1784', + text: 'St. Vincent & Grenadines', + tin_format: ['^\\d+$'], + value: 'vc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '249', + text: 'Sudan', + value: 'sd', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '597', + text: 'Suriname', + value: 'sr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '4779', + text: 'Svalbard and Jan Mayen', + value: 'sj', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '268', + text: 'Swaziland', + value: 'sz', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '46', + text: 'Sweden', + tin_format: ['^\\d{10}$', '^\\d{12}$'], + value: 'se', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '41', + text: 'Switzerland', + tin_format: [ + '^756\\.[0-9]{4}\\.[0-9]{4}\\.[0-9]{2}$', + '^(CHE|che)-[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}$', + ], + value: 'ch', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '963', + text: 'Syria', + value: 'sy', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '886', + text: 'Taiwan', + value: 'tw', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '992', + text: 'Tajikistan', + value: 'tj', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + voter_id: { + display_name: 'Voter Id', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '255', + text: 'Tanzania', + value: 'tz', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '66', + text: 'Thailand', + value: 'th', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 0, + }, + }, + }, + phone_idd: '670', + text: 'Timor-Leste', + value: 'tl', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '228', + text: 'Togo', + value: 'tg', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '690', + text: 'Tokelau', + value: 'tk', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '676', + text: 'Tonga', + value: 'to', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1868', + text: 'Trinidad and Tobago', + value: 'tt', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '216', + text: 'Tunisia', + value: 'tn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '90', + text: 'Turkey', + tin_format: ['^\\d{10}$'], + value: 'tr', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '993', + text: 'Turkmenistan', + value: 'tm', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1649', + text: 'Turks and Caicos Islands', + value: 'tc', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '688', + text: 'Tuvalu', + value: 'tv', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + text: 'U.S. Outlying Islands', + value: 'um', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1340', + text: 'U.S. Virgin Islands', + value: 'vi', + }, + { + identity: { + services: { + idv: { + documents_supported: { + national_id_no_photo: { + additional: { + display_name: 'Card Number', + format: '^[a-zA-Z0-9]+$', + }, + display_name: 'National ID Number', + format: '^[a-zA-Z0-9]{14}$', + }, + }, + has_visual_sample: 1, + is_country_supported: 1, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '256', + text: 'Uganda', + value: 'ug', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '380', + text: 'Ukraine', + value: 'ua', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '971', + text: 'United Arab Emirates', + value: 'ae', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + asylum_registration_card: { + display_name: 'Asylum Registration Card', + }, + driving_licence: { + display_name: 'Driving Licence', + }, + immigration_status_document: { + display_name: 'Immigration Status Document', + }, + national_health_insurance_card: { + display_name: 'National Health Insurance Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '44', + text: 'United Kingdom', + tin_format: ['^\\d{10}$', '^[A-Za-z]{2}\\d{6}[A-Za-z]$'], + value: 'gb', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + visa: { + display_name: 'Visa', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '1', + text: 'United States', + value: 'us', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '598', + text: 'Uruguay', + tin_format: ['^\\d{8,9}$', '^\\d{8}001\\d$'], + value: 'uy', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '998', + text: 'Uzbekistan', + value: 'uz', + }, + { + disabled: 'DISABLED', + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '678', + text: 'Vanuatu', + value: 'vu', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '379', + text: 'Vatican City', + value: 'va', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '58', + text: 'Venezuela', + value: 've', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + residence_permit: { + display_name: 'Residence Permit', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '84', + text: 'Vietnam', + value: 'vn', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '681', + text: 'Wallis and Futuna', + value: 'wf', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: {}, + is_country_supported: 0, + }, + }, + }, + phone_idd: '21', + text: 'Western Sahara', + value: 'eh', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '967', + text: 'Yemen', + value: 'ye', + }, + { + identity: { + services: { + idv: { + documents_supported: {}, + has_visual_sample: 0, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + driving_licence: { + display_name: 'Driving Licence', + }, + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '260', + text: 'Zambia', + value: 'zm', + }, + { + identity: { + services: { + idv: { + documents_supported: { + national_id: { + display_name: 'National ID Number', + format: '^[0-9]{8,9}[a-zA-Z]{1}[0-9]{2}$', + }, + }, + has_visual_sample: 1, + is_country_supported: 0, + }, + onfido: { + documents_supported: { + national_identity_card: { + display_name: 'National Identity Card', + }, + passport: { + display_name: 'Passport', + }, + }, + is_country_supported: 1, + }, + }, + }, + phone_idd: '263', + text: 'Zimbabwe', + value: 'zw', + }, + ], + }; + } +} + +export default mock_residents_list; diff --git a/packages/integration/src/mocks/location/states_list.ts b/packages/integration/src/mocks/location/states_list.ts new file mode 100644 index 000000000000..4e2ab5b46586 --- /dev/null +++ b/packages/integration/src/mocks/location/states_list.ts @@ -0,0 +1,326 @@ +import { Context } from '../../utils/mocks/mocks'; + +function mock_states_list(context: Context) { + if (context.request.states_list === 'th') { + context.response = { + echo_req: { + req_id: context.req_id, + states_list: 'th', + }, + msg_type: 'states_list', + req_id: context.req_id, + states_list: [ + { + text: 'Amnat Charoen', + value: '37', + }, + { + text: 'Ang Thong', + value: '15', + }, + { + text: 'Buri Ram', + value: '31', + }, + { + text: 'Chachoengsao', + value: '24', + }, + { + text: 'Chai Nat', + value: '18', + }, + { + text: 'Chaiyaphum', + value: '36', + }, + { + text: 'Chanthaburi', + value: '22', + }, + { + text: 'Chiang Mai', + value: '50', + }, + { + text: 'Chiang Rai', + value: '57', + }, + { + text: 'Chon Buri', + value: '20', + }, + { + text: 'Chumphon', + value: '86', + }, + { + text: 'Kalasin', + value: '46', + }, + { + text: 'Kamphaeng Phet', + value: '62', + }, + { + text: 'Kanchanaburi', + value: '71', + }, + { + text: 'Khon Kaen', + value: '40', + }, + { + text: 'Krabi', + value: '81', + }, + { + text: 'Krung Thep Maha Nakhon Bangkok', + value: '10', + }, + { + text: 'Lampang', + value: '52', + }, + { + text: 'Lamphun', + value: '51', + }, + { + text: 'Loei', + value: '42', + }, + { + text: 'Lop Buri', + value: '16', + }, + { + text: 'Mae Hong Son', + value: '58', + }, + { + text: 'Maha Sarakham', + value: '44', + }, + { + text: 'Mukdahan', + value: '49', + }, + { + text: 'Nakhon Nayok', + value: '26', + }, + { + text: 'Nakhon Pathom', + value: '73', + }, + { + text: 'Nakhon Phanom', + value: '48', + }, + { + text: 'Nakhon Ratchasima', + value: '30', + }, + { + text: 'Nakhon Sawan', + value: '60', + }, + { + text: 'Nakhon Si Thammarat', + value: '80', + }, + { + text: 'Nan', + value: '55', + }, + { + text: 'Narathiwat', + value: '96', + }, + { + text: 'Nong Bua Lam Phu', + value: '39', + }, + { + text: 'Nong Khai', + value: '43', + }, + { + text: 'Nonthaburi', + value: '12', + }, + { + text: 'Pathum Thani', + value: '13', + }, + { + text: 'Pattani', + value: '94', + }, + { + text: 'Phangnga', + value: '82', + }, + { + text: 'Phatthalung', + value: '93', + }, + { + text: 'Phatthaya', + value: 'S', + }, + { + text: 'Phayao', + value: '56', + }, + { + text: 'Phetchabun', + value: '67', + }, + { + text: 'Phetchaburi', + value: '76', + }, + { + text: 'Phichit', + value: '66', + }, + { + text: 'Phitsanulok', + value: '65', + }, + { + text: 'Phra Nakhon Si Ayutthaya', + value: '14', + }, + { + text: 'Phrae', + value: '54', + }, + { + text: 'Phuket', + value: '83', + }, + { + text: 'Prachin Buri', + value: '25', + }, + { + text: 'Prachuap Khiri Khan', + value: '77', + }, + { + text: 'Ranong', + value: '85', + }, + { + text: 'Ratchaburi', + value: '70', + }, + { + text: 'Rayong', + value: '21', + }, + { + text: 'Roi Et', + value: '45', + }, + { + text: 'Sa Kaeo', + value: '27', + }, + { + text: 'Sakon Nakhon', + value: '47', + }, + { + text: 'Samut Prakan', + value: '11', + }, + { + text: 'Samut Sakhon', + value: '74', + }, + { + text: 'Samut Songkhram', + value: '75', + }, + { + text: 'Saraburi', + value: '19', + }, + { + text: 'Satun', + value: '91', + }, + { + text: 'Si Sa Ket', + value: '33', + }, + { + text: 'Sing Buri', + value: '17', + }, + { + text: 'Songkhla', + value: '90', + }, + { + text: 'Sukhothai', + value: '64', + }, + { + text: 'Suphan Buri', + value: '72', + }, + { + text: 'Surat Thani', + value: '84', + }, + { + text: 'Surin', + value: '32', + }, + { + text: 'Tak', + value: '63', + }, + { + text: 'Trang', + value: '92', + }, + { + text: 'Trat', + value: '23', + }, + { + text: 'Ubon Ratchathani', + value: '34', + }, + { + text: 'Udon Thani', + value: '41', + }, + { + text: 'Uthai Thani', + value: '61', + }, + { + text: 'Uttaradit', + value: '53', + }, + { + text: 'Yala', + value: '95', + }, + { + text: 'Yasothon', + value: '35', + }, + ], + }; + } +} + +export default mock_states_list; diff --git a/end-to-end-test/utils/constants.ts b/packages/integration/src/utils/constants.ts similarity index 100% rename from end-to-end-test/utils/constants.ts rename to packages/integration/src/utils/constants.ts diff --git a/packages/integration/src/utils/mocks/mocks.ts b/packages/integration/src/utils/mocks/mocks.ts new file mode 100644 index 000000000000..703adcb0426f --- /dev/null +++ b/packages/integration/src/utils/mocks/mocks.ts @@ -0,0 +1,560 @@ +import * as https from 'https'; +import { EventEmitter } from 'events'; +import { Server as WsServer } from 'ws'; +import { generate } from 'selfsigned'; +import { Page } from '@playwright/test'; + +import type { + APITokenRequest, + APITokenResponse, + AccountLimitsRequest, + AccountLimitsResponse, + AccountStatusRequest, + AccountStatusResponse, + ActiveSymbolsRequest, + ActiveSymbolsResponse, + ApplicationDeleteRequest, + ApplicationDeleteResponse, + ApplicationGetDetailsRequest, + ApplicationGetDetailsResponse, + ApplicationListRequest, + ApplicationListResponse, + ApplicationMarkupDetailsRequest, + ApplicationMarkupDetailsResponse, + ApplicationMarkupStatisticsRequest, + ApplicationMarkupStatisticsResponse, + ApplicationRegisterRequest, + ApplicationRegisterResponse, + ApplicationUpdateRequest, + ApplicationUpdateResponse, + AssetIndexRequest, + AssetIndexResponse, + AuthorizeRequest, + AuthorizeResponse, + BalanceRequest, + BalanceResponse, + BuyContractForMultipleAccountsRequest, + BuyContractForMultipleAccountsResponse, + BuyContractRequest, + BuyContractResponse, + CancelAContractRequest, + CancelAContractResponse, + CashierInformationRequest, + CashierInformationResponse, + ContractsForSymbolRequest, + ContractsForSymbolResponse, + CopyTradingListRequest, + CopyTradingListResponse, + CopyTradingStartRequest, + CopyTradingStartResponse, + CopyTradingStatisticsRequest, + CopyTradingStatisticsResponse, + CopyTradingStopRequest, + CopyTradingStopResponse, + CountriesListRequest, + CountriesListResponse, + CryptocurrencyConfigurationsRequest, + CryptocurrencyConfigurationsResponse, + DocumentUploadRequest, + DocumentUploadResponse, + EconomicCalendarRequest, + EconomicCalendarResponse, + ExchangeRatesRequest, + ExchangeRatesResponse, + ForgetAllRequest, + ForgetAllResponse, + ForgetRequest, + ForgetResponse, + GetAccountSettingsRequest, + GetAccountSettingsResponse, + GetFinancialAssessmentRequest, + GetFinancialAssessmentResponse, + GetSelfExclusionRequest, + GetSelfExclusionResponse, + IdentityVerificationAddDocumentRequest, + IdentityVerificationAddDocumentResponse, + LandingCompanyDetailsRequest, + LandingCompanyDetailsResponse, + LandingCompanyRequest, + LandingCompanyResponse, + LogOutRequest, + LogOutResponse, + LoginHistoryRequest, + LoginHistoryResponse, + MT5AccountsListRequest, + MT5AccountsListResponse, + MT5DepositRequest, + MT5DepositResponse, + MT5GetSettingRequest, + MT5GetSettingResponse, + MT5NewAccountRequest, + MT5NewAccountResponse, + MT5PasswordChangeRequest, + MT5PasswordChangeResponse, + MT5PasswordCheckRequest, + MT5PasswordCheckResponse, + MT5PasswordResetRequest, + MT5PasswordResetResponse, + MT5WithdrawalRequest, + MT5WithdrawalResponse, + NewRealMoneyAccountDefaultLandingCompanyRequest, + NewRealMoneyAccountDefaultLandingCompanyResponse, + NewRealMoneyAccountDerivInvestmentEuropeLtdRequest, + NewRealMoneyAccountDerivInvestmentEuropeLtdResponse, + NewVirtualMoneyAccountRequest, + NewVirtualMoneyAccountResponse, + OAuthApplicationsRequest, + OAuthApplicationsResponse, + P2PAdvertCreateRequest, + P2PAdvertCreateResponse, + P2PAdvertInformationRequest, + P2PAdvertInformationResponse, + P2PAdvertListRequest, + P2PAdvertListResponse, + P2PAdvertUpdateRequest, + P2PAdvertUpdateResponse, + P2PAdvertiserAdvertsRequest, + P2PAdvertiserAdvertsResponse, + P2PAdvertiserCreateRequest, + P2PAdvertiserCreateResponse, + P2PAdvertiserInformationRequest, + P2PAdvertiserInformationResponse, + P2PAdvertiserListRequest, + P2PAdvertiserListResponse, + P2PAdvertiserPaymentMethodsRequest, + P2PAdvertiserPaymentMethodsResponse, + P2PAdvertiserRelationsRequest, + P2PAdvertiserRelationsResponse, + P2PAdvertiserUpdateRequest, + P2PAdvertiserUpdateResponse, + P2PChatCreateRequest, + P2PChatCreateResponse, + P2POrderCancelRequest, + P2POrderCancelResponse, + P2POrderConfirmRequest, + P2POrderConfirmResponse, + P2POrderCreateRequest, + P2POrderCreateResponse, + P2POrderDisputeRequest, + P2POrderDisputeResponse, + P2POrderInformationRequest, + P2POrderInformationResponse, + P2POrderListRequest, + P2POrderListResponse, + P2POrderReviewRequest, + P2POrderReviewResponse, + P2PPaymentMethodsRequest, + P2PPaymentMethodsResponse, + P2PPingRequest, + P2PPingResponse, + PaymentAgentCreateRequest, + PaymentAgentCreateResponse, + PaymentAgentDetailsRequest, + PaymentAgentDetailsResponse, + PaymentAgentListRequest, + PaymentAgentListResponse, + PaymentAgentTransferRequest, + PaymentAgentTransferResponse, + PaymentAgentWithdrawJustificationRequest, + PaymentAgentWithdrawJustificationResponse, + PaymentAgentWithdrawRequest, + PaymentAgentWithdrawResponse, + PaymentMethodsRequest, + PaymentMethodsResponse, + PayoutCurrenciesRequest, + PayoutCurrenciesResponse, + PingRequest, + PingResponse, + PortfolioRequest, + PortfolioResponse, + PriceProposalOpenContractsRequest, + PriceProposalOpenContractsResponse, + PriceProposalRequest, + PriceProposalResponse, + ProfitTableRequest, + ProfitTableResponse, + RealityCheckRequest, + RealityCheckResponse, + RevokeOauthApplicationRequest, + RevokeOauthApplicationResponse, + SellContractRequest, + SellContractResponse, + SellContractsMultipleAccountsRequest, + SellContractsMultipleAccountsResponse, + SellExpiredContractsRequest, + SellExpiredContractsResponse, + ServerListRequest, + ServerListResponse, + ServerStatusRequest, + ServerStatusResponse, + ServerTimeRequest, + ServerTimeResponse, + SetAccountCurrencyRequest, + SetAccountCurrencyResponse, + SetAccountSettingsRequest, + SetAccountSettingsResponse, + SetFinancialAssessmentRequest, + SetFinancialAssessmentResponse, + SetSelfExclusionRequest, + SetSelfExclusionResponse, + StatementRequest, + StatementResponse, + StatesListRequest, + StatesListResponse, + TermsAndConditionsApprovalRequest, + TermsAndConditionsApprovalResponse, + TicksHistoryRequest, + TicksHistoryResponse, + TicksStreamRequest, + TicksStreamResponse, + TopUpVirtualMoneyAccountRequest, + TopUpVirtualMoneyAccountResponse, + TradingDurationsRequest, + TradingDurationsResponse, + TradingPlatformInvestorPasswordResetRequest, + TradingPlatformInvestorPasswordResetResponse, + TradingPlatformPasswordResetRequest, + TradingPlatformPasswordResetResponse, + TradingTimesRequest, + TradingTimesResponse, + TransactionsStreamRequest, + TransactionsStreamResponse, + TransferBetweenAccountsRequest, + TransferBetweenAccountsResponse, + UnsubscribeEmailRequest, + UnsubscribeEmailResponse, + UpdateContractHistoryRequest, + UpdateContractHistoryResponse, + UpdateContractRequest, + UpdateContractResponse, + VerifyEmailCellxpertRequest, + VerifyEmailCellxpertResponse, + VerifyEmailRequest, + VerifyEmailResponse, +} from '@deriv/api-types'; + +type Request = + | APITokenRequest + | AccountLimitsRequest + | AccountStatusRequest + | ActiveSymbolsRequest + | ApplicationDeleteRequest + | ApplicationGetDetailsRequest + | ApplicationListRequest + | ApplicationMarkupDetailsRequest + | ApplicationMarkupStatisticsRequest + | ApplicationRegisterRequest + | ApplicationUpdateRequest + | AssetIndexRequest + | AuthorizeRequest + | BalanceRequest + | BuyContractForMultipleAccountsRequest + | BuyContractRequest + | CancelAContractRequest + | CashierInformationRequest + | ContractsForSymbolRequest + | CopyTradingListRequest + | CopyTradingStartRequest + | CopyTradingStatisticsRequest + | CopyTradingStopRequest + | CountriesListRequest + | CryptocurrencyConfigurationsRequest + | DocumentUploadRequest + | EconomicCalendarRequest + | ExchangeRatesRequest + | ForgetAllRequest + | ForgetRequest + | GetAccountSettingsRequest + | GetFinancialAssessmentRequest + | GetSelfExclusionRequest + | IdentityVerificationAddDocumentRequest + | LandingCompanyDetailsRequest + | LandingCompanyRequest + | LogOutRequest + | LoginHistoryRequest + | MT5AccountsListRequest + | MT5DepositRequest + | MT5GetSettingRequest + | MT5NewAccountRequest + | MT5PasswordChangeRequest + | MT5PasswordCheckRequest + | MT5PasswordResetRequest + | MT5WithdrawalRequest + | NewRealMoneyAccountDefaultLandingCompanyRequest + | NewRealMoneyAccountDerivInvestmentEuropeLtdRequest + | NewVirtualMoneyAccountRequest + | OAuthApplicationsRequest + | P2PAdvertCreateRequest + | P2PAdvertInformationRequest + | P2PAdvertListRequest + | P2PAdvertUpdateRequest + | P2PAdvertiserAdvertsRequest + | P2PAdvertiserCreateRequest + | P2PAdvertiserInformationRequest + | P2PAdvertiserListRequest + | P2PAdvertiserPaymentMethodsRequest + | P2PAdvertiserRelationsRequest + | P2PAdvertiserUpdateRequest + | P2PChatCreateRequest + | P2POrderCancelRequest + | P2POrderConfirmRequest + | P2POrderCreateRequest + | P2POrderDisputeRequest + | P2POrderInformationRequest + | P2POrderListRequest + | P2POrderReviewRequest + | P2PPaymentMethodsRequest + | P2PPingRequest + | PaymentAgentCreateRequest + | PaymentAgentDetailsRequest + | PaymentAgentListRequest + | PaymentAgentTransferRequest + | PaymentAgentWithdrawJustificationRequest + | PaymentAgentWithdrawRequest + | PaymentMethodsRequest + | PayoutCurrenciesRequest + | PingRequest + | PortfolioRequest + | PriceProposalOpenContractsRequest + | PriceProposalRequest + | ProfitTableRequest + | RealityCheckRequest + | RevokeOauthApplicationRequest + | SellContractRequest + | SellContractsMultipleAccountsRequest + | SellExpiredContractsRequest + | ServerListRequest + | ServerStatusRequest + | ServerTimeRequest + | SetAccountCurrencyRequest + | SetAccountSettingsRequest + | SetFinancialAssessmentRequest + | SetSelfExclusionRequest + | StatementRequest + | StatesListRequest + | TermsAndConditionsApprovalRequest + | TicksHistoryRequest + | TicksStreamRequest + | TopUpVirtualMoneyAccountRequest + | TradingDurationsRequest + | TradingPlatformInvestorPasswordResetRequest + | TradingPlatformPasswordResetRequest + | TradingTimesRequest + | TransactionsStreamRequest + | TransferBetweenAccountsRequest + | UnsubscribeEmailRequest + | UpdateContractHistoryRequest + | UpdateContractRequest + | VerifyEmailCellxpertRequest + | VerifyEmailRequest; + +type Response = + | APITokenResponse + | AccountLimitsResponse + | AccountStatusResponse + | ActiveSymbolsResponse + | ApplicationDeleteResponse + | ApplicationGetDetailsResponse + | ApplicationListResponse + | ApplicationMarkupDetailsResponse + | ApplicationMarkupStatisticsResponse + | ApplicationRegisterResponse + | ApplicationUpdateResponse + | AssetIndexResponse + | AuthorizeResponse + | BalanceResponse + | BuyContractForMultipleAccountsResponse + | BuyContractResponse + | CancelAContractResponse + | CashierInformationResponse + | ContractsForSymbolResponse + | CopyTradingListResponse + | CopyTradingStartResponse + | CopyTradingStatisticsResponse + | CopyTradingStopResponse + | CountriesListResponse + | CryptocurrencyConfigurationsResponse + | DocumentUploadResponse + | EconomicCalendarResponse + | ExchangeRatesResponse + | ForgetAllResponse + | ForgetResponse + | GetAccountSettingsResponse + | GetFinancialAssessmentResponse + | GetSelfExclusionResponse + | IdentityVerificationAddDocumentResponse + | LandingCompanyDetailsResponse + | LandingCompanyResponse + | LogOutResponse + | LoginHistoryResponse + | MT5AccountsListResponse + | MT5DepositResponse + | MT5GetSettingResponse + | MT5NewAccountResponse + | MT5PasswordChangeResponse + | MT5PasswordCheckResponse + | MT5PasswordResetResponse + | MT5WithdrawalResponse + | NewRealMoneyAccountDefaultLandingCompanyResponse + | NewRealMoneyAccountDerivInvestmentEuropeLtdResponse + | NewVirtualMoneyAccountResponse + | OAuthApplicationsResponse + | P2PAdvertCreateResponse + | P2PAdvertInformationResponse + | P2PAdvertListResponse + | P2PAdvertUpdateResponse + | P2PAdvertiserAdvertsResponse + | P2PAdvertiserCreateResponse + | P2PAdvertiserInformationResponse + | P2PAdvertiserListResponse + | P2PAdvertiserPaymentMethodsResponse + | P2PAdvertiserRelationsResponse + | P2PAdvertiserUpdateResponse + | P2PChatCreateResponse + | P2POrderCancelResponse + | P2POrderConfirmResponse + | P2POrderCreateResponse + | P2POrderDisputeResponse + | P2POrderInformationResponse + | P2POrderListResponse + | P2POrderReviewResponse + | P2PPaymentMethodsResponse + | P2PPingResponse + | PaymentAgentCreateResponse + | PaymentAgentDetailsResponse + | PaymentAgentListResponse + | PaymentAgentTransferResponse + | PaymentAgentWithdrawJustificationResponse + | PaymentAgentWithdrawResponse + | PaymentMethodsResponse + | PayoutCurrenciesResponse + | PingResponse + | PortfolioResponse + | PriceProposalOpenContractsResponse + | PriceProposalResponse + | ProfitTableResponse + | RealityCheckResponse + | RevokeOauthApplicationResponse + | SellContractResponse + | SellContractsMultipleAccountsResponse + | SellExpiredContractsResponse + | ServerListResponse + | ServerStatusResponse + | ServerTimeResponse + | SetAccountCurrencyResponse + | SetAccountSettingsResponse + | SetFinancialAssessmentResponse + | SetSelfExclusionResponse + | StatementResponse + | StatesListResponse + | TermsAndConditionsApprovalResponse + | TicksHistoryResponse + | TicksStreamResponse + | TopUpVirtualMoneyAccountResponse + | TradingDurationsResponse + | TradingPlatformInvestorPasswordResetResponse + | TradingPlatformPasswordResetResponse + | TradingTimesResponse + | TransactionsStreamResponse + | TransferBetweenAccountsResponse + | UnsubscribeEmailResponse + | UpdateContractHistoryResponse + | UpdateContractResponse + | VerifyEmailCellxpertResponse + | VerifyEmailResponse; + +export interface Context { + request: Request; + response?: Response; + req_id: number; + socket: any; +} + +export interface MockServer extends EventEmitter { + close: () => void; + url: string; + add: (mock: (context: Context) => void) => void; + remove: (mock: (context: Context) => void) => void; +} + +type Options = { + port?: number; +}; + +const pems = generate(); + +export async function createMockServer( + mocks: Array<(context: Context) => void>, + options?: Options +): Promise { + const eventEmitter = new EventEmitter() as MockServer; + + const server = https.createServer({ key: pems.private, cert: pems.cert }); + await new Promise(resolve => server.listen(options?.port || 0, resolve)); + const wss = new WsServer({ server }); + + wss.on('connection', ws => { + ws.on('message', async message => { + const parsedMessage = JSON.parse(message); + const context: Context = { + request: parsedMessage, + req_id: parsedMessage.req_id, + socket: ws, + }; + + mocks.flat().forEach(mock => mock(context)); + + if (context.response) { + ws.send(JSON.stringify(context.response)); + } + }); + }); + + eventEmitter.close = () => { + wss.close(); + server.close(); + }; + + const address = server.address() as { port: number }; + eventEmitter.url = `localhost:${address.port}`; + + eventEmitter.add = mock => { + mocks.push(mock); + }; + + eventEmitter.remove = mockToRemove => { + const index = mocks.findIndex(mock => mock === mockToRemove); + if (index !== -1) { + mocks.splice(index, 1); + } + }; + + return eventEmitter; +} + +type SetupMocksOptions = { + baseURL?: string; + page: Page; + mocks: Array<(context: Context) => void>; +}; + +async function setupMocks({ baseURL, page, mocks }: SetupMocksOptions) { + if (!baseURL) { + throw new Error('baseURL is required'); + } + + const mockServer = await createMockServer(mocks); + page.addListener('close', () => { + mockServer.close(); + }); + await page.goto(baseURL, { waitUntil: 'commit' }); + await page.evaluate(server_url => { + window.localStorage.setItem('config.server_url', server_url); + }, mockServer.url); + await page.goto( + `${baseURL}/?acct1=CR5712715&token1=a1-x0000000000000000000000000001&cur1=USD&acct2=CR5712710&token2=a1-x0000000000000000000000000002&cur2=BTC&acct3=VRTC8420051&token3=a1-x0000000000000000000000000003&cur3=USD&state=` + ); + return mockServer; +} + +export default setupMocks; diff --git a/end-to-end-test/utils/suspend/suspend.ts b/packages/integration/src/utils/suspend/suspend.ts similarity index 100% rename from end-to-end-test/utils/suspend/suspend.ts rename to packages/integration/src/utils/suspend/suspend.ts diff --git a/packages/integration/tsconfig.json b/packages/integration/tsconfig.json new file mode 100644 index 000000000000..1567d5b3db71 --- /dev/null +++ b/packages/integration/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src"] +} diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 000000000000..36213c91877f --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,77 @@ +import { defineConfig, devices } from '@playwright/test'; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './integration-test', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + // reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + // baseURL: 'http://127.0.0.1:3000', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + // { + // name: 'webkit', + // use: { ...devices['Desktop Safari'] }, + // }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://127.0.0.1:3000', + // reuseExistingServer: !process.env.CI, + // }, +});