Skip to content

Commit

Permalink
chore: disable sign on audit.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardo2016x committed Sep 10, 2024
1 parent a8dea5d commit 28a1dfc
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions apps/mobile/src/core/request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OpenApiService } from '@rabby-wallet/rabby-api';
import { RabbyApiPlugin } from '@rabby-wallet/rabby-api/dist/plugins/intf';

import * as Sign from '@debank/rabby-rn-security/es/sign-rn-rabby';
// import * as Sign from '@debank/rabby-rn-security/es/sign-rn-rabby';
import { APP_VERSIONS } from '@/constant';

const SIGN_HDS = [
Expand All @@ -13,15 +13,14 @@ const SIGN_HDS = [

export const SignApiPlugin: RabbyApiPlugin = {
async onSignRequest(ctx) {
const { parsed, axiosRequestConfig: config } = ctx;
const { method, url, params } = parsed;
const res = Sign.cattleGenerateSignature(params, method as any, url);

config.headers = config.headers || {};
config.headers[SIGN_HDS[0]] = encodeURIComponent(res.ts);
config.headers[SIGN_HDS[1]] = encodeURIComponent(res.nonce);
config.headers[SIGN_HDS[2]] = encodeURIComponent(res.version);
config.headers[SIGN_HDS[3]] = encodeURIComponent(res.signature);
// const { parsed, axiosRequestConfig: config } = ctx;
// const { method, url, params } = parsed;
// const res = Sign.cattleGenerateSignature(params, method as any, url);
// config.headers = config.headers || {};
// config.headers[SIGN_HDS[0]] = encodeURIComponent(res.ts);
// config.headers[SIGN_HDS[1]] = encodeURIComponent(res.nonce);
// config.headers[SIGN_HDS[2]] = encodeURIComponent(res.version);
// config.headers[SIGN_HDS[3]] = encodeURIComponent(res.signature);
},
};

Expand Down

0 comments on commit 28a1dfc

Please sign in to comment.