diff --git a/.changeset/wet-dragons-obey.md b/.changeset/wet-dragons-obey.md new file mode 100644 index 00000000..1c995388 --- /dev/null +++ b/.changeset/wet-dragons-obey.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/greenfield-js-sdk': patch +--- + +feat: ed25519 support preview api diff --git a/examples/nextjs/src/components/object/info/index.tsx b/examples/nextjs/src/components/object/info/index.tsx index 1205bedc..e093f816 100644 --- a/examples/nextjs/src/components/object/info/index.tsx +++ b/examples/nextjs/src/components/object/info/index.tsx @@ -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', }, }, { diff --git a/packages/js-sdk/src/api/offchainauth.ts b/packages/js-sdk/src/api/offchainauth.ts index 01b8e58b..ab4a4ca2 100644 --- a/packages/js-sdk/src/api/offchainauth.ts +++ b/packages/js-sdk/src/api/offchainauth.ts @@ -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, diff --git a/packages/js-sdk/src/types/storage.ts b/packages/js-sdk/src/types/storage.ts index 012246d5..67b5e4e6 100644 --- a/packages/js-sdk/src/types/storage.ts +++ b/packages/js-sdk/src/types/storage.ts @@ -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; };