Skip to content

Commit d610b0f

Browse files
committed
chore(sdk): upgrade core dependencies add new type fields
1 parent 4a348ef commit d610b0f

File tree

11 files changed

+84
-18
lines changed

11 files changed

+84
-18
lines changed

.changeset/red-dingos-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/types': minor
3+
---
4+
5+
v1 siacoin and siafund inputs now have an address field.

.changeset/spotty-coins-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/types': minor
3+
---
4+
5+
Both v1 and v2 (same type) siacoin and siafund outputs now have an id field.

.changeset/tender-kiwis-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/types': minor
3+
---
4+
5+
v1 and v2 transactions now both have an id field.

apps/walletd/lib/__snapshots__/signLedgerV1.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Object {
88
],
99
"siacoinInputs": Array [
1010
Object {
11+
"address": "7776057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1",
1112
"parentID": "aa3e781330c9b3991e0141807df1327fadf114ca6c37acb9e58004f942d91dfb",
1213
"unlockConditions": Object {
1314
"publicKeys": Array [
@@ -18,6 +19,7 @@ Object {
1819
},
1920
},
2021
Object {
22+
"address": "8886057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1",
2123
"parentID": "32e430158591b4073a6834e9f4c4b67162e348844f569f4e472896bb72efb724",
2224
"unlockConditions": Object {
2325
"publicKeys": Array [

apps/walletd/lib/__snapshots__/signSeedV1.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Object {
88
],
99
"siacoinInputs": Array [
1010
Object {
11+
"address": "7776057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1",
1112
"parentID": "aa3e781330c9b3991e0141807df1327fadf114ca6c37acb9e58004f942d91dfb",
1213
"unlockConditions": Object {
1314
"publicKeys": Array [
@@ -18,6 +19,7 @@ Object {
1819
},
1920
},
2021
Object {
22+
"address": "8886057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1",
2123
"parentID": "32e430158591b4073a6834e9f4c4b67162e348844f569f4e472896bb72efb724",
2224
"unlockConditions": Object {
2325
"publicKeys": Array [

apps/walletd/lib/mocks/mockSeedWallet.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ export function getMockScenarioSeedWallet() {
109109
transaction: {
110110
siacoinInputs: [
111111
{
112+
address:
113+
'7776057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1',
112114
parentID:
113115
'aa3e781330c9b3991e0141807df1327fadf114ca6c37acb9e58004f942d91dfb',
114116
unlockConditions: {
@@ -118,6 +120,8 @@ export function getMockScenarioSeedWallet() {
118120
},
119121
},
120122
{
123+
address:
124+
'8886057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee1',
121125
parentID:
122126
'32e430158591b4073a6834e9f4c4b67162e348844f569f4e472896bb72efb724',
123127
unlockConditions: {

libs/sdk/src/wallet.mock.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export const mockKeyPair0 = {
1212

1313
export function getTransaction(): Transaction {
1414
return {
15+
id: 'b222428602c8382b67a769d17e1cdc0952f37f2441a872b92671a6ed76cf22f5',
1516
siacoinInputs: [
1617
{
18+
address:
19+
'934b885229a9f98153401d7a647a1862aede399c656f33ec8492dfffca557ca907a3d22089c8',
1720
parentID:
1821
'b222428602c8382b67a769d17e1cdc0952f37f2441a872b92671a6ed76cf22f5',
1922
unlockConditions: {
@@ -25,13 +28,16 @@ export function getTransaction(): Transaction {
2528
],
2629
siacoinOutputs: [
2730
{
31+
id: '31cf3ddc946d71d219fb1fbe9a11804e607b6d5ad1b4bf7b3678a2faa701a42e',
2832
value: '95408980544305197274920800',
2933
address:
3034
'934b885229a9f98153401d7a647a1862aede399c656f33ec8492dfffca557ca907a3d22089c8',
3135
},
3236
],
3337
siafundInputs: [
3438
{
39+
address:
40+
'934b885229a9f98153401d7a647a1862aede399c656f33ec8492dfffca557ca907a3d22089c8',
3541
parentID:
3642
'b53e88ce69f19f0bf1d3496479f20b72e1133c719e82278830ee6618bb582852',
3743
unlockConditions: {
@@ -47,6 +53,7 @@ export function getTransaction(): Transaction {
4753
],
4854
siafundOutputs: [
4955
{
56+
id: '425a60eee280854b7f3eb59b1613370bcc0ae3a02859f866f80e7b310475e1e8',
5057
value: 1,
5158
address:
5259
'eb2ee5169dd9aaab804b38f7e70043690ac21da1144990a4a28c1dcf66cd7ee9845aef03006f',
@@ -76,6 +83,7 @@ export function getV2Transaction(): V2Transaction {
7683
id: 'aa3e781330c9b3991e0141807df1327fadf114ca6c37acb9e58004f942d91dfb',
7784
maturityHeight: 0,
7885
siacoinOutput: {
86+
id: '31cf3ddc946d71d219fb1fbe9a11804e607b6d5ad1b4bf7b3678a2faa701a42e',
7987
value: '1000000000000000000000000',
8088
address:
8189
'90c6057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee8',
@@ -106,6 +114,7 @@ export function getV2Transaction(): V2Transaction {
106114
id: '32e430158591b4073a6834e9f4c4b67162e348844f569f4e472896bb72efb724',
107115
maturityHeight: 0,
108116
siacoinOutput: {
117+
id: 'f2dbf56b5b0c698d7fbf43f646c76169d84e597e8b37fada97348beeecaa812d400ac4ce7981',
109118
value: '97984280000000000000000000',
110119
address:
111120
'f2dbf56b5b0c698d7fbf43f646c76169d84e597e8b37fada97348beeecaa812d400ac4ce7981',
@@ -134,11 +143,13 @@ export function getV2Transaction(): V2Transaction {
134143
],
135144
siacoinOutputs: [
136145
{
146+
id: '31cf3ddc946d71d219fb1fbe9a11804e607b6d5ad1b4bf7b3678a2faa701a42e',
137147
value: '1000000000000000000000000',
138148
address:
139149
'90c6057cdd2463eca61f83796e83152dbba28b6cb9a74831a043833051ec9f422726bfff2ee8',
140150
},
141151
{
152+
id: 'f2dbf56b5b0c698d7fbf43f646c76169d84e597e8b37fada97348beeecaa812d400ac4ce7981',
142153
value: '97984280000000000000000000',
143154
address:
144155
'f2dbf56b5b0c698d7fbf43f646c76169d84e597e8b37fada97348beeecaa812d400ac4ce7981',

libs/types/src/core.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ export type TransactionSignature = {
4949
}
5050

5151
export type SiacoinInput = {
52+
address?: Address
5253
parentID: string
5354
unlockConditions: UnlockConditions
5455
}
5556

5657
export type SiacoinOutput = {
58+
id?: SiacoinOutputID
5759
value: Currency
5860
address: string
5961
}
@@ -111,17 +113,20 @@ export type StorageProof = {
111113
}
112114

113115
export type SiafundInput = {
116+
address?: Address
114117
parentID: string
115118
unlockConditions: UnlockConditions
116119
claimAddress: string
117120
}
118121

119122
export type SiafundOutput = {
123+
id?: SiafundOutputID
120124
value: number
121125
address: string
122126
}
123127

124128
export type Transaction = {
129+
id?: TransactionID
125130
siacoinInputs?: SiacoinInput[]
126131
siacoinOutputs?: SiacoinOutput[]
127132
fileContracts?: FileContract[]

libs/types/src/v2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SiafundOutput,
1313
Signature,
1414
StateElement,
15+
TransactionID,
1516
UnlockConditions,
1617
} from './core'
1718

@@ -72,6 +73,7 @@ export type V2FileContractRenewal = {
7273
}
7374

7475
export type V2Transaction = {
76+
id?: TransactionID
7577
siacoinInputs?: V2SiacoinInput[]
7678
siacoinOutputs?: SiacoinOutput[]
7779
siafundInputs?: V2SiafundInput[]

sdk/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ go 1.23.1
55
toolchain go1.23.3
66

77
require (
8-
go.sia.tech/core v0.9.1
9-
go.sia.tech/coreutils v0.9.1
8+
go.sia.tech/core v0.12.2
9+
go.sia.tech/coreutils v0.13.3
1010
)
1111

1212
require (
13+
github.com/stretchr/testify v1.10.0 // indirect
1314
go.uber.org/multierr v1.11.0 // indirect
1415
go.uber.org/zap v1.27.0 // indirect
15-
golang.org/x/crypto v0.32.0 // indirect
16-
golang.org/x/sys v0.29.0 // indirect
16+
golang.org/x/crypto v0.38.0 // indirect
17+
golang.org/x/sys v0.33.0 // indirect
1718
lukechampine.com/frand v1.5.1 // indirect
1819
)

0 commit comments

Comments
 (0)