Class: TonClient::Crypto
- Includes:
- CommonInstanceHelpers
- Defined in:
- lib/everscale-client-ruby/Client/Crypto.rb
Constant Summary collapse
- MODULE =
self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#core ⇒ Object
readonly
Returns the value of attribute core.
Instance Method Summary collapse
-
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted.
-
#clear_crypto_box_secret_cache(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -.
-
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
-
#create_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateCryptoBox secret_encryption_salt: String - # # Salt used for secret encryption.
-
#create_encryption_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateEncryptionBox algorithm: EncryptionAlgorithm - # # Encryption algorithm specifier including cipher parameters (key, IV, etc) RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#encryption_box_decrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxDecrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be decrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxDecrypt data: String - # # Decrypted data, encoded in Base64.
-
#encryption_box_encrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxEncrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be encrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxEncrypt data: String - # # Encrypted data, encoded in Base64.
-
#encryption_box_get_info(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxGetInfo encryption_box: EncryptionBoxHandle - # # Encryption box handle RESPONSE: ResultOfEncryptionBoxGetInfo info: EncryptionBoxInfo - # # Encryption box information.
-
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number.
-
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array.
-
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#get_crypto_box_info(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxInfo encrypted_secret: String - # # Secret (seed phrase) encrypted with salt and password.
-
#get_crypto_box_seed_phrase(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxSeedPhrase phrase: String - dictionary: MnemonicDictionary - wordcount: Number -.
-
#get_encryption_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetEncryptionBoxFromCryptoBox handle: Number - # # Crypto Box Handle.
-
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#get_signing_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetSigningBoxFromCryptoBox handle: Number - # # Crypto Box Handle.
-
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key.
-
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key.
-
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string.
-
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string.
-
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key.
-
#initialize(context: Context.new, core: TonClient::TonBinding) ⇒ Crypto
constructor
A new instance of Crypto.
-
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes.
-
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words.
-
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not.
-
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words.
-
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # #
baseargument of calculation. -
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in
base64. -
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted.
-
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted.
-
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in
base64. -
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in
base64. -
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified.
-
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string.
-
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned.
-
#register_encryption_box(&block) ⇒ Object
RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#remove_crypto_box(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -.
-
#remove_encryption_box(payload, &block) ⇒ Object
INPUT: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
-
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed.
-
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation.
-
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in
base64. -
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
-
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle.
-
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation.
-
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in
base64.
Methods included from CommonInstanceHelpers
#base64?, #encode_to_base64, #full_method_name
Constructor Details
#initialize(context: Context.new, core: TonClient::TonBinding) ⇒ Crypto
9 10 11 12 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 9 def initialize(context: Context.new, core: TonClient::TonBinding) @context = context @core = core end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 6 def context @context end |
#core ⇒ Object (readonly)
Returns the value of attribute core.
6 7 8 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 6 def core @core end |
Instance Method Details
#chacha20(payload, &block) ⇒ Object
INPUT: ParamsOfChaCha20 data: String - # # Source data to be encrypted or decrypted. # # Must be encoded with base64. key: String - # # 256-bit key. # # Must be encoded with hex. nonce: String - # # 96-bit nonce. # # Must be encoded with hex. RESPONSE: ResultOfChaCha20 data: String - # # Encrypted/decrypted data. # # Encoded with base64.
315 316 317 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 315 def chacha20(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#clear_crypto_box_secret_cache(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -
375 376 377 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 375 def clear_crypto_box_secret_cache(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#convert_public_key_to_ton_safe_format(payload, &block) ⇒ Object
INPUT: ParamsOfConvertPublicKeyToTonSafeFormat public_key: String - # # Public key - 64 symbols hex string RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat ton_public_key: String - # # Public key represented in TON safe format.
52 53 54 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 52 def convert_public_key_to_ton_safe_format(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#create_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateCryptoBox secret_encryption_salt: String - # # Salt used for secret encryption. For example, a mobile device can use device ID as salt. secret: CryptoBoxSecret - # # Cryptobox secret RESPONSE: RegisteredCryptoBox handle: CryptoBoxHandle -
324 325 326 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 324 def create_crypto_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#create_encryption_box(payload, &block) ⇒ Object
INPUT: ParamsOfCreateEncryptionBox algorithm: EncryptionAlgorithm - # # Encryption algorithm specifier including cipher parameters (key, IV, etc) RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
459 460 461 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 459 def create_encryption_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_decrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxDecrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be decrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxDecrypt data: String - # # Decrypted data, encoded in Base64.
451 452 453 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 451 def encryption_box_decrypt(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_encrypt(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxEncrypt encryption_box: EncryptionBoxHandle - # # Encryption box handle data: String - # # Data to be encrypted, encoded in Base64 RESPONSE: ResultOfEncryptionBoxEncrypt data: String - # # Encrypted data, encoded in Base64. # # Padded to cipher block size
442 443 444 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 442 def encryption_box_encrypt(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#encryption_box_get_info(payload, &block) ⇒ Object
INPUT: ParamsOfEncryptionBoxGetInfo encryption_box: EncryptionBoxHandle - # # Encryption box handle RESPONSE: ResultOfEncryptionBoxGetInfo info: EncryptionBoxInfo - # # Encryption box information
433 434 435 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 433 def encryption_box_get_info(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#factorize(payload, &block) ⇒ Object
INPUT: ParamsOfFactorize composite: String - # # Hexadecimal representation of u64 composite number. RESPONSE: ResultOfFactorize factors: Array - # # Two factors of composite or empty if composite can’t be factorized.
18 19 20 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 18 def factorize(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_bytes(payload, &block) ⇒ Object
INPUT: ParamsOfGenerateRandomBytes length: Number - # # Size of random byte array. RESPONSE: ResultOfGenerateRandomBytes bytes: String - # # Generated bytes encoded in base64.
44 45 46 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 44 def generate_random_bytes(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#generate_random_sign_keys(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
59 60 61 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 59 def generate_random_sign_keys(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#get_crypto_box_info(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxInfo encrypted_secret: String - # # Secret (seed phrase) encrypted with salt and password.
338 339 340 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 338 def get_crypto_box_info(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_crypto_box_seed_phrase(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle - RESPONSE: ResultOfGetCryptoBoxSeedPhrase phrase: String - dictionary: MnemonicDictionary - wordcount: Number -
348 349 350 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 348 def get_crypto_box_seed_phrase(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_encryption_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetEncryptionBoxFromCryptoBox handle: Number - # # Crypto Box Handle. hdpath: String<Optional> - # # HD key derivation path. # # By default, Everscale HD path is used. algorithm: BoxEncryptionAlgorithm - # # Encryption algorithm. secret_lifetime: Number<Optional> - # # Store derived secret for encryption algorithm for this lifetime (in ms). The timer starts after each encryption box operation. Secrets will be deleted (overwritten with zeroes) after each encryption operation, if this value is not set. RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
369 370 371 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 369 def get_encryption_box_from_crypto_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_signing_box(payload, &block) ⇒ Object
INPUT: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
390 391 392 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 390 def get_signing_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#get_signing_box_from_crypto_box(payload, &block) ⇒ Object
INPUT: ParamsOfGetSigningBoxFromCryptoBox handle: Number - # # Crypto Box Handle. hdpath: String<Optional> - # # HD key derivation path. # # By default, Everscale HD path is used. secret_lifetime: Number<Optional> - # # Store derived secret for this lifetime (in ms). The timer starts after each signing box operation. Secrets will be deleted immediately after each signing box operation, if this value is not set. RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
358 359 360 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 358 def get_signing_box_from_crypto_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key child_index: Number - # # Child index (see BIP-0032) hardened: Boolean - # # Indicates the derivation of hardened/not-hardened key (see BIP-0032) RESPONSE: ResultOfHDKeyDeriveFromXPrv xprv: String - # # Serialized extended private key
280 281 282 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 280 def hdkey_derive_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_derive_from_xprv_path(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyDeriveFromXPrvPath xprv: String - # # Serialized extended private key path: String - # # Derivation path, for instance “m/44’/396’/0’/0/0” RESPONSE: ResultOfHDKeyDeriveFromXPrvPath xprv: String - # # Derived serialized extended private key
289 290 291 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 289 def hdkey_derive_from_xprv_path(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_public_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyPublicFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeyPublicFromXPrv public: String - # # Public key - 64 symbols hex string
305 306 307 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 305 def hdkey_public_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_secret_from_xprv(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeySecretFromXPrv xprv: String - # # Serialized extended private key RESPONSE: ResultOfHDKeySecretFromXPrv secret: String - # # Private key - 64 symbols hex string
297 298 299 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 297 def hdkey_secret_from_xprv(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#hdkey_xprv_from_mnemonic(payload, &block) ⇒ Object
INPUT: ParamsOfHDKeyXPrvFromMnemonic phrase: String - # # String with seed phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfHDKeyXPrvFromMnemonic xprv: String - # # Serialized extended master private key
270 271 272 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 270 def hdkey_xprv_from_mnemonic(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_derive_sign_keys(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicDeriveSignKeys phrase: String - # # Phrase path: String<Optional> - # # Derivation path, for instance “m/44’/396’/0’/0/0” dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
260 261 262 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 260 def mnemonic_derive_sign_keys(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_entropy(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromEntropy entropy: String - # # Entropy bytes. # # Hex encoded. dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromEntropy phrase: String - # # Phrase
238 239 240 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 238 def mnemonic_from_entropy(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_from_random(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicFromRandom dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Mnemonic word count RESPONSE: ResultOfMnemonicFromRandom phrase: String - # # String of mnemonic words
228 229 230 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 228 def mnemonic_from_random(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_verify(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicVerify phrase: String - # # Phrase dictionary: MnemonicDictionary - # # Dictionary identifier word_count: Number<Optional> - # # Word count RESPONSE: ResultOfMnemonicVerify valid: Boolean - # # Flag indicating if the mnemonic is valid or not
248 249 250 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 248 def mnemonic_verify(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#mnemonic_words(payload, &block) ⇒ Object
INPUT: ParamsOfMnemonicWords dictionary: MnemonicDictionary - # # Dictionary identifier RESPONSE: ResultOfMnemonicWords words: String - # # The list of mnemonic words
219 220 221 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 219 def mnemonic_words(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#modular_power(payload, &block) ⇒ Object
INPUT: ParamsOfModularPower base: String - # # base argument of calculation. exponent: String - # # exponent argument of calculation. modulus: String - # # modulus argument of calculation. RESPONSE: ResultOfModularPower modular_power: String - # # Result of modular exponentiation
28 29 30 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 28 def modular_power(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBox decrypted: String - # # Data that must be encrypted encoded in base64. nonce: String - # # Nonce, encoded in hex their_public: String - # # Receiver’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Sender’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in base64.
180 181 182 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 180 def nacl_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_keypair(&block) ⇒ Object
RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
160 161 162 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 160 def nacl_box_keypair(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#nacl_box_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
169 170 171 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 169 def nacl_box_keypair_from_secret_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with base64. nonce: String - # # Nonce their_public: String - # # Sender’s public key - unprefixed 0-padded to 64 symbols hex string secret: String - # # Receiver’s private key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in base64.
191 192 193 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 191 def nacl_box_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBox decrypted: String - # # Data that must be encrypted. # # Encoded with base64. nonce: String - # # Nonce in hex key: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBox encrypted: String - # # Encrypted data encoded in base64.
201 202 203 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 201 def nacl_secret_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_secret_box_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSecretBoxOpen encrypted: String - # # Data that must be decrypted. # # Encoded with base64. nonce: String - # # Nonce in hex key: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclBoxOpen decrypted: String - # # Decrypted data encoded in base64.
211 212 213 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 211 def nacl_secret_box_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in base64. secret: String - # # Signer’s secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See nacl_sign_keypair_from_secret_key. RESPONSE: ResultOfNaclSign signed: String - # # Signed data, encoded in base64.
125 126 127 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 125 def nacl_sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSign unsigned: String - # # Data that must be signed encoded in base64. secret: String - # # Signer’s secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See nacl_sign_keypair_from_secret_key. RESPONSE: ResultOfNaclSignDetached signature: String - # # Signature encoded in hex.
143 144 145 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 143 def nacl_sign_detached(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_detached_verify(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignDetachedVerify unsigned: String - # # Unsigned data that must be verified. # # Encoded with base64. signature: String - # # Signature that must be verified. # # Encoded with hex. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string. RESPONSE: ResultOfNaclSignDetachedVerify succeeded: Boolean - # # true if verification succeeded or false if it failed
153 154 155 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 153 def nacl_sign_detached_verify(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_keypair_from_secret_key(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignKeyPairFromSecret secret: String - # # Secret key - unprefixed 0-padded to 64 symbols hex string RESPONSE: KeyPair public: String - # # Public key - 64 symbols hex string secret: String - # # Private key - u64 symbols hex string
116 117 118 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 116 def nacl_sign_keypair_from_secret_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#nacl_sign_open(payload, &block) ⇒ Object
INPUT: ParamsOfNaclSignOpen signed: String - # # Signed data that must be unsigned. # # Encoded with base64. public: String - # # Signer’s public key - unprefixed 0-padded to 64 symbols hex string RESPONSE: ResultOfNaclSignOpen unsigned: String - # # Unsigned data, encoded in base64.
134 135 136 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 134 def nacl_sign_open(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#register_encryption_box(&block) ⇒ Object
RESPONSE: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
419 420 421 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 419 def register_encryption_box(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#register_signing_box(&block) ⇒ Object
RESPONSE: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
381 382 383 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 381 def register_signing_box(&block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block) end |
#remove_crypto_box(payload, &block) ⇒ Object
INPUT: RegisteredCryptoBox handle: CryptoBoxHandle -
330 331 332 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 330 def remove_crypto_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#remove_encryption_box(payload, &block) ⇒ Object
INPUT: RegisteredEncryptionBox handle: EncryptionBoxHandle - # # Handle of the encryption box.
425 426 427 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 425 def remove_encryption_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#remove_signing_box(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box.
413 414 415 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 413 def remove_signing_box(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#scrypt(payload, &block) ⇒ Object
INPUT: ParamsOfScrypt password: String - # # The password bytes to be hashed. Must be encoded with base64. salt: String - # # Salt bytes that modify the hash to protect against Rainbow table attacks. Must be encoded with base64. log_n: Number - # # CPU/memory cost parameter r: Number - # # The block size parameter, which fine-tunes sequential memory read size and performance. p: Number - # # Parallelization parameter. dk_len: Number - # # Intended output length in octets of the derived key. RESPONSE: ResultOfScrypt key: String - # # Derived key. # # Encoded with hex.
107 108 109 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 107 def scrypt(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha256(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with base64. RESPONSE: ResultOfHash hash: String - # # Hash of input data. # # Encoded with ‘hex’.
86 87 88 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 86 def sha256(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sha512(payload, &block) ⇒ Object
INPUT: ParamsOfHash data: String - # # Input data for hash calculation. # # Encoded with base64. RESPONSE: ResultOfHash hash: String - # # Hash of input data. # # Encoded with ‘hex’.
94 95 96 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 94 def sha512(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#sign(payload, &block) ⇒ Object
INPUT: ParamsOfSign unsigned: String - # # Data that must be signed encoded in base64. keys: KeyPair - # # Sign keys. RESPONSE: ResultOfSign signed: String - # # Signed data combined with signature encoded in base64. signature: String - # # Signature encoded in hex.
69 70 71 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 69 def sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_get_public_key(payload, &block) ⇒ Object
INPUT: RegisteredSigningBox handle: SigningBoxHandle - # # Handle of the signing box. RESPONSE: ResultOfSigningBoxGetPublicKey pubkey: String - # # Public key of signing box. # # Encoded with hex
398 399 400 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 398 def signing_box_get_public_key(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#signing_box_sign(payload, &block) ⇒ Object
INPUT: ParamsOfSigningBoxSign signing_box: SigningBoxHandle - # # Signing Box handle. unsigned: String - # # Unsigned user data. # # Must be encoded with base64. RESPONSE: ResultOfSigningBoxSign signature: String - # # Data signature. # # Encoded with hex.
407 408 409 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 407 def signing_box_sign(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#ton_crc16(payload, &block) ⇒ Object
INPUT: ParamsOfTonCrc16 data: String - # # Input data for CRC calculation. # # Encoded with base64. RESPONSE: ResultOfTonCrc16 crc: Number - # # Calculated CRC for input data.
36 37 38 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 36 def ton_crc16(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |
#verify_signature(payload, &block) ⇒ Object
INPUT: ParamsOfVerifySignature signed: String - # # Signed data that must be verified encoded in base64. public: String - # # Signer’s public key - 64 symbols hex string RESPONSE: ResultOfVerifySignature unsigned: String - # # Unsigned data encoded in base64.
78 79 80 |
# File 'lib/everscale-client-ruby/Client/Crypto.rb', line 78 def verify_signature(payload, &block) core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block) end |