@paradex/sdk 0.5.3 → 0.5.4
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.
|
@@ -50,11 +50,11 @@ export class AccountSupport {
|
|
|
50
50
|
if (this.testClassHash('0x07aeca3456816e3b833506d7cc5c1313d371fbdb0ae95ee70af72a4ddbf42594')) {
|
|
51
51
|
return 'argent-multisig-v0.2.0';
|
|
52
52
|
}
|
|
53
|
-
// https://github.com/myBraavos/braavos-cairo/blob/6efdfd597bb051e99c79a512fccd14ee2523c898/README_MOA.md
|
|
53
|
+
// https://github.com/myBraavos/braavos-account-cairo/blob/6efdfd597bb051e99c79a512fccd14ee2523c898/README_MOA.md
|
|
54
54
|
if (this.testClassHash('0x041bf1e71792aecb9df3e9d04e1540091c5e13122a731e02bec588f71dc1a5c3')) {
|
|
55
55
|
return 'braavos-multi-owner-v1.0.0';
|
|
56
56
|
}
|
|
57
|
-
// https://github.com/myBraavos/braavos-cairo/tree/v1.0.0
|
|
57
|
+
// https://github.com/myBraavos/braavos-account-cairo/tree/v1.0.0
|
|
58
58
|
if (this.testClassHash('0x00816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253')) {
|
|
59
59
|
const multiSigThreshold = (await this.contract.call('get_multisig_threshold'));
|
|
60
60
|
if (multiSigThreshold !== 0n) {
|
|
@@ -69,6 +69,23 @@ export class AccountSupport {
|
|
|
69
69
|
return 'braavos-v1.0.0-stark-signer';
|
|
70
70
|
return 'unknown';
|
|
71
71
|
}
|
|
72
|
+
// New Braavos account contract, not available on GitHub
|
|
73
|
+
// Reported to be an upgrade to the previous Braavos account contract
|
|
74
|
+
// https://tradeparadigm.slack.com/archives/C06TRUBLSDB/p1731706968018819?thread_ts=1720108178.898199&cid=C06TRUBLSDB
|
|
75
|
+
if (this.testClassHash('0x02c8c7e6fbcfb3e8e15a46648e8914c6aa1fc506fc1e7fb3d1e19630716174bc')) {
|
|
76
|
+
const multiSigThreshold = (await this.contract.call('get_multisig_threshold'));
|
|
77
|
+
if (multiSigThreshold !== 0n) {
|
|
78
|
+
return 'braavos-v1.1.0-multisig';
|
|
79
|
+
}
|
|
80
|
+
const signers = (await this.contract.call('get_signers'));
|
|
81
|
+
if (signers.secp256r1 != null && signers.secp256r1.length > 0)
|
|
82
|
+
return 'braavos-v1.1.0-strong-signer';
|
|
83
|
+
if (signers.webauthn != null && signers.webauthn.length > 0)
|
|
84
|
+
return 'braavos-v1.1.0-strong-signer';
|
|
85
|
+
if (signers.stark != null && signers.stark.length === 1)
|
|
86
|
+
return 'braavos-v1.1.0-stark-signer';
|
|
87
|
+
return 'unknown';
|
|
88
|
+
}
|
|
72
89
|
return 'unknown';
|
|
73
90
|
}
|
|
74
91
|
async check() {
|
|
@@ -78,6 +95,7 @@ export class AccountSupport {
|
|
|
78
95
|
case 'argent-v0.3.1':
|
|
79
96
|
case 'argent-v0.4.0-starknet-signer':
|
|
80
97
|
case 'braavos-v1.0.0-stark-signer':
|
|
98
|
+
case 'braavos-v1.1.0-stark-signer':
|
|
81
99
|
return { ok: true };
|
|
82
100
|
case 'argent-v0.4.0-secp256k1-signer':
|
|
83
101
|
return {
|
|
@@ -112,11 +130,13 @@ export class AccountSupport {
|
|
|
112
130
|
reason: 'Argent multisig is not supported',
|
|
113
131
|
};
|
|
114
132
|
case 'braavos-v1.0.0-strong-signer':
|
|
133
|
+
case 'braavos-v1.1.0-strong-signer':
|
|
115
134
|
return {
|
|
116
135
|
ok: false,
|
|
117
136
|
reason: 'Braavos strong signer is not supported',
|
|
118
137
|
};
|
|
119
138
|
case 'braavos-v1.0.0-multisig':
|
|
139
|
+
case 'braavos-v1.1.0-multisig':
|
|
120
140
|
return {
|
|
121
141
|
ok: false,
|
|
122
142
|
reason: 'Braavos multisig is not supported',
|
|
@@ -162,7 +182,8 @@ export class AccountSupport {
|
|
|
162
182
|
}
|
|
163
183
|
throw new Error('Unsupported Argent signature');
|
|
164
184
|
}
|
|
165
|
-
case 'braavos-v1.0.0-stark-signer':
|
|
185
|
+
case 'braavos-v1.0.0-stark-signer':
|
|
186
|
+
case 'braavos-v1.1.0-stark-signer': {
|
|
166
187
|
if (segments.length === 2) {
|
|
167
188
|
const [r, _s] = segments;
|
|
168
189
|
if (r == null)
|
|
@@ -186,7 +207,9 @@ export class AccountSupport {
|
|
|
186
207
|
case 'argent-multisig-v0.1.1':
|
|
187
208
|
case 'argent-multisig-v0.2.0':
|
|
188
209
|
case 'braavos-v1.0.0-strong-signer':
|
|
210
|
+
case 'braavos-v1.1.0-strong-signer':
|
|
189
211
|
case 'braavos-v1.0.0-multisig':
|
|
212
|
+
case 'braavos-v1.1.0-multisig':
|
|
190
213
|
case 'braavos-multi-owner-v1.0.0':
|
|
191
214
|
throw new Error(`${this.signatureFormat} is not supported`);
|
|
192
215
|
case 'unknown':
|