sidan-gin 0.1.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sidan-gin might be problematic. Click here for more details.
- sidan_gin/__init__.py +5 -0
- sidan_gin/encryption/__init__.py +3 -0
- sidan_gin/encryption/cipher.py +147 -0
- sidan_gin/python_signing_module/.git +1 -0
- sidan_gin/python_signing_module/.gitignore +10 -0
- sidan_gin/python_signing_module/.vscode/settings.json +32 -0
- sidan_gin/python_signing_module/Cargo.toml +14 -0
- sidan_gin/python_signing_module/README.md +2 -0
- sidan_gin/python_signing_module/__init__.py +1 -0
- sidan_gin/python_signing_module/build.rs +9 -0
- sidan_gin/python_signing_module/build.sh +7 -0
- sidan_gin/python_signing_module/src/__init__.py +0 -0
- sidan_gin/python_signing_module/src/lib.rs +86 -0
- sidan_gin/python_signing_module/src/setup.py +16 -0
- sidan_gin/python_signing_module/src/signer.cpp +73 -0
- sidan_gin/python_signing_module/src/signer.h +37 -0
- sidan_gin/python_signing_module/src/signer.i +16 -0
- sidan_gin/python_signing_module/src/signer_wrap.cxx +4140 -0
- sidan_gin/types/__init__.py +11 -0
- sidan_gin/types/account_info.py +11 -0
- sidan_gin/types/asset.py +68 -0
- sidan_gin/types/asset_metadata.py +3 -0
- sidan_gin/types/block_info.py +20 -0
- sidan_gin/types/network.py +17 -0
- sidan_gin/types/protocol.py +26 -0
- sidan_gin/types/transaction_info.py +14 -0
- sidan_gin/types/utxo.py +26 -0
- sidan_gin/types/value.py +96 -0
- sidan_gin/wallet/__init__.py +3 -0
- sidan_gin/wallet/cli.py +13 -0
- sidan_gin/wallet/derivation_indices.py +30 -0
- sidan_gin/wallet/mnemonic.py +25 -0
- sidan_gin/wallet/root_key.py +25 -0
- sidan_gin/wallet/wallet.py +48 -0
- sidan_gin-0.1.7.dist-info/METADATA +65 -0
- sidan_gin-0.1.7.dist-info/RECORD +38 -0
- sidan_gin-0.1.7.dist-info/WHEEL +4 -0
- sidan_gin-0.1.7.dist-info/licenses/LICENSE +201 -0
sidan_gin/__init__.py
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from cryptography.hazmat.backends import default_backend
|
|
6
|
+
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
|
7
|
+
from cryptography.hazmat.primitives.hashes import SHA256
|
|
8
|
+
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def encrypt_with_cipher(
|
|
12
|
+
data: str, key: str, initialization_vector_size: int = 12
|
|
13
|
+
) -> str:
|
|
14
|
+
"""
|
|
15
|
+
Encrypt data using AES-GCM with a derived key from PBKDF2 and SHA-256.
|
|
16
|
+
|
|
17
|
+
:param data: The plaintext data to encrypt.
|
|
18
|
+
:param key: The input key used for encryption.
|
|
19
|
+
:param initialization_vector_size: The size of the IV (default is 12 bytes for AES-GCM).
|
|
20
|
+
:return: A JSON string containing the IV and ciphertext (both base64-encoded).
|
|
21
|
+
:raises ValueError: If encryption fails or input data is invalid.
|
|
22
|
+
"""
|
|
23
|
+
# Derive a cryptographic key from the input key using PBKDF2 and SHA-256
|
|
24
|
+
salt = bytes(
|
|
25
|
+
initialization_vector_size
|
|
26
|
+
) # Using a fixed salt (empty for simplicity)
|
|
27
|
+
kdf = PBKDF2HMAC(
|
|
28
|
+
algorithm=SHA256(),
|
|
29
|
+
length=32, # AES-256 requires a 256-bit key (32 bytes)
|
|
30
|
+
salt=salt,
|
|
31
|
+
iterations=100_000,
|
|
32
|
+
backend=default_backend(),
|
|
33
|
+
)
|
|
34
|
+
derived_key = kdf.derive(key.encode())
|
|
35
|
+
|
|
36
|
+
# Generate a random IV
|
|
37
|
+
iv = os.urandom(initialization_vector_size) # Generate a random IV
|
|
38
|
+
try:
|
|
39
|
+
# Initialize AES-GCM cipher
|
|
40
|
+
cipher = Cipher(
|
|
41
|
+
algorithms.AES(derived_key),
|
|
42
|
+
modes.GCM(iv),
|
|
43
|
+
backend=default_backend(),
|
|
44
|
+
)
|
|
45
|
+
encryptor = cipher.encryptor()
|
|
46
|
+
|
|
47
|
+
# Encrypt the data
|
|
48
|
+
ciphertext = encryptor.update(data.encode()) + encryptor.finalize()
|
|
49
|
+
|
|
50
|
+
# Get the authentication tag
|
|
51
|
+
tag = encryptor.tag
|
|
52
|
+
|
|
53
|
+
# Append the tag to the ciphertext to match Web Crypto API behavior
|
|
54
|
+
ciphertext_with_tag = ciphertext + tag
|
|
55
|
+
except Exception as e:
|
|
56
|
+
raise ValueError("Encryption failed") from e
|
|
57
|
+
|
|
58
|
+
# Encode the IV and ciphertext (with tag) in base64
|
|
59
|
+
iv_base64 = base64.b64encode(iv).decode("utf-8")
|
|
60
|
+
ciphertext_base64 = base64.b64encode(ciphertext_with_tag).decode("utf-8")
|
|
61
|
+
|
|
62
|
+
# Create a JSON-like string containing the IV and ciphertext
|
|
63
|
+
result = {
|
|
64
|
+
"iv": iv_base64,
|
|
65
|
+
"ciphertext": ciphertext_base64,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return json.dumps(result)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def decrypt_with_cipher(encrypted_data_json: str, key: str) -> str:
|
|
72
|
+
"""
|
|
73
|
+
Decrypt data encrypted with AES-GCM using a derived key from PBKDF2 and SHA-256.
|
|
74
|
+
Supports both new format (with salt) and legacy format (without salt) for backward compatibility.
|
|
75
|
+
"""
|
|
76
|
+
# Parse the encrypted data from JSON
|
|
77
|
+
try:
|
|
78
|
+
encrypted_data = json.loads(encrypted_data_json)
|
|
79
|
+
iv_base64 = encrypted_data["iv"]
|
|
80
|
+
ciphertext_base64 = encrypted_data["ciphertext"]
|
|
81
|
+
salt_base64 = encrypted_data.get("salt") # Optional for backward compatibility
|
|
82
|
+
except (KeyError, json.JSONDecodeError) as e:
|
|
83
|
+
raise ValueError("Invalid encrypted data JSON") from e
|
|
84
|
+
|
|
85
|
+
# Decode IV from base64
|
|
86
|
+
try:
|
|
87
|
+
iv = base64.b64decode(iv_base64)
|
|
88
|
+
except base64.binascii.Error as e:
|
|
89
|
+
raise ValueError("Failed to decode IV") from e
|
|
90
|
+
|
|
91
|
+
# Decode ciphertext from base64
|
|
92
|
+
try:
|
|
93
|
+
ciphertext_with_tag = base64.b64decode(ciphertext_base64)
|
|
94
|
+
except base64.binascii.Error as e:
|
|
95
|
+
raise ValueError("Failed to decode ciphertext") from e
|
|
96
|
+
|
|
97
|
+
# Handle salt - support both new format (with salt) and legacy format (without salt)
|
|
98
|
+
if salt_base64 is not None and salt_base64 != "":
|
|
99
|
+
# New format: use the provided salt
|
|
100
|
+
try:
|
|
101
|
+
salt = base64.b64decode(salt_base64)
|
|
102
|
+
except base64.binascii.Error as e:
|
|
103
|
+
raise ValueError("Failed to decode salt") from e
|
|
104
|
+
else:
|
|
105
|
+
# Legacy format: use zero-filled salt of IV length for backward compatibility
|
|
106
|
+
salt = bytes(len(iv))
|
|
107
|
+
|
|
108
|
+
# Derive cryptographic key from password using PBKDF2
|
|
109
|
+
# Matches frontend: 100,000 iterations, SHA-256, 256-bit key
|
|
110
|
+
kdf = PBKDF2HMAC(
|
|
111
|
+
algorithm=SHA256(),
|
|
112
|
+
length=32, # AES-256 requires a 256-bit key (32 bytes)
|
|
113
|
+
salt=salt,
|
|
114
|
+
iterations=100_000,
|
|
115
|
+
backend=default_backend(),
|
|
116
|
+
)
|
|
117
|
+
derived_key = kdf.derive(key.encode())
|
|
118
|
+
|
|
119
|
+
# In GCM mode, the tag is appended to the ciphertext
|
|
120
|
+
# Standard GCM tag length is 16 bytes (128 bits)
|
|
121
|
+
tag_length = 16
|
|
122
|
+
ciphertext = ciphertext_with_tag[:-tag_length]
|
|
123
|
+
tag = ciphertext_with_tag[-tag_length:]
|
|
124
|
+
|
|
125
|
+
# Initialize AES-GCM cipher for decryption
|
|
126
|
+
try:
|
|
127
|
+
cipher = Cipher(
|
|
128
|
+
algorithms.AES(derived_key),
|
|
129
|
+
modes.GCM(iv, tag), # Pass the extracted tag to GCM mode
|
|
130
|
+
backend=default_backend(),
|
|
131
|
+
)
|
|
132
|
+
decryptor = cipher.decryptor()
|
|
133
|
+
|
|
134
|
+
# Decrypt the data
|
|
135
|
+
decrypted_data = decryptor.update(ciphertext) + decryptor.finalize()
|
|
136
|
+
except Exception as e:
|
|
137
|
+
raise ValueError(
|
|
138
|
+
"Failed to decrypt (incorrect password or corrupted data)"
|
|
139
|
+
) from e
|
|
140
|
+
|
|
141
|
+
# Convert the decrypted data back to a string
|
|
142
|
+
try:
|
|
143
|
+
decrypted_str = decrypted_data.decode("utf-8")
|
|
144
|
+
except UnicodeDecodeError as e:
|
|
145
|
+
raise ValueError("Failed to convert decrypted data to UTF-8") from e
|
|
146
|
+
|
|
147
|
+
return decrypted_str
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitdir: ../../../.git/modules/src/sidan_gin/python_signing_module
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files.associations": {
|
|
3
|
+
"iosfwd": "cpp",
|
|
4
|
+
"vector": "cpp",
|
|
5
|
+
"stdexcept": "cpp",
|
|
6
|
+
"string": "cpp",
|
|
7
|
+
"__verbose_abort": "cpp",
|
|
8
|
+
"array": "cpp",
|
|
9
|
+
"cstddef": "cpp",
|
|
10
|
+
"cstdint": "cpp",
|
|
11
|
+
"cstdio": "cpp",
|
|
12
|
+
"cstdlib": "cpp",
|
|
13
|
+
"cstring": "cpp",
|
|
14
|
+
"cwchar": "cpp",
|
|
15
|
+
"execution": "cpp",
|
|
16
|
+
"memory": "cpp",
|
|
17
|
+
"initializer_list": "cpp",
|
|
18
|
+
"limits": "cpp",
|
|
19
|
+
"new": "cpp",
|
|
20
|
+
"string_view": "cpp",
|
|
21
|
+
"typeinfo": "cpp",
|
|
22
|
+
"variant": "cpp",
|
|
23
|
+
"cctype": "cpp",
|
|
24
|
+
"cmath": "cpp",
|
|
25
|
+
"ctime": "cpp",
|
|
26
|
+
"cwctype": "cpp",
|
|
27
|
+
"optional": "cpp",
|
|
28
|
+
"ratio": "cpp",
|
|
29
|
+
"algorithm": "cpp",
|
|
30
|
+
"*.rs": "rust"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .src import CardanoSigner
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
use whisky::{Account, MnemonicWallet, RootKeyWallet, Wallet};
|
|
2
|
+
|
|
3
|
+
#[cxx::bridge]
|
|
4
|
+
mod ffi {
|
|
5
|
+
// Rust types and signatures exposed to C++.
|
|
6
|
+
extern "Rust" {
|
|
7
|
+
type Signer;
|
|
8
|
+
fn new_mnemonic_signer(mnemonic_phrase: &str, derivation_path: &str) -> Box<Signer>;
|
|
9
|
+
fn new_bech32_signer(root_private_key: &str, derivation_path: &str) -> Box<Signer>;
|
|
10
|
+
fn new_cli_signer(ed25519_key: &str) -> Box<Signer>;
|
|
11
|
+
fn sign_transaction(&mut self, tx_hex: &str) -> String;
|
|
12
|
+
fn get_public_key(&self) -> String;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fn new_mnemonic_signer(mnemonic_phrase: &str, derivation_path: &str) -> Box<Signer> {
|
|
17
|
+
let mut derivation_path_vec: Vec<&str> = derivation_path.split('/').collect();
|
|
18
|
+
// remove first element if it is "m"
|
|
19
|
+
if derivation_path_vec[0] == "m" {
|
|
20
|
+
derivation_path_vec.remove(0);
|
|
21
|
+
}
|
|
22
|
+
let derivation_path_vec_u32: Vec<u32> = derivation_path_vec
|
|
23
|
+
.iter()
|
|
24
|
+
.filter_map(|&s| {
|
|
25
|
+
if s.ends_with("'") {
|
|
26
|
+
let mut chars = s.chars();
|
|
27
|
+
chars.next_back(); // Remove the last character (')
|
|
28
|
+
// Parse the string to u32 and add 0x80000000 for hardening
|
|
29
|
+
Some(chars.as_str().parse::<u32>().unwrap() + 0x80000000)
|
|
30
|
+
} else {
|
|
31
|
+
s.parse::<u32>().ok()
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
.collect();
|
|
35
|
+
let wallet = Wallet::new(whisky::WalletType::MnemonicWallet(MnemonicWallet {
|
|
36
|
+
mnemonic_phrase: mnemonic_phrase.to_string(),
|
|
37
|
+
derivation_indices: whisky::derivation_indices::DerivationIndices(derivation_path_vec_u32),
|
|
38
|
+
}));
|
|
39
|
+
let account = wallet.get_account().unwrap();
|
|
40
|
+
Box::new(Signer { account })
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
fn new_bech32_signer(root_private_key: &str, derivation_path: &str) -> Box<Signer> {
|
|
44
|
+
let derivation_path_vec: Vec<&str> = derivation_path.split('/').collect();
|
|
45
|
+
let derivation_path_vec_u32: Vec<u32> = derivation_path_vec
|
|
46
|
+
.iter()
|
|
47
|
+
.filter_map(|&s| {
|
|
48
|
+
if s.ends_with("'") {
|
|
49
|
+
let mut chars = s.chars();
|
|
50
|
+
chars.next_back(); // Remove the last character (')
|
|
51
|
+
// Parse the string to u32 and add 0x80000000 for hardening
|
|
52
|
+
Some(chars.as_str().parse::<u32>().unwrap() + 0x80000000)
|
|
53
|
+
} else {
|
|
54
|
+
s.parse::<u32>().ok()
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
.collect();
|
|
58
|
+
let wallet = Wallet::new(whisky::WalletType::RootKeyWallet(RootKeyWallet {
|
|
59
|
+
root_key: root_private_key.to_string(),
|
|
60
|
+
derivation_indices: whisky::derivation_indices::DerivationIndices(derivation_path_vec_u32),
|
|
61
|
+
}));
|
|
62
|
+
let account = wallet.get_account().unwrap();
|
|
63
|
+
Box::new(Signer { account })
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fn new_cli_signer(ed25519_key: &str) -> Box<Signer> {
|
|
67
|
+
let wallet = Wallet::new_cli(ed25519_key);
|
|
68
|
+
let account = wallet.get_account().unwrap();
|
|
69
|
+
Box::new(Signer { account })
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
struct Signer {
|
|
73
|
+
account: Account,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
impl Signer {
|
|
77
|
+
pub fn sign_transaction(&self, tx_hex: &str) -> String {
|
|
78
|
+
self.account.sign_transaction(tx_hex).unwrap_or_else(|_| {
|
|
79
|
+
panic!("Failed to sign transaction with the provided account");
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pub fn get_public_key(&self) -> String {
|
|
84
|
+
self.account.public_key.to_hex()
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from setuptools import setup, Extension
|
|
2
|
+
|
|
3
|
+
signer_module = Extension(
|
|
4
|
+
'_CardanoSigner',
|
|
5
|
+
sources=['signer_wrap.cxx', 'signer.cpp'], # signer_wrap.cxx is going to be generated by swig
|
|
6
|
+
extra_objects=["libsigner.a"] # this is the static library that we are going to link with
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
setup (
|
|
10
|
+
name = 'CardanoSigner',
|
|
11
|
+
version = '0.0',
|
|
12
|
+
author = "YOUR_NAME",
|
|
13
|
+
description = "CardanoSigner swig",
|
|
14
|
+
ext_modules = [signer_module],
|
|
15
|
+
py_modules = ["CardanoSigner"], # name of module that we're going import
|
|
16
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#include "lib.rs.h"
|
|
2
|
+
|
|
3
|
+
#include <string>
|
|
4
|
+
#include <vector>
|
|
5
|
+
|
|
6
|
+
// class MnemonicSigner
|
|
7
|
+
// {
|
|
8
|
+
// public:
|
|
9
|
+
// MnemonicSigner(std::string mnemonic, std::uint32_t account_index, std::uint32_t key_index)
|
|
10
|
+
// {
|
|
11
|
+
// this->mnemonic_secret = mnemonic;
|
|
12
|
+
// this->account_index = account_index;
|
|
13
|
+
// this->key_index = key_index;
|
|
14
|
+
// };
|
|
15
|
+
// ~MnemonicSigner() = default;
|
|
16
|
+
|
|
17
|
+
// std::string sign_tx(std::string tx_hex)
|
|
18
|
+
// {
|
|
19
|
+
// auto signer = new_mnemonic_signer(mnemonic_secret, account_index, key_index);
|
|
20
|
+
// std::string signed_tx = signer->sign_transaction(tx_hex).c_str();
|
|
21
|
+
// return signed_tx;
|
|
22
|
+
// };
|
|
23
|
+
|
|
24
|
+
// private:
|
|
25
|
+
// std::string mnemonic_secret;
|
|
26
|
+
// std::uint32_t account_index;
|
|
27
|
+
// std::uint32_t key_index;
|
|
28
|
+
// };
|
|
29
|
+
|
|
30
|
+
// class Bech32Signer
|
|
31
|
+
// {
|
|
32
|
+
// public:
|
|
33
|
+
// Bech32Signer(std::string bech32, std::uint32_t account_index, std::uint32_t key_index)
|
|
34
|
+
// {
|
|
35
|
+
// this->bech32_secret = bech32;
|
|
36
|
+
// this->account_index = account_index;
|
|
37
|
+
// this->key_index = key_index;
|
|
38
|
+
// };
|
|
39
|
+
// ~Bech32Signer() = default;
|
|
40
|
+
|
|
41
|
+
// std::string sign_tx(std::string tx_hex)
|
|
42
|
+
// {
|
|
43
|
+
// auto signer = new_bech32_signer(bech32_secret, account_index, key_index);
|
|
44
|
+
// std::string signed_tx = signer->sign_transaction(tx_hex).c_str();
|
|
45
|
+
// return signed_tx;
|
|
46
|
+
// };
|
|
47
|
+
|
|
48
|
+
// private:
|
|
49
|
+
// std::string bech32_secret;
|
|
50
|
+
// std::uint32_t account_index;
|
|
51
|
+
// std::uint32_t key_index;
|
|
52
|
+
// };
|
|
53
|
+
|
|
54
|
+
std::string sign_mnemonic(std::string mnemonic, std::string derivation_path, std::string tx_hex)
|
|
55
|
+
{
|
|
56
|
+
auto signer = new_mnemonic_signer(mnemonic, derivation_path);
|
|
57
|
+
std::string signed_tx = signer->sign_transaction(tx_hex).c_str();
|
|
58
|
+
return signed_tx;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
std::string sign_bech32(std::string bech32, std::string derivation_path, std::string tx_hex)
|
|
62
|
+
{
|
|
63
|
+
auto signer = new_bech32_signer(bech32, derivation_path);
|
|
64
|
+
std::string signed_tx = signer->sign_transaction(tx_hex).c_str();
|
|
65
|
+
return signed_tx;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
std::string sign_cli(std::string ed25519_key, std::string tx_hex)
|
|
69
|
+
{
|
|
70
|
+
auto signer = new_cli_signer(ed25519_key);
|
|
71
|
+
std::string signed_tx = signer->sign_transaction(tx_hex).c_str();
|
|
72
|
+
return signed_tx;
|
|
73
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#include "lib.rs.h"
|
|
2
|
+
|
|
3
|
+
#include <string>
|
|
4
|
+
|
|
5
|
+
// class MnemonicSigner
|
|
6
|
+
// {
|
|
7
|
+
// public:
|
|
8
|
+
// MnemonicSigner(std::string mnemonic, std::uint32_t account_index, std::uint32_t key_index);
|
|
9
|
+
// ~MnemonicSigner() = default;
|
|
10
|
+
|
|
11
|
+
// std::string sign_tx(std::string tx_hex);
|
|
12
|
+
|
|
13
|
+
// private:
|
|
14
|
+
// std::string mnemonic_secret;
|
|
15
|
+
// std::uint32_t account_index;
|
|
16
|
+
// std::uint32_t key_index;
|
|
17
|
+
// };
|
|
18
|
+
|
|
19
|
+
// class Bech32Signer
|
|
20
|
+
// {
|
|
21
|
+
// public:
|
|
22
|
+
// Bech32Signer(std::string bech32, std::uint32_t account_index, std::uint32_t key_index);
|
|
23
|
+
// ~Bech32Signer() = default;
|
|
24
|
+
|
|
25
|
+
// std::string sign_tx(std::string tx_hex);
|
|
26
|
+
|
|
27
|
+
// private:
|
|
28
|
+
// std::string bech32_secret;
|
|
29
|
+
// std::uint32_t account_index;
|
|
30
|
+
// std::uint32_t key_index;
|
|
31
|
+
// };
|
|
32
|
+
|
|
33
|
+
std::string sign_mnemonic(std::string mnemonic, std::string derivation_path, std::string tx_hex);
|
|
34
|
+
|
|
35
|
+
std::string sign_bech32(std::string bech32, std::string derivation_path, std::string tx_hex);
|
|
36
|
+
|
|
37
|
+
std::string sign_cli(std::string ed25519_key, std::string tx_hex);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
%module CardanoSigner
|
|
2
|
+
|
|
3
|
+
%include "std_string.i"
|
|
4
|
+
|
|
5
|
+
%{
|
|
6
|
+
#define SWIG_FILE_WITH_INIT
|
|
7
|
+
#include "lib.rs.h"
|
|
8
|
+
#include "signer.h"
|
|
9
|
+
#include <string>
|
|
10
|
+
%}
|
|
11
|
+
|
|
12
|
+
std::string sign_mnemonic(std::string mnemonic, std::string derivation_path, std::string tx_hex);
|
|
13
|
+
|
|
14
|
+
std::string sign_bech32(std::string bech32, std::string derivation_path, std::string tx_hex);
|
|
15
|
+
|
|
16
|
+
std::string sign_cli(std::string ed25519_key, std::string tx_hex);
|