@kodiak-finance/orderly-core 2.9.2 → 2.9.3
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/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6286,11 +6286,11 @@ var _Account = class _Account {
|
|
|
6286
6286
|
return nextState;
|
|
6287
6287
|
}
|
|
6288
6288
|
async createAccount() {
|
|
6289
|
-
const { nonce, timestamp } = await this._getRegisterationNonce();
|
|
6290
6289
|
const address = this.stateValue.address;
|
|
6291
6290
|
if (!address) {
|
|
6292
6291
|
throw new Error("address is undefined");
|
|
6293
6292
|
}
|
|
6293
|
+
const { nonce, timestamp } = await this._getRegisterationNonce(address);
|
|
6294
6294
|
const { message, signatured } = await this.walletAdapterManager.adapter.generateRegisterAccountMessage({
|
|
6295
6295
|
registrationNonce: nonce,
|
|
6296
6296
|
// chainId: this.walletClient.chainId,
|
|
@@ -6733,6 +6733,7 @@ var _Account = class _Account {
|
|
|
6733
6733
|
}
|
|
6734
6734
|
async disconnect() {
|
|
6735
6735
|
if (!!this.stateValue.address) {
|
|
6736
|
+
this.keyStore.removeAddress();
|
|
6736
6737
|
this.additionalInfoRepository.clear(this.stateValue.address);
|
|
6737
6738
|
}
|
|
6738
6739
|
const nextState = {
|
|
@@ -6785,12 +6786,15 @@ var _Account = class _Account {
|
|
|
6785
6786
|
get walletAdapter() {
|
|
6786
6787
|
return this.walletAdapterManager.adapter;
|
|
6787
6788
|
}
|
|
6788
|
-
async _getRegisterationNonce() {
|
|
6789
|
-
const res = await this._simpleFetch(
|
|
6790
|
-
|
|
6791
|
-
|
|
6789
|
+
async _getRegisterationNonce(address) {
|
|
6790
|
+
const res = await this._simpleFetch(
|
|
6791
|
+
`/v1/registration_nonce?address=${encodeURIComponent(address)}`,
|
|
6792
|
+
{
|
|
6793
|
+
headers: {
|
|
6794
|
+
"orderly-account-id": this.stateValue.accountId
|
|
6795
|
+
}
|
|
6792
6796
|
}
|
|
6793
|
-
|
|
6797
|
+
);
|
|
6794
6798
|
if (res.success) {
|
|
6795
6799
|
return {
|
|
6796
6800
|
nonce: res.data?.registration_nonce,
|