forked from xai-foundation/sentry
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
38 changed files
with
715,534 additions
and
920 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,300 @@ | ||
import Vorpal from "vorpal"; | ||
import inquirer from 'inquirer'; | ||
import inquirerAutocompletePrompt from 'inquirer-autocomplete-prompt'; | ||
|
||
inquirer.registerPrompt('autocomplete', inquirerAutocompletePrompt); | ||
|
||
export const listOfCountries = [ | ||
"afghanistan", | ||
"åland islands", | ||
"albania", | ||
"algeria", | ||
"andorra", | ||
"american samoa", | ||
"angola", | ||
"anguilla", | ||
"antarctica", | ||
"antigua and barbuda", | ||
"argentina", | ||
"armenia", | ||
"aruba", | ||
"australia", | ||
"austria", | ||
"azerbaijan", | ||
"bahamas", | ||
"bahrain", | ||
"bangladesh", | ||
"barbados", | ||
"belarus", | ||
"belgium", | ||
"belize", | ||
"benin", | ||
"bermuda", | ||
"bhutan", | ||
"bolivia", | ||
"bonaire, sint eustatius and saba", | ||
"bosnia and herzegovina", | ||
"botswana", | ||
"bouvet island", | ||
"brazil", | ||
"british indian ocean territory", | ||
"brunei darussalam", | ||
"bulgaria", | ||
"burkina faso", | ||
"burundi", | ||
"cabo verde", | ||
"cambodia", | ||
"cameroon", | ||
"canada", | ||
"cayman islands", | ||
"central african republic", | ||
"chad", | ||
"chile", | ||
"china", | ||
"christmas island", | ||
"cocos", | ||
"colombia", | ||
"comoros", | ||
"congo (the democratic republic of the)", | ||
"congo", | ||
"cook islands", | ||
"costa rica", | ||
"croatia", | ||
"cuba", | ||
"curaçao", | ||
"cyprus", | ||
"czechia", | ||
"cote d'ivoire", | ||
"denmark", | ||
"djibouti", | ||
"dominica", | ||
"dominican republic", | ||
"ecuador", | ||
"egypt", | ||
"el salvador", | ||
"equatorial guinea", | ||
"eritrea", | ||
"estonia", | ||
"eswatini", | ||
"ethiopia", | ||
"falkland islands", | ||
"faroe islands", | ||
"fiji", | ||
"finland", | ||
"france", | ||
"french guiana", | ||
"french polynesia", | ||
"french southern territories", | ||
"gabon", | ||
"gambia", | ||
"georgia", | ||
"germany", | ||
"ghana", | ||
"gibraltar", | ||
"greece", | ||
"greenland", | ||
"grenada", | ||
"guadeloupe", | ||
"guam", | ||
"guatemala", | ||
"guernsey", | ||
"guinea", | ||
"guinea-bissau", | ||
"guyana", | ||
"haiti", | ||
"heard island and mcdonald islands", | ||
"honduras", | ||
"hong kong", | ||
"hungary", | ||
"iceland", | ||
"india", | ||
"indonesia", | ||
"iran", | ||
"iraq", | ||
"ireland", | ||
"isle of man", | ||
"israel", | ||
"italy", | ||
"jamaica", | ||
"japan", | ||
"jersey", | ||
"jordan", | ||
"kazakhstan", | ||
"kenya", | ||
"kiribati", | ||
"korea (the democratic people's republic of)", | ||
"korea (the republic of)", | ||
"kosovo", | ||
"kuwait", | ||
"kyrgyzstan", | ||
"laos", | ||
"latvia", | ||
"lebanon", | ||
"lesotho", | ||
"liberia", | ||
"libya", | ||
"liechtenstein", | ||
"lithuania", | ||
"luxembourg", | ||
"macao", | ||
"madagascar", | ||
"malawi", | ||
"malaysia", | ||
"maldives", | ||
"mali", | ||
"malta", | ||
"marshall islands", | ||
"martinique", | ||
"mauritania", | ||
"mauritius", | ||
"mayotte", | ||
"mexico", | ||
"micronesia", | ||
"moldova", | ||
"monaco", | ||
"mongolia", | ||
"montenegro", | ||
"montserrat", | ||
"morocco", | ||
"mozambique", | ||
"myanmar", | ||
"namibia", | ||
"nauru", | ||
"nepal", | ||
"netherlands", | ||
"new caledonia", | ||
"new zealand", | ||
"nicaragua", | ||
"niger", | ||
"nigeria", | ||
"niue", | ||
"norfolk island", | ||
"northern mariana islands", | ||
"norway", | ||
"oman", | ||
"pakistan", | ||
"palau", | ||
"palestine", | ||
"panama", | ||
"papua new guinea", | ||
"paraguay", | ||
"peru", | ||
"philippines", | ||
"pitcairn", | ||
"poland", | ||
"portugal", | ||
"puerto rico", | ||
"qatar", | ||
"republic of north macedonia", | ||
"romania", | ||
"russia", | ||
"rwanda", | ||
"réunion", | ||
"saint barthélemy", | ||
"saint helena, ascension and tristan da cunha", | ||
"saint kitts and nevis", | ||
"saint lucia", | ||
"saint martin", | ||
"saint pierre and miquelon", | ||
"saint vincent and the grenadines", | ||
"samoa", | ||
"san marino", | ||
"são tomé and príncipe", | ||
"saudi arabia", | ||
"senegal", | ||
"serbia", | ||
"seychelles", | ||
"sierra leone", | ||
"singapore", | ||
"sint maarten", | ||
"slovakia", | ||
"slovenia", | ||
"solomon islands", | ||
"somalia", | ||
"south africa", | ||
"south georgia and the south sandwich islands", | ||
"south sudan", | ||
"spain", | ||
"sri lanka", | ||
"sudan", | ||
"suriname", | ||
"svalbard and jan mayen", | ||
"sweden", | ||
"switzerland", | ||
"syria", | ||
"taiwan", | ||
"tajikistan", | ||
"tanzania, united republic of", | ||
"thailand", | ||
"timor-leste", | ||
"togo", | ||
"tokelau", | ||
"tonga", | ||
"trinidad and tobago", | ||
"tunisia", | ||
"turkey", | ||
"turkmenistan", | ||
"turks and caicos islands", | ||
"tuvalu", | ||
"uganda", | ||
"ukraine", | ||
"united arab emirates", | ||
"united kingdom", | ||
"united states minor outlying islands", | ||
"united states", | ||
"uruguay", | ||
"uzbekistan", | ||
"vanuatu", | ||
"vatican city", | ||
"venezuela", | ||
"vietnam", | ||
"virgin islands (british)", | ||
"virgin islands (u.s.)", | ||
"wallis and futuna", | ||
"western sahara", | ||
"yemen", | ||
"zambia", | ||
"zimbabwe", | ||
] | ||
|
||
/** | ||
* Function to start the KYC process for a user. | ||
* @param cli - Vorpal instance | ||
*/ | ||
export function startKycProcess(cli: Vorpal) { | ||
cli | ||
.command('kyc', 'Starts the KYC process for a user. The user should provide their country.') | ||
.action(async function (this: Vorpal.CommandInstance) { | ||
const countryPrompt = [{ | ||
type: 'autocomplete', | ||
name: 'country', | ||
message: 'Enter your country:', | ||
source: (_: any, input: string) => { | ||
input = input || ''; | ||
return new Promise((resolve) => { | ||
const fuzzyResult = listOfCountries.filter(country => country.toLowerCase().includes(input.toLowerCase())); | ||
resolve(fuzzyResult); | ||
}); | ||
} | ||
}]; | ||
const {country} = await inquirer.prompt(countryPrompt); | ||
|
||
if (country) { | ||
let url = ''; | ||
if ( | ||
country === "china" || //China | ||
country === "hong kong" || //Hong Kong | ||
country === "macedonia" || //Macedonia | ||
country === "turkey" || //Turkey | ||
country === "ukraine" //Ukraine | ||
) { | ||
url = 'https://verify-with.blockpass.org/?clientId=xai_sentry_node__edd_60145'; | ||
} else { | ||
url = 'https://verify-with.blockpass.org/?clientId=xai_node_007da'; | ||
} | ||
this.log(`Please visit the following URL to start the KYC process: ${url}`); | ||
} else { | ||
this.log("Invalid country. Please try again."); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.