swig-developer-sdk 0.6.0__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.
@@ -0,0 +1,89 @@
1
+ Metadata-Version: 2.4
2
+ Name: swig-developer-sdk
3
+ Version: 0.6.0
4
+ Summary: Python SDK for preparing and locally signing Swig wallet transactions
5
+ Project-URL: Repository, https://github.com/anagrambuild/swig-ts
6
+ Author: Anagram
7
+ License: Apache-2.0
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: base58<3,>=2.1
10
+ Requires-Dist: httpx<1,>=0.28
11
+ Requires-Dist: solders<0.29,>=0.28
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Swig Developer SDK for Python
15
+
16
+ Python parity for `@swig-wallet/developer-sdk`. The Swig API prepares wallet
17
+ transactions; this SDK invokes application-owned signers and inserts signatures
18
+ locally with `solders`.
19
+
20
+ ```bash
21
+ pip install swig-developer-sdk
22
+ ```
23
+
24
+ ## Prepare a transaction
25
+
26
+ ```python
27
+ from swig_developer_sdk import SwigClient
28
+
29
+ swig = SwigClient(api_key="swig_...", network="devnet")
30
+ wallet = swig.wallets.use(
31
+ "SWIG_CONFIG_ADDRESS",
32
+ requester_authority={"ed25519": {"publicKey": "USER_PUBLIC_KEY"}},
33
+ )
34
+
35
+ prepared = await wallet.transfer.sol(
36
+ fee_payer="FEE_PAYER",
37
+ destination="DESTINATION",
38
+ amount=1_000_000,
39
+ )
40
+ ```
41
+
42
+ `wallet.transfer(...)` and `wallet.swap(...)` are callable like their
43
+ TypeScript counterparts. Their explicit `sol`, `token`, `spl_token`, and
44
+ `jupiter` methods are available as well.
45
+
46
+ ## Sign locally
47
+
48
+ The generic signer helper works with an application-owned Ed25519 signer. The
49
+ Swig signer helper patches secp256r1 or secp256k1 signatures into both legacy
50
+ and versioned Solana transactions without sending signing material to the API.
51
+
52
+ ```python
53
+ from swig_developer_sdk import sign_prepared_swig_transaction
54
+
55
+ signed = await sign_prepared_swig_transaction(
56
+ prepared,
57
+ secp256r1=application_passkey_signer,
58
+ )
59
+ ```
60
+
61
+ WebAuthn and EIP-1193 adapters are callback-based so applications can connect
62
+ their browser, hardware, wallet, or remote signer without changing the
63
+ transaction preparation API.
64
+
65
+ ## Local end-to-end test
66
+
67
+ With the `swig-dev-portal` Tilt stack running, this command seeds a temporary
68
+ local API key and exercises wallet creation, real P-256 signing, direct and
69
+ grouped SOL transfers, an SPL-token transfer, and the Python proxy through the
70
+ Developer API. It also verifies the live paymaster balance endpoint and a
71
+ sponsored transfer where the user pays no network fee. Every transaction is
72
+ submitted to Surfpool and verified on-chain; the paymaster flow also retries
73
+ with the same idempotency key and verifies that no balance changes repeat.
74
+
75
+ ```bash
76
+ bun run e2e:developer-sdk:python
77
+ ```
78
+
79
+ The defaults are `http://localhost:8080` for the Developer API,
80
+ `http://localhost:8899` for Surfpool, and the Tilt Postgres instance on port
81
+ `55432`. Override them with `SWIG_TRANSACTION_API_URL`, `SOLANA_RPC_URL`, or
82
+ `SWIG_DATABASE_URL`.
83
+
84
+ Jupiter and recovery are not counted by this local test: Jupiter needs a
85
+ mainnet-backed Surfpool, while recovery setup needs a reachable operator
86
+ signer.
87
+
88
+ See the repository-level [parity matrix](../PARITY.md) for the complete mapped
89
+ surface.
@@ -0,0 +1,16 @@
1
+ swig_developer_sdk/__init__.py,sha256=HH1LezUqV673pMoGrCaVijwXVBLUDUC0Tbe5v2rByCc,4680
2
+ swig_developer_sdk/client.py,sha256=GlukId-lsmxpMlvZUSjMJnrmLOEGEmbQvn7kghprMHA,1053
3
+ swig_developer_sdk/common.py,sha256=qtUIlyDiCeVvGyErJAKs8p1erOO__0jbU2zkVmmIMNQ,3548
4
+ swig_developer_sdk/core.py,sha256=Muqt0Q_alsplmsjBWkx7F1j9j-lKC1SbI01JoC5j-CU,5382
5
+ swig_developer_sdk/evm.py,sha256=b9-4OLY2xpwLyIlNkvAoL5GXgsUAy29ILjI7wkQyLVA,2048
6
+ swig_developer_sdk/one_business.py,sha256=eDiwDVs9gfglXJlcQRi0CJS0oFdJeG0ApEc4jj-BObw,5129
7
+ swig_developer_sdk/passkeys.py,sha256=yx3M5dJKSvjrEDUt416D0s-bpdyIoniNL1r0oVY3tX4,4177
8
+ swig_developer_sdk/paymaster.py,sha256=pmdnKoQm8CiJbR_inJACXyhqw6S-dUShPYYH3y7-hm4,3351
9
+ swig_developer_sdk/proxy.py,sha256=hfELdL5dJ5RUmeUa0gM5yNcyRNA7ymfUb2bOmbIXDfQ,26367
10
+ swig_developer_sdk/ramp.py,sha256=nyBfSjJCxtnHFq1A6pk4IEBE2ZWzG-nYdp42ZtNZLhU,24269
11
+ swig_developer_sdk/signing.py,sha256=rXVegrdrpTJUMJaDwFJgGmEBCOdMwgXrBK8dq8-njGM,15831
12
+ swig_developer_sdk/transactions.py,sha256=EY_ti1-P2ayk63c1vqYnfnEjadhV5zJcqOo4Gfu7CHI,9082
13
+ swig_developer_sdk/wallets.py,sha256=jG2kOg37TYN_aDegvFZK9iMk4QhZwwx7xAJwMH6QCQA,47356
14
+ swig_developer_sdk-0.6.0.dist-info/METADATA,sha256=WPfzLtSRZYZO61Awn3zYdHkdQ_dILgGm0ssZbG8rk8A,2940
15
+ swig_developer_sdk-0.6.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
16
+ swig_developer_sdk-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any