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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
from .account_info import *
|
|
4
|
+
from .asset import *
|
|
5
|
+
from .asset_metadata import *
|
|
6
|
+
from .block_info import *
|
|
7
|
+
from .network import *
|
|
8
|
+
from .protocol import *
|
|
9
|
+
from .transaction_info import *
|
|
10
|
+
from .utxo import *
|
|
11
|
+
from .value import *
|
sidan_gin/types/asset.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# flake8: noqa: E501
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class Asset:
|
|
9
|
+
unit: str
|
|
10
|
+
quantity: str
|
|
11
|
+
|
|
12
|
+
def __repr__(self):
|
|
13
|
+
return f"Asset(unit={self.unit}, quantity={self.quantity})"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class Assets:
|
|
18
|
+
def __init__(self, assets: Optional[List[Asset]] = None):
|
|
19
|
+
self.assets = assets if assets is not None else []
|
|
20
|
+
|
|
21
|
+
def get_lovelace(self) -> int:
|
|
22
|
+
"""
|
|
23
|
+
Get the 'lovelace' quantity if it exists, otherwise return 0.
|
|
24
|
+
"""
|
|
25
|
+
for asset in self.assets:
|
|
26
|
+
if asset.unit == "lovelace":
|
|
27
|
+
try:
|
|
28
|
+
return int(asset.quantity)
|
|
29
|
+
except ValueError:
|
|
30
|
+
return 0
|
|
31
|
+
return 0
|
|
32
|
+
|
|
33
|
+
def pop_asset_by_unit(self, unit: str) -> Optional[Asset]:
|
|
34
|
+
"""
|
|
35
|
+
Pop the first asset with the specified unit and return it.
|
|
36
|
+
"""
|
|
37
|
+
for i, asset in enumerate(self.assets):
|
|
38
|
+
if asset.unit == unit:
|
|
39
|
+
pop_asset = self.assets.pop(i)
|
|
40
|
+
return pop_asset
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
def merge_assets(self, assets: List[Asset]) -> List[Asset]:
|
|
44
|
+
"""
|
|
45
|
+
Merge new assets into the current assets list. If units match, quantities are added.
|
|
46
|
+
"""
|
|
47
|
+
merged_assets = {}
|
|
48
|
+
for asset in self.assets + assets:
|
|
49
|
+
if asset.unit in merged_assets:
|
|
50
|
+
merged_assets[asset.unit].quantity = self.add_quantities(
|
|
51
|
+
merged_assets[asset.unit].quantity, asset.quantity
|
|
52
|
+
)
|
|
53
|
+
else:
|
|
54
|
+
merged_assets[asset.unit] = asset
|
|
55
|
+
return list(merged_assets.values())
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def add_quantities(quantity1: str, quantity2: str) -> str:
|
|
59
|
+
"""
|
|
60
|
+
Add two quantities (represented as strings) and return the result as a string.
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
int_quantity1 = int(quantity1)
|
|
64
|
+
int_quantity2 = int(quantity2)
|
|
65
|
+
sum_quantity = int_quantity1 + int_quantity2
|
|
66
|
+
return str(sum_quantity)
|
|
67
|
+
except ValueError:
|
|
68
|
+
return "0"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class BlockInfo:
|
|
6
|
+
time: int
|
|
7
|
+
hash: str
|
|
8
|
+
slot: str
|
|
9
|
+
epoch: int
|
|
10
|
+
epoch_slot: str
|
|
11
|
+
slot_leader: str
|
|
12
|
+
size: int
|
|
13
|
+
tx_count: int
|
|
14
|
+
output: str
|
|
15
|
+
fees: str
|
|
16
|
+
previous_block: str
|
|
17
|
+
next_block: str
|
|
18
|
+
confirmations: int
|
|
19
|
+
operational_certificate: str
|
|
20
|
+
vrf_key: str
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class Network:
|
|
6
|
+
"""Equivalent of Go's Network type with constants."""
|
|
7
|
+
|
|
8
|
+
TESTNET = "testnet"
|
|
9
|
+
PREVIEW = "preview"
|
|
10
|
+
PREPROD = "preprod"
|
|
11
|
+
MAINNET = "mainnet"
|
|
12
|
+
|
|
13
|
+
ALL_NETWORKS = [TESTNET, PREVIEW, PREPROD, MAINNET]
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def is_network(value: str) -> bool:
|
|
17
|
+
return value in Network.ALL_NETWORKS
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class Protocol:
|
|
6
|
+
epoch: int
|
|
7
|
+
min_fee_a: int
|
|
8
|
+
min_fee_b: int
|
|
9
|
+
max_block_size: int
|
|
10
|
+
max_tx_size: int
|
|
11
|
+
max_block_header_size: int
|
|
12
|
+
key_deposit: int
|
|
13
|
+
pool_deposit: int
|
|
14
|
+
decentralisation: float
|
|
15
|
+
min_pool_cost: str
|
|
16
|
+
price_mem: float
|
|
17
|
+
price_step: float
|
|
18
|
+
max_tx_ex_mem: str
|
|
19
|
+
max_tx_ex_steps: str
|
|
20
|
+
max_block_ex_mem: str
|
|
21
|
+
max_block_ex_steps: str
|
|
22
|
+
max_val_size: int
|
|
23
|
+
collateral_percent: int
|
|
24
|
+
max_collateral_inputs: int
|
|
25
|
+
coins_per_utxo_size: int
|
|
26
|
+
min_fee_ref_script_cost_per_byte: int
|
sidan_gin/types/utxo.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
|
|
4
|
+
from sidan_gin.types.asset import Asset
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class Input:
|
|
9
|
+
output_index: int
|
|
10
|
+
tx_hash: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass
|
|
14
|
+
class Output:
|
|
15
|
+
address: str
|
|
16
|
+
amount: List[Asset]
|
|
17
|
+
data_hash: Optional[str] = None
|
|
18
|
+
plutus_data: Optional[str] = None
|
|
19
|
+
script_ref: Optional[str] = None
|
|
20
|
+
script_hash: Optional[str] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class UTxO:
|
|
25
|
+
input: Input
|
|
26
|
+
output: Output
|
sidan_gin/types/value.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# flake8: noqa: E501
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Dict, List, Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class Asset:
|
|
9
|
+
unit: str
|
|
10
|
+
quantity: str # Stored as a string for compatibility with Cardano data
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Value:
|
|
14
|
+
def __init__(self):
|
|
15
|
+
# Represents the value map where the key is the asset name and the value is the quantity
|
|
16
|
+
self.value: Dict[str, int] = {}
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def from_assets(assets: Optional[List[Asset]]) -> "Value":
|
|
20
|
+
"""Create a new Value instance with the given assets."""
|
|
21
|
+
value = Value()
|
|
22
|
+
if assets is None:
|
|
23
|
+
return value
|
|
24
|
+
return value.add_assets(assets)
|
|
25
|
+
|
|
26
|
+
def add_asset(self, asset: Asset) -> "Value":
|
|
27
|
+
"""Add an asset to the Value class's value record."""
|
|
28
|
+
quantity = int(asset.quantity)
|
|
29
|
+
if asset.unit in self.value:
|
|
30
|
+
self.value[asset.unit] += quantity
|
|
31
|
+
else:
|
|
32
|
+
self.value[asset.unit] = quantity
|
|
33
|
+
return self
|
|
34
|
+
|
|
35
|
+
def add_assets(self, assets: List[Asset]) -> "Value":
|
|
36
|
+
"""Add multiple assets to the Value class's value record."""
|
|
37
|
+
for asset in assets:
|
|
38
|
+
self.add_asset(asset)
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
def negate_asset(self, asset: Asset) -> "Value":
|
|
42
|
+
"""Deduct the value amount of an asset from the Value class's value record."""
|
|
43
|
+
if asset is None:
|
|
44
|
+
return self
|
|
45
|
+
quantity = int(asset.quantity)
|
|
46
|
+
if asset.unit in self.value:
|
|
47
|
+
new_quantity = self.value[asset.unit] - quantity
|
|
48
|
+
if new_quantity <= 0:
|
|
49
|
+
del self.value[asset.unit]
|
|
50
|
+
else:
|
|
51
|
+
self.value[asset.unit] = new_quantity
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
def negate_assets(self, assets: List[Asset]) -> "Value":
|
|
55
|
+
"""Deduct the value amount of multiple assets from the Value class's value record."""
|
|
56
|
+
for asset in assets:
|
|
57
|
+
self.negate_asset(asset)
|
|
58
|
+
return self
|
|
59
|
+
|
|
60
|
+
def merge(self, *values: "Value") -> "Value":
|
|
61
|
+
"""Merge multiple Value class's value record into the current Value class's value record."""
|
|
62
|
+
for other in values:
|
|
63
|
+
if other is None:
|
|
64
|
+
continue
|
|
65
|
+
for unit, quantity in other.value.items():
|
|
66
|
+
if unit in self.value:
|
|
67
|
+
self.value[unit] += quantity
|
|
68
|
+
else:
|
|
69
|
+
self.value[unit] = quantity
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def get(self, unit: str) -> int:
|
|
73
|
+
"""Get the quantity of an asset in the Value class's value record."""
|
|
74
|
+
return self.value.get(unit, 0)
|
|
75
|
+
|
|
76
|
+
def units(self) -> List[str]:
|
|
77
|
+
"""Get the list of asset names in the Value class's value record."""
|
|
78
|
+
return list(self.value.keys())
|
|
79
|
+
|
|
80
|
+
def is_empty(self) -> bool:
|
|
81
|
+
"""Check if the Value class's value record is empty."""
|
|
82
|
+
return len(self.value) == 0
|
|
83
|
+
|
|
84
|
+
def to_assets(self) -> List[Asset]:
|
|
85
|
+
"""Convert the Value class's value record into a list of Asset."""
|
|
86
|
+
return [
|
|
87
|
+
Asset(unit=unit, quantity=str(quantity))
|
|
88
|
+
for unit, quantity in self.value.items()
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
def geq(self, other: "Value") -> bool:
|
|
92
|
+
"""Check if the value is greater than or equal to another value."""
|
|
93
|
+
for unit, quantity in other.value.items():
|
|
94
|
+
if self.value.get(unit, 0) < quantity:
|
|
95
|
+
return False
|
|
96
|
+
return True
|
sidan_gin/wallet/cli.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
class DerivationIndices:
|
|
2
|
+
@classmethod
|
|
3
|
+
def default(cls):
|
|
4
|
+
"""Default derivation indices (payment with index 0)"""
|
|
5
|
+
return DerivationIndices.payment(0, 0)
|
|
6
|
+
|
|
7
|
+
@classmethod
|
|
8
|
+
def payment(cls, account_index: int, key_index: int):
|
|
9
|
+
"""Creates derivation indices for payment accounts"""
|
|
10
|
+
return DerivationIndices.raw_path(
|
|
11
|
+
["1852'", "1815'", f"{str(account_index)}'", str(0), str(key_index)]
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def stake(cls, account_index: int, key_index: int):
|
|
16
|
+
"""Creates derivation indices for stake accounts"""
|
|
17
|
+
return DerivationIndices.raw_path(
|
|
18
|
+
["1852'", "1815'", f"{str(account_index)}'", str(2), str(key_index)]
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def drep(cls, account_index: int, key_index: int):
|
|
23
|
+
"""Creates derivation indices for drep accounts"""
|
|
24
|
+
return DerivationIndices.raw_path(
|
|
25
|
+
["1852'", "1815'", f"{str(account_index)}'", str(3), str(key_index)]
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def raw_path(derivation_indices: list[str]):
|
|
29
|
+
"""Creates a raw path from derivation indices"""
|
|
30
|
+
return f"m/{'/'.join(derivation_indices)}"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import CardanoSigner
|
|
2
|
+
|
|
3
|
+
from sidan_gin.wallet.derivation_indices import DerivationIndices
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class MnemonicWallet:
|
|
7
|
+
def __init__(self, mnemonic_phrase: str):
|
|
8
|
+
self.mnemonic_phrase = mnemonic_phrase
|
|
9
|
+
self.derivation_indices = DerivationIndices.default()
|
|
10
|
+
|
|
11
|
+
def payment_account(self, account_index: int, key_index: int):
|
|
12
|
+
self.derivation_indices = DerivationIndices.payment(account_index, key_index)
|
|
13
|
+
|
|
14
|
+
def stake_account(self, account_index: int, key_index: int):
|
|
15
|
+
self.derivation_indices = DerivationIndices.stake(account_index, key_index)
|
|
16
|
+
|
|
17
|
+
def drep_account(self, account_index: int, key_index: int):
|
|
18
|
+
self.derivation_indices = DerivationIndices.drep(account_index, key_index)
|
|
19
|
+
|
|
20
|
+
def sign_tx(self, tx_hex: str) -> str:
|
|
21
|
+
return CardanoSigner.sign_mnemonic(
|
|
22
|
+
self.mnemonic_phrase,
|
|
23
|
+
self.derivation_indices,
|
|
24
|
+
tx_hex,
|
|
25
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import CardanoSigner
|
|
2
|
+
|
|
3
|
+
from sidan_gin.wallet.derivation_indices import DerivationIndices
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RootKeyWallet:
|
|
7
|
+
def __init__(self, root_key: str):
|
|
8
|
+
self.root_key = root_key
|
|
9
|
+
self.derivation_indices = DerivationIndices.default()
|
|
10
|
+
|
|
11
|
+
def payment_account(self, account_index: int, key_index: int):
|
|
12
|
+
self.derivation_indices = DerivationIndices.payment(account_index, key_index)
|
|
13
|
+
|
|
14
|
+
def stake_account(self, account_index: int, key_index: int):
|
|
15
|
+
self.derivation_indices = DerivationIndices.stake(account_index, key_index)
|
|
16
|
+
|
|
17
|
+
def drep_account(self, account_index: int, key_index: int):
|
|
18
|
+
self.derivation_indices = DerivationIndices.drep(account_index, key_index)
|
|
19
|
+
|
|
20
|
+
def sign_tx(self, tx_hex: str) -> str:
|
|
21
|
+
return CardanoSigner.sign_bech32(
|
|
22
|
+
self.root_key,
|
|
23
|
+
self.derivation_indices,
|
|
24
|
+
tx_hex,
|
|
25
|
+
)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
3
|
+
from sidan_gin.wallet.cli import CliWallet
|
|
4
|
+
from sidan_gin.wallet.mnemonic import MnemonicWallet
|
|
5
|
+
from sidan_gin.wallet.root_key import RootKeyWallet
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Main Wallet class that users will interact with
|
|
9
|
+
class Wallet:
|
|
10
|
+
def __init__(self, wallet_type: Union[MnemonicWallet, RootKeyWallet, CliWallet]):
|
|
11
|
+
self.wallet_type = wallet_type
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
def new_mnemonic(cls, mnemonic_phrase: str) -> "Wallet":
|
|
15
|
+
"""Create a new wallet from a mnemonic phrase"""
|
|
16
|
+
return cls(MnemonicWallet(mnemonic_phrase))
|
|
17
|
+
|
|
18
|
+
@classmethod
|
|
19
|
+
def new_root_key(cls, root_key: str) -> "Wallet":
|
|
20
|
+
"""Create a new wallet from a root key"""
|
|
21
|
+
return cls(RootKeyWallet(root_key))
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def new_cli(cls, cli_skey: str) -> "Wallet":
|
|
25
|
+
"""Create a new wallet that uses CLI signing"""
|
|
26
|
+
return cls(CliWallet(cli_skey))
|
|
27
|
+
|
|
28
|
+
def payment_account(self, account_index: int, key_index: int) -> "Wallet":
|
|
29
|
+
"""Configure for payment account operations"""
|
|
30
|
+
if isinstance(self.wallet_type, (MnemonicWallet, RootKeyWallet)):
|
|
31
|
+
self.wallet_type.payment_account(account_index, key_index)
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
def stake_account(self, account_index: int, key_index: int) -> "Wallet":
|
|
35
|
+
"""Configure for stake account operations"""
|
|
36
|
+
if isinstance(self.wallet_type, (MnemonicWallet, RootKeyWallet)):
|
|
37
|
+
self.wallet_type.stake_account(account_index, key_index)
|
|
38
|
+
return self
|
|
39
|
+
|
|
40
|
+
def drep_account(self, account_index: int, key_index: int) -> "Wallet":
|
|
41
|
+
"""Configure for drep account operations"""
|
|
42
|
+
if isinstance(self.wallet_type, (MnemonicWallet, RootKeyWallet)):
|
|
43
|
+
self.wallet_type.drep_account(account_index, key_index)
|
|
44
|
+
return self
|
|
45
|
+
|
|
46
|
+
def sign_tx(self, tx_hex: str) -> str:
|
|
47
|
+
"""Sign a transaction using the configured wallet"""
|
|
48
|
+
return self.wallet_type.sign_tx(tx_hex)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sidan-gin
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: A python library for Cardano development, compatible with Mesh and Whisky types.
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: cardano
|
|
8
|
+
Author: HinsonSIDAN
|
|
9
|
+
Author-email: wongkahinhinson@gmail.com
|
|
10
|
+
Requires-Python: >3.11,<4.0.0
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Natural Language :: English
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Requires-Dist: cardano-python-signing-module (>=0.1.0,<0.2.0)
|
|
20
|
+
Requires-Dist: cryptography (>=44.0.2,<45.0.0)
|
|
21
|
+
Requires-Dist: pycardano (>=0.12.3,<0.13.0)
|
|
22
|
+
Requires-Dist: requests (>=2.25,<3.0)
|
|
23
|
+
Project-URL: Documentation, https://github.com/sidan-lab/gin
|
|
24
|
+
Project-URL: Homepage, https://github.com/sidan-lab/gin
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
<hr />
|
|
29
|
+
<h2 align="center" style="border-bottom: none"><img style="position: relative; top: 0.25rem;" src="https://raw.githubusercontent.com/sidan-lab/brand_assets/main/sidan_s_square.png" alt="Whisky" height="30" /> Gin - Cardano Python SDK</h2>
|
|
30
|
+
|
|
31
|
+
[](https://github.com/sidan-lab/gin/blob/master/LICENSE)
|
|
32
|
+
[](https://github.com/sidan-lab/gin/actions/workflows/build.yml)
|
|
33
|
+
[](https://github.com/sidan-lab/bin/actions/workflows/publish.yml)
|
|
34
|
+
|
|
35
|
+
[](https://pypi.python.org/pypi/sidan_gin/)
|
|
36
|
+
[](https://pypi.python.org/pypi/sidan_gin/)
|
|
37
|
+
[](https://pypi.python.org/pypi/sidan_gin/)
|
|
38
|
+
|
|
39
|
+
[](https://x.com/sidan_lab)
|
|
40
|
+
|
|
41
|
+
<hr/>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
# gin
|
|
45
|
+
|
|
46
|
+
Gin is a Python library for Cardano development, compatible with Mesh and Whisky types. It also re-export core logics implemented in Whisky to support stable serialization in Python. Supported features:
|
|
47
|
+
|
|
48
|
+
- Identical type system with Mesh and Whisky.
|
|
49
|
+
- Transaction signing
|
|
50
|
+
- Cipher data encryption and decryption
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
pip install sidan_gin
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Getting Started
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
- Coming soon
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
sidan_gin/__init__.py,sha256=vu8JEo4ADPBvK7l6_QhnhlKEnSYEmphSc7NE3jZG1dY,85
|
|
2
|
+
sidan_gin/encryption/__init__.py,sha256=4eCzQX7vgrrnnQFWVt86Kc_bBq9mzCdAuJbnNNaA62Y,38
|
|
3
|
+
sidan_gin/encryption/cipher.py,sha256=4xNKoyfUwkftLYxFajRHPOVaBYnXF4_alG2LeXvGbeg,5249
|
|
4
|
+
sidan_gin/python_signing_module/.git,sha256=6zrYBIbA30J88rlvjaRZWlwV1EC2lzsydBHgsqEoMrA,66
|
|
5
|
+
sidan_gin/python_signing_module/.gitignore,sha256=NP7DXi3vJqhsgANgH1Vw5JfOxBhy0G5VVr2jRGDe_-s,102
|
|
6
|
+
sidan_gin/python_signing_module/.vscode/settings.json,sha256=k2FuGx7eGPpQrMGxXB6XwIH3IAzJcDnpRlWCRHrVkr8,771
|
|
7
|
+
sidan_gin/python_signing_module/Cargo.toml,sha256=OgBinJNCwkvOJqT4kRIB3hSGGWDwpbbJTUzI4jqD3Eo,180
|
|
8
|
+
sidan_gin/python_signing_module/README.md,sha256=dQcu4nM06TwTJjKTgtbTp1XuuL-hI5Q02mbZZtmKVTI,107
|
|
9
|
+
sidan_gin/python_signing_module/__init__.py,sha256=mIzz621tHzLvVcEii5Rf3X780vThQo_cWGasKTJOnoo,30
|
|
10
|
+
sidan_gin/python_signing_module/build.rs,sha256=ot5FYadCsc7GA2welu6Z4rECHKKtu-R061-hrlonWJE,238
|
|
11
|
+
sidan_gin/python_signing_module/build.sh,sha256=YVw3e0Jp9GQCxMIyFU2SzWQKhRdoiQGT-5ZmBTEpxBs,206
|
|
12
|
+
sidan_gin/python_signing_module/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
sidan_gin/python_signing_module/src/lib.rs,sha256=k9IL2WeA3SGhWKOku87LK0bsts1JLTzwn7sA6q1Qdpw,3256
|
|
14
|
+
sidan_gin/python_signing_module/src/setup.py,sha256=Y0x1l7VhBIWbqnLLCL9N_boB4afUyG1k66VQwiBZsqo,517
|
|
15
|
+
sidan_gin/python_signing_module/src/signer.cpp,sha256=qIDk37McMT5NFnK1071EJ5XO7gtukOEAyRfkZosSTLw,2184
|
|
16
|
+
sidan_gin/python_signing_module/src/signer.h,sha256=8QVtsW-XjAka9nITanp1SHATwH44uVopBL3S9yOcD4s,986
|
|
17
|
+
sidan_gin/python_signing_module/src/signer.i,sha256=P6iSLTLca1LPh4d04yQDl-Z8DDs3cMn29Q1bD2pyb7k,401
|
|
18
|
+
sidan_gin/python_signing_module/src/signer_wrap.cxx,sha256=2pG1Vb5LEu5hzAPxWracx7BeRA1gLQRnqmflvJld3q4,124704
|
|
19
|
+
sidan_gin/types/__init__.py,sha256=r5Z6Bto1lE22yhNO9UThri6xoSUnoKk1Gb9A8aHMI24,241
|
|
20
|
+
sidan_gin/types/account_info.py,sha256=Q5TIXE6Ofj3DlSlMdeL2jhrSQYaJHIqhEzW_oMe_5OU,193
|
|
21
|
+
sidan_gin/types/asset.py,sha256=9LXNaCIJ0lyA0sGJOnusb_hDRf_ODZK4b3onUZmMPfI,2088
|
|
22
|
+
sidan_gin/types/asset_metadata.py,sha256=yRJ8irLcb-VCEeHHjIo_PZ74EL6HU_hp3oCfi2ak82Q,61
|
|
23
|
+
sidan_gin/types/block_info.py,sha256=rNdI-ZyhrrYvmtn3TuV6UgGO_rp1naugQ5fftUmzaAA,341
|
|
24
|
+
sidan_gin/types/network.py,sha256=HwUVx3IOllG42QwM1Pr81DNnJltJHcJz9aJeyXQGDQw,378
|
|
25
|
+
sidan_gin/types/protocol.py,sha256=MxC2TLtQVrQao6csvPx459JwIpM98XNwBYK05d-JRA8,583
|
|
26
|
+
sidan_gin/types/transaction_info.py,sha256=c7rh7I38uTksnyDgAZKPdLlw0zVeQHfIVWrcWw-IwrA,220
|
|
27
|
+
sidan_gin/types/utxo.py,sha256=HvnAJXxyLm0KUBnrqprMm8Pc8H2ebxGW339pFLKo7K4,452
|
|
28
|
+
sidan_gin/types/value.py,sha256=cGFqxk15FrG2zy6PB5zMRq1vOBYfBQbMWbuqiCTEgRg,3345
|
|
29
|
+
sidan_gin/wallet/__init__.py,sha256=y_6mQqlePwnC0LPbCM0Il4XfkAzG0aqJLOdGRrSgljg,43
|
|
30
|
+
sidan_gin/wallet/cli.py,sha256=R-Q2Sq_K2j7ctkvZ57iB0z1dlqsqSe8zSqR11OZEPzE,290
|
|
31
|
+
sidan_gin/wallet/derivation_indices.py,sha256=NbxUEJfPgUCq6ACJtSbF4Zq8DtAO0vtjski7KtwvE9U,1139
|
|
32
|
+
sidan_gin/wallet/mnemonic.py,sha256=z5Xxg9rPi_aGToiDOp49BimfUsNDnZcL9e6jAnW4-6A,908
|
|
33
|
+
sidan_gin/wallet/root_key.py,sha256=V8PFx2FzEEgmLrhhD64Dw5yZB8OxRUFo99QsigWdsyQ,877
|
|
34
|
+
sidan_gin/wallet/wallet.py,sha256=XXBF4AVgXZGhleKZNkUqR5610Qe8Ey03C44fd19KxYI,1920
|
|
35
|
+
sidan_gin-0.1.7.dist-info/METADATA,sha256=ZOmwuz4t_FpCBFjr7lI_WUsib2WQfUAFUdD0jvHVSNA,2733
|
|
36
|
+
sidan_gin-0.1.7.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
37
|
+
sidan_gin-0.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
38
|
+
sidan_gin-0.1.7.dist-info/RECORD,,
|