@swapper-finance/deposit-sdk 0.0.6 → 0.1.0

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/README.md CHANGED
@@ -231,7 +231,7 @@ modal.close();
231
231
  ```typescript
232
232
  interface ModalStyle {
233
233
  /**
234
- * Modal width (default: '480px')
234
+ * Modal width (default: '450px')
235
235
  */
236
236
  width?: string;
237
237
 
@@ -1 +1 @@
1
- import{SwapperIframe}from"./SwapperIframe";export class SwapperModal{constructor(e){this.iframe=null,this.overlay=null,this.modalContainer=null,this.iframeContainer=null,this.isOpen=!1,this.options=e}open(){this.isOpen||(this.createModal(),this.isOpen=!0)}close(){this.isOpen&&(this.destroyModal(),this.isOpen=!1,this.options.onClose&&this.options.onClose())}isModalOpen(){return this.isOpen}getIframe(){return this.iframe}createModal(){const e=this.options.modalStyle||{};if(this.overlay=document.createElement("div"),this.overlay.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: ${e.overlayColor||"rgba(0, 0, 0, 0.7)"};\n z-index: ${e.zIndex||1e4};\n display: flex;\n align-items: center;\n justify-content: center;\n animation: swapper-fade-in 0.2s ease-out;\n `,!document.getElementById("swapper-modal-styles")){const e=document.createElement("style");e.id="swapper-modal-styles",e.textContent="\n @keyframes swapper-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes swapper-scale-in {\n from {\n transform: scale(0.95);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n ",document.head.appendChild(e)}this.overlay.addEventListener("click",e=>{e.target===this.overlay&&this.close()});const t=e=>{"Escape"===e.key&&(this.close(),document.removeEventListener("keydown",t))};if(document.addEventListener("keydown",t),this.modalContainer=document.createElement("div"),this.modalContainer.style.cssText=`\n position: relative;\n width: ${e.width||"480px"};\n height: ${e.height||"560px"};\n background: transparent;\n border-radius: ${e.borderRadius||"16px"};\n overflow: hidden;\n animation: swapper-scale-in 0.3s ease-out;\n `,!0===e.showCloseButton){const t=document.createElement("button");t.innerHTML="×",t.style.cssText=`\n position: absolute;\n top: 12px;\n right: 12px;\n width: 32px;\n height: 32px;\n border: none;\n background: rgba(0, 0, 0, 0.5);\n color: white;\n font-size: 24px;\n line-height: 1;\n border-radius: 50%;\n cursor: pointer;\n z-index: ${(e.zIndex||1e4)+1};\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s ease;\n `,t.onmouseover=()=>{t.style.background="rgba(0, 0, 0, 0.7)"},t.onmouseout=()=>{t.style.background="rgba(0, 0, 0, 0.5)"},t.onclick=()=>this.close(),this.modalContainer.appendChild(t)}this.iframeContainer=document.createElement("div"),this.iframeContainer.style.cssText="\n width: 100%;\n height: 100%;\n ",this.modalContainer.appendChild(this.iframeContainer),this.overlay.appendChild(this.modalContainer),document.body.appendChild(this.overlay),document.body.style.overflow="hidden",this.iframe=new SwapperIframe({container:this.iframeContainer,integratorId:this.options.integratorId,dstChainId:this.options.dstChainId,dstTokenAddr:this.options.dstTokenAddr,depositWalletAddress:this.options.depositWalletAddress,styles:this.options.styles,customContractCalls:this.options.customContractCalls,supportedDepositOptions:this.options.supportedDepositOptions,webhookUrl:this.options.webhookUrl,iframeUrl:this.options.iframeUrl,iframeAttributes:{...this.options.iframeAttributes,width:"100%",height:"100%"}})}destroyModal(){this.iframe&&(this.iframe.destroy(),this.iframe=null),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.style.overflow="",this.overlay=null,this.modalContainer=null,this.iframeContainer=null}destroy(){this.close()}}export function openSwapperModal(e){const t=new SwapperModal(e);return t.open(),t}
1
+ import{SwapperIframe}from"./SwapperIframe";export class SwapperModal{constructor(e){this.iframe=null,this.overlay=null,this.modalContainer=null,this.iframeContainer=null,this.isOpen=!1,this.options=e}open(){this.isOpen||(this.createModal(),this.isOpen=!0)}close(){this.isOpen&&(this.destroyModal(),this.isOpen=!1,this.options.onClose&&this.options.onClose())}isModalOpen(){return this.isOpen}getIframe(){return this.iframe}createModal(){const e=this.options.modalStyle||{};if(this.overlay=document.createElement("div"),this.overlay.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background: ${e.overlayColor||"rgba(0, 0, 0, 0.7)"};\n z-index: ${e.zIndex||1e4};\n display: flex;\n align-items: center;\n justify-content: center;\n animation: swapper-fade-in 0.2s ease-out;\n `,!document.getElementById("swapper-modal-styles")){const e=document.createElement("style");e.id="swapper-modal-styles",e.textContent="\n @keyframes swapper-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes swapper-scale-in {\n from {\n transform: scale(0.95);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n ",document.head.appendChild(e)}this.overlay.addEventListener("click",e=>{e.target===this.overlay&&this.close()});const t=e=>{"Escape"===e.key&&(this.close(),document.removeEventListener("keydown",t))};if(document.addEventListener("keydown",t),this.modalContainer=document.createElement("div"),this.modalContainer.style.cssText=`\n position: relative;\n width: ${e.width||"450px"};\n height: ${e.height||"560px"};\n background: transparent;\n border-radius: ${e.borderRadius||"16px"};\n overflow: hidden;\n animation: swapper-scale-in 0.3s ease-out;\n `,!0===e.showCloseButton){const t=document.createElement("button");t.innerHTML="×",t.style.cssText=`\n position: absolute;\n top: 12px;\n right: 12px;\n width: 32px;\n height: 32px;\n border: none;\n background: rgba(0, 0, 0, 0.5);\n color: white;\n font-size: 24px;\n line-height: 1;\n border-radius: 50%;\n cursor: pointer;\n z-index: ${(e.zIndex||1e4)+1};\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s ease;\n `,t.onmouseover=()=>{t.style.background="rgba(0, 0, 0, 0.7)"},t.onmouseout=()=>{t.style.background="rgba(0, 0, 0, 0.5)"},t.onclick=()=>this.close(),this.modalContainer.appendChild(t)}this.iframeContainer=document.createElement("div"),this.iframeContainer.style.cssText="\n width: 100%;\n height: 100%;\n ",this.modalContainer.appendChild(this.iframeContainer),this.overlay.appendChild(this.modalContainer),document.body.appendChild(this.overlay),document.body.style.overflow="hidden",this.iframe=new SwapperIframe({container:this.iframeContainer,integratorId:this.options.integratorId,dstChainId:this.options.dstChainId,dstTokenAddr:this.options.dstTokenAddr,depositWalletAddress:this.options.depositWalletAddress,styles:this.options.styles,customContractCalls:this.options.customContractCalls,supportedDepositOptions:this.options.supportedDepositOptions,webhookUrl:this.options.webhookUrl,iframeUrl:this.options.iframeUrl,iframeAttributes:{...this.options.iframeAttributes,width:"100%",height:"100%"}})}destroyModal(){this.iframe&&(this.iframe.destroy(),this.iframe=null),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.style.overflow="",this.overlay=null,this.modalContainer=null,this.iframeContainer=null}destroy(){this.close()}}export function openSwapperModal(e){const t=new SwapperModal(e);return t.open(),t}
@@ -0,0 +1,7 @@
1
+ import { ContractCall } from "./types";
2
+ export declare function approve(tokenAddress: string, spender: string, amount: string): ContractCall;
3
+ export declare function transfer(tokenAddress: string, recipient: string, amount: string): ContractCall;
4
+ export declare function transferFrom(tokenAddress: string, from: string, to: string, amount: string): ContractCall;
5
+ export declare function approveBalance(tokenAddress: string, spender: string): ContractCall;
6
+ export declare function transferBalance(tokenAddress: string, recipient: string): ContractCall;
7
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,SAAS,CAAC;AAoEzD,wBAAgB,OAAO,CACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,YAAY,CAQd;AAUD,wBAAgB,QAAQ,CACtB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,YAAY,CAQd;AAWD,wBAAgB,YAAY,CAC1B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,GACb,YAAY,CAQd;AAaD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,YAAY,CAQd;AASD,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,YAAY,CAQd"}
@@ -0,0 +1,74 @@
1
+ import { ContractCallType } from "./types";
2
+ class ABICoder {
3
+ encodeApprove(spender, amount) {
4
+ const selector = "0x095ea7b3";
5
+ const paddedSpender = spender.slice(2).padStart(64, "0");
6
+ const paddedAmount = BigInt(amount).toString(16).padStart(64, "0");
7
+ return selector + paddedSpender + paddedAmount;
8
+ }
9
+ encodeTransfer(recipient, amount) {
10
+ const selector = "0xa9059cbb";
11
+ const paddedRecipient = recipient.slice(2).padStart(64, "0");
12
+ const paddedAmount = BigInt(amount).toString(16).padStart(64, "0");
13
+ return selector + paddedRecipient + paddedAmount;
14
+ }
15
+ encodeTransferFrom(from, to, amount) {
16
+ const selector = "0x23b872dd";
17
+ const paddedFrom = from.slice(2).padStart(64, "0");
18
+ const paddedTo = to.slice(2).padStart(64, "0");
19
+ const paddedAmount = BigInt(amount).toString(16).padStart(64, "0");
20
+ return selector + paddedFrom + paddedTo + paddedAmount;
21
+ }
22
+ encodeBalancePayload(tokenAddress, balanceSlot) {
23
+ const paddedAddress = tokenAddress.slice(2).padStart(64, "0");
24
+ const paddedSlot = BigInt(balanceSlot).toString(16).padStart(64, "0");
25
+ return "0x" + paddedAddress + paddedSlot;
26
+ }
27
+ }
28
+ const abiCoder = new ABICoder();
29
+ export function approve(tokenAddress, spender, amount) {
30
+ return {
31
+ callType: ContractCallType.DEFAULT,
32
+ target: tokenAddress,
33
+ value: "0",
34
+ callData: abiCoder.encodeApprove(spender, amount),
35
+ payload: "0x",
36
+ };
37
+ }
38
+ export function transfer(tokenAddress, recipient, amount) {
39
+ return {
40
+ callType: ContractCallType.DEFAULT,
41
+ target: tokenAddress,
42
+ value: "0",
43
+ callData: abiCoder.encodeTransfer(recipient, amount),
44
+ payload: "0x",
45
+ };
46
+ }
47
+ export function transferFrom(tokenAddress, from, to, amount) {
48
+ return {
49
+ callType: ContractCallType.DEFAULT,
50
+ target: tokenAddress,
51
+ value: "0",
52
+ callData: abiCoder.encodeTransferFrom(from, to, amount),
53
+ payload: "0x",
54
+ };
55
+ }
56
+ export function approveBalance(tokenAddress, spender) {
57
+ return {
58
+ callType: ContractCallType.FULL_TOKEN_BALANCE,
59
+ target: tokenAddress,
60
+ value: "0",
61
+ callData: abiCoder.encodeApprove(spender, "0"),
62
+ payload: abiCoder.encodeBalancePayload(tokenAddress, "1"),
63
+ };
64
+ }
65
+ export function transferBalance(tokenAddress, recipient) {
66
+ return {
67
+ callType: ContractCallType.FULL_TOKEN_BALANCE,
68
+ target: tokenAddress,
69
+ value: "0",
70
+ callData: abiCoder.encodeTransfer(recipient, "0"),
71
+ payload: abiCoder.encodeBalancePayload(tokenAddress, "1"),
72
+ };
73
+ }
74
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKzD,MAAM,QAAQ;IAIZ,aAAa,CAAC,OAAe,EAAE,MAAc;QAG3C,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC9B,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACzD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,QAAQ,GAAG,aAAa,GAAG,YAAY,CAAC;IACjD,CAAC;IAKD,cAAc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AAe,CAC7B,YAAoB,EACpB,SAAiB;IAEjB,OAAO;QACL,QAAQ,EAAE,gBAAgB,CAAC,kBAAkB;QAC7C,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,CAAC;QACjD,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,YAAY,EAAE,GAAG,CAAC;KAC1D,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { SwapperIframe } from "./SwapperIframe";
2
2
  export { SwapperModal, openSwapperModal } from "./SwapperModal";
3
3
  export type { SwapperModalOptions } from "./SwapperModal";
4
- export { ThemeMode, BrandTheme, ComponentStyles, SwapperStyles, SupportedDepositOption, ContractCallType, ContractCall, SwapperConfig, SwapperIframeOptions, SwapperEvent, SwapperEventHandler, } from "./types";
4
+ export { ThemeMode, ComponentStyles, SwapperStyles, SupportedDepositOption, ContractCallType, ContractCall, SwapperConfig, SwapperIframeOptions, SwapperEvent, SwapperEventHandler, } from "./types";
5
+ export { approve, transfer, transferFrom, approveBalance, transferBalance, } from "./helpers";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,UAAU,EACV,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,YAAY,EAEZ,cAAc,EACd,eAAe,GAChB,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{SwapperIframe}from"./SwapperIframe";export{SwapperModal,openSwapperModal}from"./SwapperModal";export{ContractCallType}from"./types";
1
+ export{SwapperIframe}from"./SwapperIframe";export{SwapperModal,openSwapperModal}from"./SwapperModal";export{ContractCallType}from"./types";export{approve,transfer,transferFrom,approveBalance,transferBalance}from"./helpers";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAML,gBAAgB,GAMjB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAKL,gBAAgB,GAMjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,YAAY,EAEZ,cAAc,EACd,eAAe,GAChB,MAAM,WAAW,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,38 +1,19 @@
1
1
  export type ThemeMode = "light" | "dark";
2
- export interface BrandTheme {
3
- primaryColor?: string;
4
- secondaryColor?: string;
5
- }
6
2
  export interface ComponentStyles {
7
- backgroundColor?: string;
8
- borderRadius?: string;
9
- width?: string;
10
- textColor?: string;
11
- primaryButtonBackground?: string;
12
- primaryButtonText?: string;
13
- secondaryButtonBackground?: string;
14
- secondaryButtonText?: string;
15
- disabledButtonBackground?: string;
16
- disabledButtonText?: string;
17
- successColor?: string;
18
- warningColor?: string;
19
- errorColor?: string;
20
3
  primaryColor?: string;
21
- secondaryColor?: string;
22
- inputBackground?: string;
23
- inputBorder?: string;
24
- cardBackground?: string;
25
- borderColor?: string;
4
+ primaryBorderColor?: string;
5
+ accentColor?: string;
26
6
  }
27
7
  export interface SwapperStyles {
28
8
  themeMode?: ThemeMode;
29
- brandTheme?: BrandTheme;
30
9
  componentStyles?: ComponentStyles;
31
10
  }
32
- export type SupportedDepositOption = "transferCrypto" | "depositWithCash";
11
+ export type SupportedDepositOption = "transferCrypto" | "depositWithCash" | "walletDeposit";
33
12
  export declare enum ContractCallType {
34
- CALL = 0,
35
- DELEGATE_CALL = 1
13
+ DEFAULT = 0,
14
+ FULL_TOKEN_BALANCE = 1,
15
+ FULL_NATIVE_BALANCE = 2,
16
+ COLLECT_TOKEN_BALANCE = 3
36
17
  }
37
18
  export interface ContractCall {
38
19
  callType: ContractCallType;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAKzC,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD,MAAM,WAAW,eAAe;IAE9B,eAAe,CAAC,EAAE,MAAM,CAAC;I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.js CHANGED
@@ -1 +1 @@
1
- export var ContractCallType;!function(C){C[C.CALL=0]="CALL",C[C.DELEGATE_CALL=1]="DELEGATE_CALL"}(ContractCallType||(ContractCallType={}));
1
+ export var ContractCallType;!function(L){L[L.DEFAULT=0]="DEFAULT",L[L.FULL_TOKEN_BALANCE=1]="FULL_TOKEN_BALANCE",L[L.FULL_NATIVE_BALANCE=2]="FULL_NATIVE_BALANCE",L[L.COLLECT_TOKEN_BALANCE=3]="COLLECT_TOKEN_BALANCE"}(ContractCallType||(ContractCallType={}));
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA6EA,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,uDAAQ,CAAA;IACR,yEAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,mFAAsB,CAAA;IACtB,qFAAuB,CAAA;IACvB,yFAAyB,CAAA;AAC3B,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swapper-finance/deposit-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "Easy iframe embedding for Swapper deposit widget with full TypeScript support",
5
5
  "license": "MIT",
6
6
  "type": "module",