@megaeth-labs/wallet-sdk 0.1.4 → 0.1.6

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.cjs CHANGED
@@ -61,6 +61,8 @@ var getWalletUrl = (config) => {
61
61
  const params = [
62
62
  `network=${config.network}`,
63
63
  ...config.sponsorUrl ? [`sponsorUrl=${config.sponsorUrl}`] : [],
64
+ ...config.sponsorMode ? [`sponsorMode=${config.sponsorMode}`] : [],
65
+ ...config.sponsorToken ? [`sponsorToken=${config.sponsorToken}`] : [],
64
66
  ...config.debug ? [`debug=${config.debug}`] : [],
65
67
  ...config.logging ? [`logging=${config.logging}`] : []
66
68
  ];
package/dist/index.d.cts CHANGED
@@ -1,11 +1,15 @@
1
1
  type Network = 'mainnet' | 'testnet';
2
2
  type LogLevel = 'debug' | 'info' | 'warn' | 'error';
3
+ type SponsorMode = 'everything' | 'app-only' | 'explicit';
4
+ type SponsorToken = 'native' | 'usdm';
3
5
  interface Config {
4
6
  network: Network;
5
7
  logging?: LogLevel;
6
8
  devMode?: boolean;
7
9
  debug?: boolean;
8
10
  sponsorUrl?: string;
11
+ sponsorMode?: SponsorMode;
12
+ sponsorToken?: SponsorToken;
9
13
  }
10
14
  type ConnectionStatus = {
11
15
  status: 'connected' | 'disconnected' | 'cancelled';
@@ -17,14 +21,17 @@ interface TransferRequest {
17
21
  type: 'native' | 'erc20' | 'erc721' | 'erc1155';
18
22
  contractAddress?: string;
19
23
  tokenId?: number;
24
+ sponsor?: boolean;
20
25
  }
21
26
  interface CallContractRequest {
22
27
  address: `0x${string}`;
23
- abi: any;
24
- functionName: string;
25
- args: any[];
28
+ abi?: any;
29
+ functionName?: string;
30
+ args?: any[];
31
+ data?: `0x${string}`;
26
32
  silent?: boolean;
27
33
  value?: bigint | string;
34
+ sponsor?: boolean;
28
35
  }
29
36
  interface GetFromContractRequest {
30
37
  address: `0x${string}`;
@@ -99,6 +106,7 @@ interface Permission {
99
106
  interface GrantPermissionsRequest {
100
107
  permissions: Permission;
101
108
  externalAddress?: `0x${string}`;
109
+ sponsor?: boolean;
102
110
  }
103
111
  type GrantPermissionsResponse = {
104
112
  status: 'approved' | 'cancelled';
@@ -154,4 +162,4 @@ declare const mega: {
154
162
  };
155
163
  };
156
164
 
157
- export { type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type TransactionResult, type TransferRequest, mega };
165
+ export { type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type TransactionResult, type TransferRequest, mega };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  type Network = 'mainnet' | 'testnet';
2
2
  type LogLevel = 'debug' | 'info' | 'warn' | 'error';
3
+ type SponsorMode = 'everything' | 'app-only' | 'explicit';
4
+ type SponsorToken = 'native' | 'usdm';
3
5
  interface Config {
4
6
  network: Network;
5
7
  logging?: LogLevel;
6
8
  devMode?: boolean;
7
9
  debug?: boolean;
8
10
  sponsorUrl?: string;
11
+ sponsorMode?: SponsorMode;
12
+ sponsorToken?: SponsorToken;
9
13
  }
10
14
  type ConnectionStatus = {
11
15
  status: 'connected' | 'disconnected' | 'cancelled';
@@ -17,14 +21,17 @@ interface TransferRequest {
17
21
  type: 'native' | 'erc20' | 'erc721' | 'erc1155';
18
22
  contractAddress?: string;
19
23
  tokenId?: number;
24
+ sponsor?: boolean;
20
25
  }
21
26
  interface CallContractRequest {
22
27
  address: `0x${string}`;
23
- abi: any;
24
- functionName: string;
25
- args: any[];
28
+ abi?: any;
29
+ functionName?: string;
30
+ args?: any[];
31
+ data?: `0x${string}`;
26
32
  silent?: boolean;
27
33
  value?: bigint | string;
34
+ sponsor?: boolean;
28
35
  }
29
36
  interface GetFromContractRequest {
30
37
  address: `0x${string}`;
@@ -99,6 +106,7 @@ interface Permission {
99
106
  interface GrantPermissionsRequest {
100
107
  permissions: Permission;
101
108
  externalAddress?: `0x${string}`;
109
+ sponsor?: boolean;
102
110
  }
103
111
  type GrantPermissionsResponse = {
104
112
  status: 'approved' | 'cancelled';
@@ -154,4 +162,4 @@ declare const mega: {
154
162
  };
155
163
  };
156
164
 
157
- export { type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type TransactionResult, type TransferRequest, mega };
165
+ export { type BalancesRequest, type BaseTokenResponse, type CallContractRequest, type Config, type ConnectionStatus, type GetFromContractRequest, type GetPermissionsResponse, type GrantPermissionsRequest, type GrantPermissionsResponse, type LogLevel, type Network, type OwnedTokenResponse, type Permission, type RemoteAPI, type SignDataRequest, type SignDataResponse, type SignMessageResponse, type SponsorMode, type SponsorToken, type TransactionResult, type TransferRequest, mega };
package/dist/index.js CHANGED
@@ -25,6 +25,8 @@ var getWalletUrl = (config) => {
25
25
  const params = [
26
26
  `network=${config.network}`,
27
27
  ...config.sponsorUrl ? [`sponsorUrl=${config.sponsorUrl}`] : [],
28
+ ...config.sponsorMode ? [`sponsorMode=${config.sponsorMode}`] : [],
29
+ ...config.sponsorToken ? [`sponsorToken=${config.sponsorToken}`] : [],
28
30
  ...config.debug ? [`debug=${config.debug}`] : [],
29
31
  ...config.logging ? [`logging=${config.logging}`] : []
30
32
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megaeth-labs/wallet-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "MegaETH Wallet SDK for web applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",