@kodiak-finance/orderly-core 2.9.2-alpha.1 → 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 +3 -3
package/dist/index.js
CHANGED
|
@@ -6290,11 +6290,11 @@ var _Account = class _Account {
|
|
|
6290
6290
|
return nextState;
|
|
6291
6291
|
}
|
|
6292
6292
|
async createAccount() {
|
|
6293
|
-
const { nonce, timestamp } = await this._getRegisterationNonce();
|
|
6294
6293
|
const address = this.stateValue.address;
|
|
6295
6294
|
if (!address) {
|
|
6296
6295
|
throw new Error("address is undefined");
|
|
6297
6296
|
}
|
|
6297
|
+
const { nonce, timestamp } = await this._getRegisterationNonce(address);
|
|
6298
6298
|
const { message, signatured } = await this.walletAdapterManager.adapter.generateRegisterAccountMessage({
|
|
6299
6299
|
registrationNonce: nonce,
|
|
6300
6300
|
// chainId: this.walletClient.chainId,
|
|
@@ -6737,6 +6737,7 @@ var _Account = class _Account {
|
|
|
6737
6737
|
}
|
|
6738
6738
|
async disconnect() {
|
|
6739
6739
|
if (!!this.stateValue.address) {
|
|
6740
|
+
this.keyStore.removeAddress();
|
|
6740
6741
|
this.additionalInfoRepository.clear(this.stateValue.address);
|
|
6741
6742
|
}
|
|
6742
6743
|
const nextState = {
|
|
@@ -6789,12 +6790,15 @@ var _Account = class _Account {
|
|
|
6789
6790
|
get walletAdapter() {
|
|
6790
6791
|
return this.walletAdapterManager.adapter;
|
|
6791
6792
|
}
|
|
6792
|
-
async _getRegisterationNonce() {
|
|
6793
|
-
const res = await this._simpleFetch(
|
|
6794
|
-
|
|
6795
|
-
|
|
6793
|
+
async _getRegisterationNonce(address) {
|
|
6794
|
+
const res = await this._simpleFetch(
|
|
6795
|
+
`/v1/registration_nonce?address=${encodeURIComponent(address)}`,
|
|
6796
|
+
{
|
|
6797
|
+
headers: {
|
|
6798
|
+
"orderly-account-id": this.stateValue.accountId
|
|
6799
|
+
}
|
|
6796
6800
|
}
|
|
6797
|
-
|
|
6801
|
+
);
|
|
6798
6802
|
if (res.success) {
|
|
6799
6803
|
return {
|
|
6800
6804
|
nonce: res.data?.registration_nonce,
|