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
import { bs58 } from '@project-serum/anchor/dist/cjs/utils/bytes'; | |
import { Wallet } from '@project-serum/anchor'; | |
import { clusterApiUrl, Connection, Keypair, PublicKey, sendAndConfirmRawTransaction } from '@solana/web3.js'; | |
import { IssueParameters, issueToken } from '@cardinal/token-manager'; | |
import { InvalidationType, TokenManagerKind } from '@cardinal/token-manager/dist/cjs/programs/tokenManager'; | |
const connection = new Connection(clusterApiUrl('devnet')); | |
// Test account created by solana CLI | |
const issuerPublicKey = new PublicKey('3RtKcbE5LpSScrEHHNiGBBD25xVNPLezbY7S2TAwdXis'); |
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
// Rewritten from PHP code excerpt from https://www.kutac.cz/pocitace-a-internety/jak-poznat-spravne-cislo-uctu | |
import Foundation | |
final class Utils { | |
static let bankCodes: Set = [100, 300, 600, 710, 800, 2010, 2020, 2030, 2060, 2070, 2100, 2200, 2220, 2240, 2250, 2260, 2275, 2600, 2700, 3030, 3050, 3060, 3500, 4000, 4300, 5500, 5800, 6000, 6100, 6200, 6210, 6300, 6700, 6800, 7910, 7940, 7950, 7960, 7970, 7980, 7990, 8030, 8040, 8060, 8090, 8150, 8190, 8198, 8199, 8200, 8215, 8220, 8225, 8230, 8240, 8250, 8255, 8260, 8265, 8270, 8272, 8280, 8283, 8291, 8292, 8293, 8294, 8296] | |
/// Validates Czech bank account number | |
static func isValid(bankAccount: String) -> Bool { | |
let bankAccountRegex = try! NSRegularExpression(pattern: "^(?:([0-9]{1,6})-)?([0-9]{2,10})\\/([0-9]{4})$") |