Skip to content

Commit 039ca40

Browse files
authored
Sui ts sdk (#5211)
2 parents 112aec9 + 675f43a commit 039ca40

38 files changed

+1747
-17
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ ts-sdk-evm/docs
113113
ts-sdk-cosmos/build
114114
ts-sdk-cosmos/dist
115115
ts-sdk-cosmos/docs
116+
ts-sdk-sui/build
117+
ts-sdk-sui/dist
118+
ts-sdk-sui/docs
116119
sentinel2/build
117120
docs/src/content/docs/reference/@unionlabs/sdk
118121
docs/src/content/docs/reference/@unionlabs/sdk-evm

app2/src/lib/stores/wallets.svelte.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ class WalletsStore {
77
evmAddress: Option.Option<Ucs05.EvmDisplay> = $state(Option.none())
88
cosmosAddress: Option.Option<Ucs05.CosmosDisplay> = $state(Option.none())
99
aptosAddress: Option.Option<Ucs05.AnyDisplay> = $state(Option.none())
10+
suiAddress: Option.Option<Ucs05.AnyDisplay> = $state(Option.none())
1011
inputAddress: Option.Option<Ucs05.AnyDisplay> = $state(Option.none())
1112

1213
hasAnyWallet() {
1314
return (
1415
Option.isSome(this.evmAddress)
1516
|| Option.isSome(this.cosmosAddress)
1617
|| Option.isSome(this.aptosAddress)
18+
|| Option.isSome(this.suiAddress)
1719
|| Option.isSome(this.inputAddress)
1820
)
1921
}
@@ -34,6 +36,7 @@ class WalletsStore {
3436
this.evmAddress,
3537
this.cosmosAddress,
3638
this.aptosAddress,
39+
this.suiAddress,
3740
]),
3841
A.map(Ucs05.anyDisplayToCanonical),
3942
)
@@ -52,6 +55,7 @@ class WalletsStore {
5255
Option.map((address) => Ucs05.CosmosDisplay.make({ address })),
5356
)),
5457
Match.when("aptos", () => this.aptosAddress),
58+
Match.when("sui", () => this.suiAddress),
5559
Match.exhaustive,
5660
)
5761
}

app2/src/lib/transfer/shared/components/Receiver.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ let manualAddress = $state("")
109109
let showClearConfirm = $state(false)
110110
let bookmarkOnAdd = $state(false)
111111
112-
let recentAddresses: Record<string, Array<`0x${string}` | `${string}1${string}`>> = $state({})
113-
let bookmarkedAddresses: Record<string, Array<`0x${string}` | `${string}1${string}`>> = $state({})
112+
let recentAddresses: Record<string, Array<(string & {}) | `0x${string}` | `${string}1${string}`>> =
113+
$state({})
114+
let bookmarkedAddresses: Record<
115+
string,
116+
Array<(string & {}) | `0x${string}` | `${string}1${string}`>
117+
> = $state({})
114118
115119
// Create crossfade transition
116120
const [send, receive] = crossfade({

app2/src/lib/transfer/shared/services/filling/check-allowance.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export const checkAllowances = Effect.fn((
5252
sender,
5353
chain,
5454
),
55+
SuiDisplay: (sender) =>
56+
Effect.fail(
57+
new AllowanceCheckError({ message: "Sui allowance check not implemented" }),
58+
),
5559
}),
5660
Effect.map(A.map(({ token, allowance }) => [token, allowance] as const)),
5761
Effect.map(HashMap.fromIterable),

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
./ts-sdk/ts-sdk.nix
198198
./ts-sdk-evm/ts-sdk-evm.nix
199199
./ts-sdk-cosmos/ts-sdk-cosmos.nix
200+
./ts-sdk-sui/ts-sdk-sui.nix
200201
./typescript-sdk/typescript-sdk.nix
201202
./cosmwasm/cosmwasm.nix
202203
./evm/evm.nix

pnpm-lock.yaml

Lines changed: 147 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ packages:
99
- 'ts-sdk-evm'
1010
- 'typescript-sdk'
1111
- 'zkgm-dev'
12+
- 'ts-sdk-sui'

scripts/docs.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function packages() {
66
"ts-sdk",
77
"ts-sdk-evm",
88
"ts-sdk-cosmos",
9+
"ts-sdk-sui",
910
].filter((_) => Fs.existsSync(Path.join(_, "docs/modules")))
1011
}
1112

ts-sdk-sui/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/**

ts-sdk-sui/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Union.fi Labs, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)