Skip to content

Commit

Permalink
fix: Offchain auth ei.data undefined (#360)
Browse files Browse the repository at this point in the history
* fix: Offchain auth ei.data undefined

* Create ten-maps-travel.md

---------

Co-authored-by: rrr523 <59029880+rrr523@users.noreply.github.com>
  • Loading branch information
aiden-cao and rrr523 authored Oct 10, 2023
1 parent b587a14 commit 9f7feb5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-maps-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/greenfield-js-sdk": patch
---

fix: Offchain auth ei.data undefined
26 changes: 14 additions & 12 deletions packages/js-sdk/src/offchainauth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,20 @@ export const updateSpsPubKey = async ({
expireDate,
authorization,
}: IUpdateSpsPubKeyParams) => {
return sps.map((sp: ISp) =>
Promise.race([
updateUserAccountKey({
address,
domain,
sp,
pubKey,
expireDate,
authorization,
}),
delay(3000, { code: -1, data: { address } }),
]),
return Promise.all(
sps.map((sp: ISp) =>
Promise.race([
updateUserAccountKey({
address,
domain,
sp,
pubKey,
expireDate,
authorization,
}),
delay(3000, { code: -1, data: { address } }),
]),
),
);
};

Expand Down

0 comments on commit 9f7feb5

Please sign in to comment.