@bitgo/public-types 5.96.2 → 6.0.0
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.
- package/dist/src/schema/mpcv2/signing/eddsaSigningRound.d.ts +61 -0
- package/dist/src/schema/mpcv2/signing/eddsaSigningRound.js +75 -0
- package/dist/src/schema/mpcv2/signing/eddsaSigningRound.js.map +1 -0
- package/dist/src/schema/mpcv2/signing/index.d.ts +1 -0
- package/dist/src/schema/mpcv2/signing/index.js +1 -0
- package/dist/src/schema/mpcv2/signing/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +40 -26
- package/dist/src/schema/transactionRequest/intents/solAuthorizeIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solBuildOptions.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solBuildOptions.js +2 -3
- package/dist/src/schema/transactionRequest/intents/solBuildOptions.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/solClaimIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.d.ts +32 -5
- package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.js +18 -2
- package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/solCreateAssociatedTokenAccountIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solCustomTxIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solDeactivateIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solDelegateIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solGoUnstakeIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solPaymentIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/intents/solStakeIntent.d.ts +4 -4
- package/dist/src/schema/transactionRequest/intents/solUnstakeIntent.d.ts +4 -4
- package/dist/src/schema/transactionRequest/intents/solVersionedCustomTxIntent.d.ts +2 -2
- package/dist/src/schema/transactionRequest/message.d.ts +3 -0
- package/dist/src/schema/transactionRequest/transaction.d.ts +3 -0
- package/dist/src/schema/transactionRequest/transactionRequest.d.ts +92 -52
- package/dist/src/schema/transactionRequest/transactionState.d.ts +3 -0
- package/dist/src/schema/transactionRequest/transactionState.js +3 -0
- package/dist/src/schema/transactionRequest/transactionState.js.map +1 -1
- package/dist/src/schema/webhook/addWalletWebhookRequest.d.ts +2 -2
- package/dist/src/schema/webhook/enterpriseWebhooks.d.ts +3 -0
- package/dist/src/schema/webhook/organizationWebhooks.d.ts +3 -0
- package/dist/src/schema/webhook/webhook.d.ts +3 -0
- package/dist/src/utils/getAssetsFromIntent.js +13 -4
- package/dist/src/utils/getAssetsFromIntent.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/mpcv2/signing/eddsaSigningRound.ts +117 -0
- package/src/schema/mpcv2/signing/index.ts +1 -0
- package/src/schema/transactionRequest/intents/solBuildOptions.ts +20 -3
- package/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.ts +94 -5
- package/src/schema/transactionRequest/transactionState.ts +3 -0
- package/src/utils/getAssetsFromIntent.ts +21 -4
|
@@ -5156,8 +5156,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5156
5156
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5157
5157
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5158
5158
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5159
|
-
}>, t.
|
|
5160
|
-
memo: t.
|
|
5159
|
+
}>, t.PartialC<{
|
|
5160
|
+
memo: t.StringC;
|
|
5161
5161
|
}>]>, t.TypeC<{
|
|
5162
5162
|
intentType: t.LiteralC<"authorize">;
|
|
5163
5163
|
transactionMessage: t.StringC;
|
|
@@ -5243,8 +5243,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5243
5243
|
}, unknown>, t.UndefinedC]>;
|
|
5244
5244
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5245
5245
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5246
|
-
}>, t.
|
|
5247
|
-
memo: t.
|
|
5246
|
+
}>, t.PartialC<{
|
|
5247
|
+
memo: t.StringC;
|
|
5248
5248
|
}>]>, t.TypeC<{
|
|
5249
5249
|
amount: t.TypeC<{
|
|
5250
5250
|
value: t.StringC;
|
|
@@ -5313,12 +5313,26 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5313
5313
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5314
5314
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5315
5315
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5316
|
-
}>, t.
|
|
5317
|
-
memo: t.
|
|
5316
|
+
}>, t.PartialC<{
|
|
5317
|
+
memo: t.StringC;
|
|
5318
5318
|
}>]>, t.TypeC<{
|
|
5319
5319
|
intentType: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
5320
|
-
|
|
5321
|
-
|
|
5320
|
+
recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
|
|
5321
|
+
address: t.PartialC<{
|
|
5322
|
+
address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
5323
|
+
option: t.UnionC<[t.Type<{
|
|
5324
|
+
[x: string]: unknown;
|
|
5325
|
+
}, {
|
|
5326
|
+
[x: string]: unknown;
|
|
5327
|
+
}, unknown>, t.UndefinedC]>;
|
|
5328
|
+
}>;
|
|
5329
|
+
amount: t.TypeC<{
|
|
5330
|
+
value: t.StringC;
|
|
5331
|
+
symbol: t.StringC;
|
|
5332
|
+
}>;
|
|
5333
|
+
}>, t.PartialC<{
|
|
5334
|
+
data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
5335
|
+
}>]>>>>;
|
|
5322
5336
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5323
5337
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5324
5338
|
}>, t.TypeC<{
|
|
@@ -5447,8 +5461,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5447
5461
|
}>]>>;
|
|
5448
5462
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5449
5463
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5450
|
-
}>, t.
|
|
5451
|
-
memo: t.
|
|
5464
|
+
}>, t.PartialC<{
|
|
5465
|
+
memo: t.StringC;
|
|
5452
5466
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
5453
5467
|
intentType: t.KeyofC<{
|
|
5454
5468
|
payment: t.LiteralC<"payment">;
|
|
@@ -5510,8 +5524,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5510
5524
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5511
5525
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5512
5526
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5513
|
-
}>, t.
|
|
5514
|
-
memo: t.
|
|
5527
|
+
}>, t.PartialC<{
|
|
5528
|
+
memo: t.StringC;
|
|
5515
5529
|
}>]>, t.TypeC<{
|
|
5516
5530
|
intentType: t.LiteralC<"customTx">;
|
|
5517
5531
|
solInstructions: t.ArrayC<t.TypeC<{
|
|
@@ -5584,8 +5598,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5584
5598
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5585
5599
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5586
5600
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5587
|
-
}>, t.
|
|
5588
|
-
memo: t.
|
|
5601
|
+
}>, t.PartialC<{
|
|
5602
|
+
memo: t.StringC;
|
|
5589
5603
|
}>]>, t.TypeC<{
|
|
5590
5604
|
intentType: t.LiteralC<"deactivate">;
|
|
5591
5605
|
stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
|
|
@@ -5651,8 +5665,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5651
5665
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5652
5666
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5653
5667
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5654
|
-
}>, t.
|
|
5655
|
-
memo: t.
|
|
5668
|
+
}>, t.PartialC<{
|
|
5669
|
+
memo: t.StringC;
|
|
5656
5670
|
}>]>, t.TypeC<{
|
|
5657
5671
|
intentType: t.LiteralC<"delegate">;
|
|
5658
5672
|
validatorAddress: t.StringC;
|
|
@@ -5739,8 +5753,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5739
5753
|
}>]>>;
|
|
5740
5754
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5741
5755
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5742
|
-
}>, t.
|
|
5743
|
-
memo: t.
|
|
5756
|
+
}>, t.PartialC<{
|
|
5757
|
+
memo: t.StringC;
|
|
5744
5758
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
5745
5759
|
intentType: t.KeyofC<{
|
|
5746
5760
|
payment: t.LiteralC<"payment">;
|
|
@@ -5824,8 +5838,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5824
5838
|
isTestTransaction: t.BooleanC;
|
|
5825
5839
|
}>]>]>, t.IntersectionC<[t.PartialC<{
|
|
5826
5840
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5827
|
-
}>, t.
|
|
5828
|
-
memo: t.
|
|
5841
|
+
}>, t.PartialC<{
|
|
5842
|
+
memo: t.StringC;
|
|
5829
5843
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
5830
5844
|
intentType: t.KeyofC<{
|
|
5831
5845
|
payment: t.LiteralC<"payment">;
|
|
@@ -5893,8 +5907,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5893
5907
|
intentType: t.LiteralC<"stake">;
|
|
5894
5908
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5895
5909
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5896
|
-
}>, t.
|
|
5897
|
-
memo: t.
|
|
5910
|
+
}>, t.PartialC<{
|
|
5911
|
+
memo: t.StringC;
|
|
5898
5912
|
}>]>, t.TypeC<{
|
|
5899
5913
|
amount: t.TypeC<{
|
|
5900
5914
|
value: t.StringC;
|
|
@@ -5971,8 +5985,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
5971
5985
|
intentType: t.LiteralC<"unstake">;
|
|
5972
5986
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
5973
5987
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
5974
|
-
}>, t.
|
|
5975
|
-
memo: t.
|
|
5988
|
+
}>, t.PartialC<{
|
|
5989
|
+
memo: t.StringC;
|
|
5976
5990
|
}>]>, t.TypeC<{
|
|
5977
5991
|
stakingAddress: t.StringC;
|
|
5978
5992
|
}>, t.PartialC<{
|
|
@@ -6080,8 +6094,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
|
|
|
6080
6094
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
6081
6095
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
6082
6096
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
6083
|
-
}>, t.
|
|
6084
|
-
memo: t.
|
|
6097
|
+
}>, t.PartialC<{
|
|
6098
|
+
memo: t.StringC;
|
|
6085
6099
|
}>]>, t.TypeC<{
|
|
6086
6100
|
intentType: t.LiteralC<"customTx">;
|
|
6087
6101
|
solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
|
|
@@ -10606,6 +10620,9 @@ export declare const TransactionRequestFull: t.IntersectionC<[t.IntersectionC<[t
|
|
|
10606
10620
|
ecdsaMPCv2Round1: number;
|
|
10607
10621
|
ecdsaMPCv2Round2: number;
|
|
10608
10622
|
ecdsaMPCv2Round3: number;
|
|
10623
|
+
eddsaMPCv2Round1: number;
|
|
10624
|
+
eddsaMPCv2Round2: number;
|
|
10625
|
+
eddsaMPCv2Round3: number;
|
|
10609
10626
|
readyToCombineShares: number;
|
|
10610
10627
|
signed: number;
|
|
10611
10628
|
held: number;
|
|
@@ -10709,6 +10726,9 @@ export declare const TransactionRequestFull: t.IntersectionC<[t.IntersectionC<[t
|
|
|
10709
10726
|
ecdsaMPCv2Round1: number;
|
|
10710
10727
|
ecdsaMPCv2Round2: number;
|
|
10711
10728
|
ecdsaMPCv2Round3: number;
|
|
10729
|
+
eddsaMPCv2Round1: number;
|
|
10730
|
+
eddsaMPCv2Round2: number;
|
|
10731
|
+
eddsaMPCv2Round3: number;
|
|
10712
10732
|
readyToCombineShares: number;
|
|
10713
10733
|
signed: number;
|
|
10714
10734
|
held: number;
|
|
@@ -15905,8 +15925,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
15905
15925
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
15906
15926
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
15907
15927
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
15908
|
-
}>, t.
|
|
15909
|
-
memo: t.
|
|
15928
|
+
}>, t.PartialC<{
|
|
15929
|
+
memo: t.StringC;
|
|
15910
15930
|
}>]>, t.TypeC<{
|
|
15911
15931
|
intentType: t.LiteralC<"authorize">;
|
|
15912
15932
|
transactionMessage: t.StringC;
|
|
@@ -15992,8 +16012,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
15992
16012
|
}, unknown>, t.UndefinedC]>;
|
|
15993
16013
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
15994
16014
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
15995
|
-
}>, t.
|
|
15996
|
-
memo: t.
|
|
16015
|
+
}>, t.PartialC<{
|
|
16016
|
+
memo: t.StringC;
|
|
15997
16017
|
}>]>, t.TypeC<{
|
|
15998
16018
|
amount: t.TypeC<{
|
|
15999
16019
|
value: t.StringC;
|
|
@@ -16062,12 +16082,26 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16062
16082
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16063
16083
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16064
16084
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16065
|
-
}>, t.
|
|
16066
|
-
memo: t.
|
|
16085
|
+
}>, t.PartialC<{
|
|
16086
|
+
memo: t.StringC;
|
|
16067
16087
|
}>]>, t.TypeC<{
|
|
16068
16088
|
intentType: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
16069
|
-
|
|
16070
|
-
|
|
16089
|
+
recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
|
|
16090
|
+
address: t.PartialC<{
|
|
16091
|
+
address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
16092
|
+
option: t.UnionC<[t.Type<{
|
|
16093
|
+
[x: string]: unknown;
|
|
16094
|
+
}, {
|
|
16095
|
+
[x: string]: unknown;
|
|
16096
|
+
}, unknown>, t.UndefinedC]>;
|
|
16097
|
+
}>;
|
|
16098
|
+
amount: t.TypeC<{
|
|
16099
|
+
value: t.StringC;
|
|
16100
|
+
symbol: t.StringC;
|
|
16101
|
+
}>;
|
|
16102
|
+
}>, t.PartialC<{
|
|
16103
|
+
data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
16104
|
+
}>]>>>>;
|
|
16071
16105
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16072
16106
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16073
16107
|
}>, t.TypeC<{
|
|
@@ -16196,8 +16230,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16196
16230
|
}>]>>;
|
|
16197
16231
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16198
16232
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16199
|
-
}>, t.
|
|
16200
|
-
memo: t.
|
|
16233
|
+
}>, t.PartialC<{
|
|
16234
|
+
memo: t.StringC;
|
|
16201
16235
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
16202
16236
|
intentType: t.KeyofC<{
|
|
16203
16237
|
payment: t.LiteralC<"payment">;
|
|
@@ -16259,8 +16293,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16259
16293
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16260
16294
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16261
16295
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16262
|
-
}>, t.
|
|
16263
|
-
memo: t.
|
|
16296
|
+
}>, t.PartialC<{
|
|
16297
|
+
memo: t.StringC;
|
|
16264
16298
|
}>]>, t.TypeC<{
|
|
16265
16299
|
intentType: t.LiteralC<"customTx">;
|
|
16266
16300
|
solInstructions: t.ArrayC<t.TypeC<{
|
|
@@ -16333,8 +16367,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16333
16367
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16334
16368
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16335
16369
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16336
|
-
}>, t.
|
|
16337
|
-
memo: t.
|
|
16370
|
+
}>, t.PartialC<{
|
|
16371
|
+
memo: t.StringC;
|
|
16338
16372
|
}>]>, t.TypeC<{
|
|
16339
16373
|
intentType: t.LiteralC<"deactivate">;
|
|
16340
16374
|
stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
|
|
@@ -16400,8 +16434,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16400
16434
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16401
16435
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16402
16436
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16403
|
-
}>, t.
|
|
16404
|
-
memo: t.
|
|
16437
|
+
}>, t.PartialC<{
|
|
16438
|
+
memo: t.StringC;
|
|
16405
16439
|
}>]>, t.TypeC<{
|
|
16406
16440
|
intentType: t.LiteralC<"delegate">;
|
|
16407
16441
|
validatorAddress: t.StringC;
|
|
@@ -16488,8 +16522,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16488
16522
|
}>]>>;
|
|
16489
16523
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16490
16524
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16491
|
-
}>, t.
|
|
16492
|
-
memo: t.
|
|
16525
|
+
}>, t.PartialC<{
|
|
16526
|
+
memo: t.StringC;
|
|
16493
16527
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
16494
16528
|
intentType: t.KeyofC<{
|
|
16495
16529
|
payment: t.LiteralC<"payment">;
|
|
@@ -16573,8 +16607,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16573
16607
|
isTestTransaction: t.BooleanC;
|
|
16574
16608
|
}>]>]>, t.IntersectionC<[t.PartialC<{
|
|
16575
16609
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16576
|
-
}>, t.
|
|
16577
|
-
memo: t.
|
|
16610
|
+
}>, t.PartialC<{
|
|
16611
|
+
memo: t.StringC;
|
|
16578
16612
|
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
16579
16613
|
intentType: t.KeyofC<{
|
|
16580
16614
|
payment: t.LiteralC<"payment">;
|
|
@@ -16642,8 +16676,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16642
16676
|
intentType: t.LiteralC<"stake">;
|
|
16643
16677
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16644
16678
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16645
|
-
}>, t.
|
|
16646
|
-
memo: t.
|
|
16679
|
+
}>, t.PartialC<{
|
|
16680
|
+
memo: t.StringC;
|
|
16647
16681
|
}>]>, t.TypeC<{
|
|
16648
16682
|
amount: t.TypeC<{
|
|
16649
16683
|
value: t.StringC;
|
|
@@ -16720,8 +16754,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16720
16754
|
intentType: t.LiteralC<"unstake">;
|
|
16721
16755
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16722
16756
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16723
|
-
}>, t.
|
|
16724
|
-
memo: t.
|
|
16757
|
+
}>, t.PartialC<{
|
|
16758
|
+
memo: t.StringC;
|
|
16725
16759
|
}>]>, t.TypeC<{
|
|
16726
16760
|
stakingAddress: t.StringC;
|
|
16727
16761
|
}>, t.PartialC<{
|
|
@@ -16829,8 +16863,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
16829
16863
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16830
16864
|
}>]>, t.IntersectionC<[t.PartialC<{
|
|
16831
16865
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
16832
|
-
}>, t.
|
|
16833
|
-
memo: t.
|
|
16866
|
+
}>, t.PartialC<{
|
|
16867
|
+
memo: t.StringC;
|
|
16834
16868
|
}>]>, t.TypeC<{
|
|
16835
16869
|
intentType: t.LiteralC<"customTx">;
|
|
16836
16870
|
solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
|
|
@@ -21353,6 +21387,9 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
21353
21387
|
ecdsaMPCv2Round1: number;
|
|
21354
21388
|
ecdsaMPCv2Round2: number;
|
|
21355
21389
|
ecdsaMPCv2Round3: number;
|
|
21390
|
+
eddsaMPCv2Round1: number;
|
|
21391
|
+
eddsaMPCv2Round2: number;
|
|
21392
|
+
eddsaMPCv2Round3: number;
|
|
21356
21393
|
readyToCombineShares: number;
|
|
21357
21394
|
signed: number;
|
|
21358
21395
|
held: number;
|
|
@@ -21456,6 +21493,9 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
|
|
|
21456
21493
|
ecdsaMPCv2Round1: number;
|
|
21457
21494
|
ecdsaMPCv2Round2: number;
|
|
21458
21495
|
ecdsaMPCv2Round3: number;
|
|
21496
|
+
eddsaMPCv2Round1: number;
|
|
21497
|
+
eddsaMPCv2Round2: number;
|
|
21498
|
+
eddsaMPCv2Round3: number;
|
|
21459
21499
|
readyToCombineShares: number;
|
|
21460
21500
|
signed: number;
|
|
21461
21501
|
held: number;
|
|
@@ -8,6 +8,9 @@ export declare const TransactionState: t.KeyofC<{
|
|
|
8
8
|
ecdsaMPCv2Round1: number;
|
|
9
9
|
ecdsaMPCv2Round2: number;
|
|
10
10
|
ecdsaMPCv2Round3: number;
|
|
11
|
+
eddsaMPCv2Round1: number;
|
|
12
|
+
eddsaMPCv2Round2: number;
|
|
13
|
+
eddsaMPCv2Round3: number;
|
|
11
14
|
readyToCombineShares: number;
|
|
12
15
|
signed: number;
|
|
13
16
|
held: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionState.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAOd,QAAA,gBAAgB,GAAG,CAAC,CAAC,KAAK,CACrC;IACE,WAAW,EAAE,CAAC;IACd,gBAAgB,EAAE,CAAC;IACnB,sBAAsB,EAAE,CAAC;IACzB,kBAAkB,EAAE,CAAC;IACrB,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,oBAAoB,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,CAAC;IACZ,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC;CACZ,EACD,kBAAkB,CACnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"transactionState.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionState.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAOd,QAAA,gBAAgB,GAAG,CAAC,CAAC,KAAK,CACrC;IACE,WAAW,EAAE,CAAC;IACd,gBAAgB,EAAE,CAAC;IACnB,sBAAsB,EAAE,CAAC;IACzB,kBAAkB,EAAE,CAAC;IACrB,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,CAAC;IACnB,oBAAoB,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,CAAC;IACZ,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC;CACZ,EACD,kBAAkB,CACnB,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare const AddWalletWebhookRequestBody: {
|
|
|
7
7
|
allToken: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
|
|
8
8
|
listenToFailureStates: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
|
|
9
9
|
txRequestStates: t.UnionC<[t.Type<("initialized" | "signed" | "delivered" | "rejected" | "pendingApproval" | "canceled" | "pendingDelivery" | "pendingUserSignature" | "pendingUserCommitment" | "pendingUserRShare" | "pendingUserGShare" | "readyToSend" | "failed")[], ("initialized" | "signed" | "delivered" | "rejected" | "pendingApproval" | "canceled" | "pendingDelivery" | "pendingUserSignature" | "pendingUserCommitment" | "pendingUserRShare" | "pendingUserGShare" | "readyToSend" | "failed")[], unknown>, t.UndefinedC]>;
|
|
10
|
-
txRequestTransactionStates: t.UnionC<[t.Type<("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], ("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], unknown>, t.UndefinedC]>;
|
|
10
|
+
txRequestTransactionStates: t.UnionC<[t.Type<("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "eddsaMPCv2Round1" | "eddsaMPCv2Round2" | "eddsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], ("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "eddsaMPCv2Round1" | "eddsaMPCv2Round2" | "eddsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], unknown>, t.UndefinedC]>;
|
|
11
11
|
customHttpHeaders: t.UnionC<[t.Type<{
|
|
12
12
|
[x: string]: string;
|
|
13
13
|
}, {
|
|
@@ -22,7 +22,7 @@ export declare const AddWalletWebhookRequestBodyC: t.TypeC<{
|
|
|
22
22
|
allToken: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
|
|
23
23
|
listenToFailureStates: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
|
|
24
24
|
txRequestStates: t.UnionC<[t.Type<("initialized" | "signed" | "delivered" | "rejected" | "pendingApproval" | "canceled" | "pendingDelivery" | "pendingUserSignature" | "pendingUserCommitment" | "pendingUserRShare" | "pendingUserGShare" | "readyToSend" | "failed")[], ("initialized" | "signed" | "delivered" | "rejected" | "pendingApproval" | "canceled" | "pendingDelivery" | "pendingUserSignature" | "pendingUserCommitment" | "pendingUserRShare" | "pendingUserGShare" | "readyToSend" | "failed")[], unknown>, t.UndefinedC]>;
|
|
25
|
-
txRequestTransactionStates: t.UnionC<[t.Type<("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], ("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], unknown>, t.UndefinedC]>;
|
|
25
|
+
txRequestTransactionStates: t.UnionC<[t.Type<("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "eddsaMPCv2Round1" | "eddsaMPCv2Round2" | "eddsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], ("initialized" | "pendingSignature" | "eddsaPendingCommitment" | "eddsaPendingRShare" | "eddsaPendingGShare" | "ecdsaMPCv2Round1" | "ecdsaMPCv2Round2" | "ecdsaMPCv2Round3" | "eddsaMPCv2Round1" | "eddsaMPCv2Round2" | "eddsaMPCv2Round3" | "readyToCombineShares" | "signed" | "held" | "delivered" | "invalidSignature" | "rejected")[], unknown>, t.UndefinedC]>;
|
|
26
26
|
customHttpHeaders: t.UnionC<[t.Type<{
|
|
27
27
|
[x: string]: string;
|
|
28
28
|
}, {
|
|
@@ -67,6 +67,9 @@ export declare const ListEnterpriseWebhooksResponse: t.IntersectionC<[t.TypeC<{
|
|
|
67
67
|
ecdsaMPCv2Round1: number;
|
|
68
68
|
ecdsaMPCv2Round2: number;
|
|
69
69
|
ecdsaMPCv2Round3: number;
|
|
70
|
+
eddsaMPCv2Round1: number;
|
|
71
|
+
eddsaMPCv2Round2: number;
|
|
72
|
+
eddsaMPCv2Round3: number;
|
|
70
73
|
readyToCombineShares: number;
|
|
71
74
|
signed: number;
|
|
72
75
|
held: number;
|
|
@@ -67,6 +67,9 @@ export declare const ListOrganizationWebhooksResponse: t.IntersectionC<[t.TypeC<
|
|
|
67
67
|
ecdsaMPCv2Round1: number;
|
|
68
68
|
ecdsaMPCv2Round2: number;
|
|
69
69
|
ecdsaMPCv2Round3: number;
|
|
70
|
+
eddsaMPCv2Round1: number;
|
|
71
|
+
eddsaMPCv2Round2: number;
|
|
72
|
+
eddsaMPCv2Round3: number;
|
|
70
73
|
readyToCombineShares: number;
|
|
71
74
|
signed: number;
|
|
72
75
|
held: number;
|
|
@@ -44,6 +44,9 @@ export declare const Webhook: t.IntersectionC<[t.TypeC<{
|
|
|
44
44
|
ecdsaMPCv2Round1: number;
|
|
45
45
|
ecdsaMPCv2Round2: number;
|
|
46
46
|
ecdsaMPCv2Round3: number;
|
|
47
|
+
eddsaMPCv2Round1: number;
|
|
48
|
+
eddsaMPCv2Round2: number;
|
|
49
|
+
eddsaMPCv2Round3: number;
|
|
47
50
|
readyToCombineShares: number;
|
|
48
51
|
signed: number;
|
|
49
52
|
held: number;
|
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAssetsFromIntent = getAssetsFromIntent;
|
|
4
4
|
const Either_1 = require("fp-ts/lib/Either");
|
|
5
5
|
const baseIntent_1 = require("../schema/transactionRequest/intents/baseIntent");
|
|
6
|
+
const intentType_1 = require("../schema/transactionRequest/intents/intentType");
|
|
7
|
+
const INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET = new Set([
|
|
8
|
+
intentType_1.intentTypes.closeAssociatedTokenAccount.value,
|
|
9
|
+
]);
|
|
6
10
|
function getAssetsFromIntent(intent) {
|
|
7
11
|
if (!intent || typeof intent !== "object") {
|
|
8
12
|
return [];
|
|
@@ -10,10 +14,15 @@ function getAssetsFromIntent(intent) {
|
|
|
10
14
|
const assetStrings = new Set();
|
|
11
15
|
const recipientsDecoded = baseIntent_1.BaseIntentWithRecipients.decode(intent);
|
|
12
16
|
if ((0, Either_1.isRight)(recipientsDecoded)) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const intentType = intent["intentType"];
|
|
18
|
+
const skipRecipientAmountSymbol = typeof intentType === "string" &&
|
|
19
|
+
INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET.has(intentType);
|
|
20
|
+
if (!skipRecipientAmountSymbol) {
|
|
21
|
+
const data = recipientsDecoded.right;
|
|
22
|
+
for (const recipient of data.recipients) {
|
|
23
|
+
if (recipient.amount?.symbol) {
|
|
24
|
+
assetStrings.add(recipient.amount.symbol);
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
}
|
|
19
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAssetsFromIntent.js","sourceRoot":"","sources":["../../../src/utils/getAssetsFromIntent.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getAssetsFromIntent.js","sourceRoot":"","sources":["../../../src/utils/getAssetsFromIntent.ts"],"names":[],"mappings":";;AAmCA,kDA8DC;AAjGD,6CAA2C;AAC3C,gFAKyD;AACzD,gFAA8E;AAQ9E,MAAM,kDAAkD,GAAG,IAAI,GAAG,CAAS;IACzE,wBAAW,CAAC,2BAA2B,CAAC,KAAK;CAC9C,CAAC,CAAC;AAkBH,SAAgB,mBAAmB,CAAC,MAAe;IACjD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAKvC,MAAM,iBAAiB,GAAG,qCAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAI,MAAkC,CAAC,YAAY,CAAC,CAAC;QACrE,MAAM,yBAAyB,GAC7B,OAAO,UAAU,KAAK,QAAQ;YAC9B,kDAAkD,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC;YACrC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACxC,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;oBAC7B,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC;gBACnC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAKD,MAAM,aAAa,GAAG,iCAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,IAAA,gBAAO,EAAC,aAAa,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { EddsaMPCv2SignedMessage } from "../common";
|
|
3
|
+
import { MPCv2SignatureShareBase } from "./signingRound";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* EdDSA MPCv2 — User to BitGo round 1
|
|
7
|
+
*
|
|
8
|
+
* User sends their first signing message (PGP-signed base64 WASM bytes).
|
|
9
|
+
* EdDSA uses EddsaMPCv2SignedMessage.
|
|
10
|
+
*/
|
|
11
|
+
export const EddsaMPCv2SignatureShareRound1Input = t.intersection([
|
|
12
|
+
MPCv2SignatureShareBase,
|
|
13
|
+
t.type(
|
|
14
|
+
{
|
|
15
|
+
type: t.literal("round1Input"),
|
|
16
|
+
data: t.type({
|
|
17
|
+
msg1: EddsaMPCv2SignedMessage,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
"EddsaMPCv2SignatureShareRound1Input",
|
|
21
|
+
),
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export type EddsaMPCv2SignatureShareRound1Input = t.TypeOf<
|
|
25
|
+
typeof EddsaMPCv2SignatureShareRound1Input
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* EdDSA MPCv2 — BitGo to User round 1
|
|
30
|
+
*
|
|
31
|
+
* BitGo returns its first signing message.
|
|
32
|
+
* Unlike ECDSA which returns msg1 + msg2, EdDSA round 1 returns only msg1.
|
|
33
|
+
*/
|
|
34
|
+
export const EddsaMPCv2SignatureShareRound1Output = t.intersection([
|
|
35
|
+
MPCv2SignatureShareBase,
|
|
36
|
+
t.type(
|
|
37
|
+
{
|
|
38
|
+
type: t.literal("round1Output"),
|
|
39
|
+
data: t.type({
|
|
40
|
+
msg1: EddsaMPCv2SignedMessage,
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
"EddsaMPCv2SignatureShareRound1Output",
|
|
44
|
+
),
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
export type EddsaMPCv2SignatureShareRound1Output = t.TypeOf<
|
|
48
|
+
typeof EddsaMPCv2SignatureShareRound1Output
|
|
49
|
+
>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* EdDSA MPCv2 — User to BitGo round 2
|
|
53
|
+
*
|
|
54
|
+
* User sends their second signing message.
|
|
55
|
+
* Unlike ECDSA which sends msg2 + msg3, EdDSA round 2 sends only msg2.
|
|
56
|
+
*/
|
|
57
|
+
export const EddsaMPCv2SignatureShareRound2Input = t.intersection([
|
|
58
|
+
MPCv2SignatureShareBase,
|
|
59
|
+
t.type(
|
|
60
|
+
{
|
|
61
|
+
type: t.literal("round2Input"),
|
|
62
|
+
data: t.type({
|
|
63
|
+
msg2: EddsaMPCv2SignedMessage,
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
"EddsaMPCv2SignatureShareRound2Input",
|
|
67
|
+
),
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
export type EddsaMPCv2SignatureShareRound2Input = t.TypeOf<
|
|
71
|
+
typeof EddsaMPCv2SignatureShareRound2Input
|
|
72
|
+
>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* EdDSA MPCv2 — BitGo to User round 2
|
|
76
|
+
*
|
|
77
|
+
* BitGo returns its second signing message.
|
|
78
|
+
* Unlike ECDSA which returns msg3, EdDSA round 2 returns msg2.
|
|
79
|
+
*/
|
|
80
|
+
export const EddsaMPCv2SignatureShareRound2Output = t.intersection([
|
|
81
|
+
MPCv2SignatureShareBase,
|
|
82
|
+
t.type(
|
|
83
|
+
{
|
|
84
|
+
type: t.literal("round2Output"),
|
|
85
|
+
data: t.type({
|
|
86
|
+
msg2: EddsaMPCv2SignedMessage,
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
"EddsaMPCv2SignatureShareRound2Output",
|
|
90
|
+
),
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
export type EddsaMPCv2SignatureShareRound2Output = t.TypeOf<
|
|
94
|
+
typeof EddsaMPCv2SignatureShareRound2Output
|
|
95
|
+
>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* EdDSA MPCv2 — User to BitGo round 3
|
|
99
|
+
*
|
|
100
|
+
* User sends their third signing message.
|
|
101
|
+
*/
|
|
102
|
+
export const EddsaMPCv2SignatureShareRound3Input = t.intersection([
|
|
103
|
+
MPCv2SignatureShareBase,
|
|
104
|
+
t.type(
|
|
105
|
+
{
|
|
106
|
+
type: t.literal("round3Input"),
|
|
107
|
+
data: t.type({
|
|
108
|
+
msg3: EddsaMPCv2SignedMessage,
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
"EddsaMPCv2SignatureShareRound3Input",
|
|
112
|
+
),
|
|
113
|
+
]);
|
|
114
|
+
|
|
115
|
+
export type EddsaMPCv2SignatureShareRound3Input = t.TypeOf<
|
|
116
|
+
typeof EddsaMPCv2SignatureShareRound3Input
|
|
117
|
+
>;
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import { optionalString } from "../../../utils";
|
|
3
2
|
import { AccountBaseBuildOptions } from "./accountBaseBuildOptions";
|
|
4
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Solana build fragment intersected by **every** Sol intent codec that composes
|
|
6
|
+
* `SolBuildOptions` (e.g. payment, stake, consolidate, close-ATA, etc.).
|
|
7
|
+
*
|
|
8
|
+
* **`memo` change is a wire-format alignment, not a type-narrowing change.**
|
|
9
|
+
* Switching from `t.type({ memo: optionalString })` to
|
|
10
|
+
* `t.partial({ memo: t.string })` lets the **key be omitted** on the wire — real
|
|
11
|
+
* prebuild payloads frequently leave `memo` out, and the previous `t.type` form
|
|
12
|
+
* required the key for `.is()` even when the value would have been `undefined`.
|
|
13
|
+
* When `memo` is present, the value is validated as a `string`; if a caller
|
|
14
|
+
* passes `memo: undefined`, `t.partial` does not run the inner codec (the key
|
|
15
|
+
* is treated as absent), so runtime stays compatible with spreads.
|
|
16
|
+
*
|
|
17
|
+
* Inferred TS types are effectively unchanged: optional-key inference for
|
|
18
|
+
* `t.partial` already produces `memo?: string | undefined`, the same shape
|
|
19
|
+
* `t.TypeOf` would have given with `optionalString`. Package-wide Solana intent
|
|
20
|
+
* fix, not limited to close-ATA.
|
|
21
|
+
*/
|
|
5
22
|
export const SolBuildOptions = t.intersection([
|
|
6
23
|
AccountBaseBuildOptions,
|
|
7
|
-
t.
|
|
8
|
-
memo:
|
|
24
|
+
t.partial({
|
|
25
|
+
memo: t.string,
|
|
9
26
|
}),
|
|
10
27
|
]);
|
|
11
28
|
|