Skip to content

Commit

Permalink
feat: Preview Api
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Mar 12, 2024
1 parent 98ee8e5 commit ccbb023
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-dragons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bnb-chain/greenfield-js-sdk': patch
---

feat: ed25519 support preview api
3 changes: 2 additions & 1 deletion examples/nextjs/src/components/object/info/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ export const ObjectInfo = () => {
objectName,
queryMap: {
view: '1',
'X-Gnfd-App-Reg-Public-Key': offChainData.keypairs.publicKey,
'X-Gnfd-User-Address': address,
'X-Gnfd-App-Domain': window.location.origin,
'X-Gnfd-Expiry-Timestamp': '2023-09-03T09%3A23%3A39Z',
'X-Gnfd-Expiry-Timestamp': '2024-03-12T09:39:22Z',
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/js-sdk/src/api/offchainauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export class OffChainAuth implements IOffChainAuth {
code: 0,
body: {
seedString: hexlify(privateKey),
keypars: {
privateKey: hexlify(privateKey),
publicKey: hexlify(publicKey),
keypairs: {
privateKey: hexlify(privateKey).slice(2),
publicKey: hexlify(publicKey).slice(2),
},
expirationTime,
spAddresses: successSps,
Expand Down
7 changes: 5 additions & 2 deletions packages/js-sdk/src/types/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ export interface IGenOffChainAuthKeyPairAndUpload extends IBaseUser {

export interface IReturnOffChainAuthKeyPairAndUpload {
/**
* compatibility: private key
* compatibility for old version: private key
*/
seedString: string;
keypars: {
/**
* public key and private key without prefix `0x`
*/
keypairs: {
privateKey: string;
publicKey: string;
};
Expand Down

0 comments on commit ccbb023

Please sign in to comment.