@rabby-wallet/rabby-api 0.9.58-alpha-1 → 0.9.58-alpha-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.d.ts CHANGED
@@ -44,6 +44,23 @@ declare type GnosisSafeTxGasOptions = GnosisSafeRequestOptions & {
44
44
  operation?: number;
45
45
  };
46
46
  };
47
+ declare type GnosisGetSafeMessagesOptions = GnosisSafeRequestOptions & {
48
+ options?: Record<string, any>;
49
+ };
50
+ declare type GnosisAddSafeMessageOptions = GnosisSafeRequestOptions & {
51
+ data: {
52
+ message: string | Record<string, any>;
53
+ signature: string;
54
+ safeAppId?: number;
55
+ };
56
+ };
57
+ declare type GnosisGetSafeMessageOptions = GnosisRequestOptions & {
58
+ messageHash: string;
59
+ };
60
+ declare type GnosisAddSafeMessageSignatureOptions = GnosisRequestOptions & {
61
+ messageHash: string;
62
+ signature: string;
63
+ };
47
64
  export declare class OpenApiService {
48
65
  #private;
49
66
  store: OpenApiStore;
@@ -75,6 +92,12 @@ export declare class OpenApiService {
75
92
  getSafeInfo: ({ txServiceUrl, safeAddress, }: GnosisSafeRequestOptions) => Promise<any>;
76
93
  confirmSafeTransaction: ({ txServiceUrl, safeTransactionHash, data, }: GnosisConfirmTransactionOptions) => Promise<void>;
77
94
  getSafeTxGas: ({ txServiceUrl, safeAddress, safeTxData, }: GnosisSafeTxGasOptions) => Promise<string | undefined>;
95
+ getSafeMessages: ({ txServiceUrl, safeAddress, options, }: GnosisGetSafeMessagesOptions) => Promise<{
96
+ results: any[];
97
+ }>;
98
+ addSafeMessage: ({ txServiceUrl, safeAddress, data, }: GnosisAddSafeMessageOptions) => Promise<void>;
99
+ getSafeMessage: ({ txServiceUrl, messageHash, }: GnosisGetSafeMessageOptions) => Promise<any>;
100
+ addSafeMessageSignature: ({ txServiceUrl, messageHash, signature, }: GnosisAddSafeMessageSignatureOptions) => Promise<void>;
78
101
  asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
79
102
  retryDelay?: number;
80
103
  }) => Promise<T>;
package/dist/index.js CHANGED
@@ -117,6 +117,24 @@ export class OpenApiService {
117
117
  });
118
118
  return data === null || data === void 0 ? void 0 : data.safeTxGas;
119
119
  });
120
+ this.getSafeMessages = ({ txServiceUrl, safeAddress, options, }) => __awaiter(this, void 0, void 0, function* () {
121
+ const { data } = yield this.request.get(`${txServiceUrl}/v1/safes/${safeAddress}/messages/`, {
122
+ params: options,
123
+ });
124
+ return data;
125
+ });
126
+ this.addSafeMessage = ({ txServiceUrl, safeAddress, data, }) => __awaiter(this, void 0, void 0, function* () {
127
+ yield this.request.post(`${txServiceUrl}/v1/safes/${safeAddress}/messages/`, data);
128
+ });
129
+ this.getSafeMessage = ({ txServiceUrl, messageHash, }) => __awaiter(this, void 0, void 0, function* () {
130
+ const { data } = yield this.request.get(`${txServiceUrl}/v1/messages/${messageHash}/`);
131
+ return data;
132
+ });
133
+ this.addSafeMessageSignature = ({ txServiceUrl, messageHash, signature, }) => __awaiter(this, void 0, void 0, function* () {
134
+ yield this.request.post(`${txServiceUrl}/v1/messages/${messageHash}/signatures/`, {
135
+ signature,
136
+ });
137
+ });
120
138
  this.asyncJob = (url, options) => {
121
139
  const _option = Object.assign({ timeout: ASYNC_JOB_TIMEOUT, retryDelay: ASYNC_JOB_RETRY_DELAY }, options);
122
140
  const startTime = +new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.58-alpha-1",
3
+ "version": "0.9.58-alpha-3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [