Skip to content

Commit

Permalink
chore: release 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
map3-release-bot committed Feb 4, 2023
1 parent 1077e1a commit 152a86b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/global/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/global/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface Map3InitConfig {
onClose?: () => void;
onFailure?: (error: string, networkCode: string, address?: string) => void;
onSuccess?: (txHash: string, networkCode: string, address?: string) => void;
paymentMethod?: 'binance-pay' | 'show-address';
rainbowRoad?: boolean;
theme?: 'dark' | 'light';
userId: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/types.d.ts.map
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mappings":"AqCMA;IACE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB,EAAE,CACtB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,KAEd,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAC3C;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD;gBAKc,MAAM,EAAE,cAAc;IAkH3B,IAAI;IAwBJ,KAAK;CAGb;AAED,OAAO,MAAM,4BAA6B,cAAc,SAEvD,CAAC","sources":["src/src/components/InnerWrapper/index.tsx","src/src/components/ErrorWrapper/index.tsx","src/src/components/LoadingWrapper/index.tsx","src/src/generated/apollo-gql.tsx","src/src/utils/abis/erc20.ts","src/src/utils/transactions/evm/index.ts","src/src/providers/Store/index.tsx","src/src/components/ProgressBar/index.tsx","src/src/hooks/useChainWatcher.tsx","src/src/utils/debounce.tsx","src/src/steps/AssetSelection/index.tsx","src/src/components/MethodIcon/index.tsx","src/src/components/methods/BinancePay/index.tsx","src/src/components/methods/WalletConnect/index.tsx","src/src/components/methods/WindowEthereum/index.tsx","src/src/constants/index.ts","src/src/hooks/useDepositAddress.tsx","src/src/utils/toHex.ts","src/src/hooks/useWeb3.tsx","src/src/hooks/usePrebuildTx.tsx","src/src/steps/EnterAmount/index.tsx","src/src/steps/NetworkSelection/index.tsx","src/src/steps/PaymentMethod/index.tsx","src/src/hooks/useModalSize.tsx","src/src/steps/BinancePay/index.tsx","src/src/steps/ConfirmRequiredAmount/index.tsx","src/src/steps/Result/index.tsx","src/src/utils/supabase.ts","src/src/steps/ShowAddress/index.tsx","src/src/steps/SwitchChain/index.tsx","src/src/steps/WalletConnect/index.tsx","src/src/steps/index.tsx","src/src/App.withAddressAndNetwork.tsx","src/src/App.withAssetId.tsx","src/src/App.withNetwork.tsx","src/src/hooks/useWindowSize.tsx","src/src/App.tsx","src/src/index.tsx","src/index.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport { offsetLimitPagination } from '@apollo/client/utilities';\nimport { createRoot, Root } from 'react-dom/client';\n\nimport App from './App';\n\nexport interface Map3InitConfig {\n address?: string;\n amount?: string;\n anonKey: string;\n appName?: string;\n assetId?: string;\n authorizeTransaction?: (\n fromAddress: string,\n network: string,\n amount: string\n ) => Promise<Boolean>;\n colors?: {\n progressBar?: string;\n scrollBar?: string;\n };\n embed?: {\n height?: string;\n id?: string;\n width?: string;\n };\n fiat?: string;\n generateDepositAddress: (\n asset?: string,\n network?: string\n ) =>\n | Promise<{ address: string; memo?: string }>\n | { address: string; memo?: string };\n networkCode?: string;\n onClose?: () => void;\n onFailure?: (error: string, networkCode: string, address?: string) => void;\n onSuccess?: (txHash: string, networkCode: string, address?: string) => void;\n rainbowRoad?: boolean;\n theme?: 'dark' | 'light';\n userId: string;\n}\nexport class Map3 {\n private onClose: () => void;\n private root: Root;\n private config: Map3InitConfig;\n\n constructor(config: Map3InitConfig) {\n if (!config.generateDepositAddress) {\n throw new Error('generateDepositAddress is required.');\n }\n if (!config.anonKey) {\n throw new Error('anonKey is required.');\n }\n\n if (!config.userId) {\n throw new Error('userId is required.');\n }\n\n if (!config.theme) {\n config.theme = 'light';\n }\n\n if (!config.fiat) {\n config.fiat = 'USD';\n }\n\n if (config.address && !config.networkCode) {\n console.warn(\n 'Warning: networkCode is required when address is provided. Falling back to asset selection.'\n );\n config.address = undefined;\n }\n\n if (config.amount && !config.networkCode) {\n console.warn(\n 'Warning: networkCode is required when amount is provided. Falling back to asset selection.'\n );\n config.amount = undefined;\n }\n\n if (config.rainbowRoad) {\n document.body.classList.add('rainbow-road');\n }\n\n if (config.appName) {\n document.title = config.appName;\n }\n\n if (config.colors) {\n const validKeys = ['progressBar', 'scrollBar'];\n const invalidKeys = Object.keys(config.colors).filter(\n (key) => !validKeys.includes(key)\n );\n if (invalidKeys.length > 0) {\n console.warn(\n `Warning: invalid key passed to colors. Valid keys are: ${validKeys.join(\n ', '\n )}`\n );\n }\n\n if (config.colors.scrollBar) {\n if (CSS.supports('color', config.colors.scrollBar)) {\n document.body.style.setProperty(\n '--scrollbar-color',\n config.colors.scrollBar\n );\n } else {\n console.warn(\n `Warning: invalid value passed to colors.scrollBar. Falling back to default.`\n );\n }\n }\n }\n\n this.config = config;\n\n this.onClose = () => {\n this.root.unmount();\n this.config.onClose?.();\n };\n\n const element = document.createElement('div');\n const embed = config.embed?.id\n ? document.getElementById(config.embed.id)\n : null;\n\n if (embed) {\n embed.appendChild(element);\n embed.classList.add('map3');\n } else {\n document.body.appendChild(element);\n }\n\n if (config.theme === 'dark' && !document.body.classList.contains('dark')) {\n document.body.classList.add('dark');\n }\n\n var parent = document.createElement('div');\n parent.setAttribute('style', 'width:30px;height:30px;');\n parent.classList.add('scrollbar-test');\n\n var child = document.createElement('div');\n child.setAttribute('style', 'width:100%;height:40px');\n parent.appendChild(child);\n document.body.appendChild(parent);\n\n // Measure the child element, if it is not\n // 30px wide the scrollbars are obtrusive.\n // @ts-ignore\n var scrollbarWidth = 30 - parent?.firstChild?.clientWidth;\n if (scrollbarWidth) {\n document.body.classList.add('map3-layout-scrollbar-obtrusive');\n }\n\n document.body.removeChild(parent);\n\n this.root = createRoot(element);\n }\n\n public open() {\n const client = new ApolloClient({\n cache: new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n assetsForOrganization: offsetLimitPagination(),\n },\n },\n },\n }),\n headers: {\n Authorization: 'Bearer ' + this.config.anonKey,\n 'x-map3-user': this.config.userId,\n },\n uri: process.env.CONSOLE_API_URL + '/graphql',\n });\n this.root.render(\n <ApolloProvider client={client}>\n <App config={this.config} onClose={this.onClose} />\n </ApolloProvider>\n );\n }\n\n public close() {\n this.onClose();\n }\n}\n\nexport const initMap3Supercharge = (args: Map3InitConfig) => {\n return new Map3(args);\n};\n\nif (typeof window !== 'undefined') {\n // @ts-ignore\n window.initMap3Supercharge = initMap3Supercharge;\n}\n"],"names":[],"version":3,"file":"types.d.ts.map"}
{"mappings":"AqCMA;IACE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB,EAAE,CACtB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,KAEd,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAC3C;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,aAAa,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD;gBAKc,MAAM,EAAE,cAAc;IAkH3B,IAAI;IAwBJ,KAAK;CAGb;AAED,OAAO,MAAM,4BAA6B,cAAc,SAEvD,CAAC","sources":["src/src/components/InnerWrapper/index.tsx","src/src/components/ErrorWrapper/index.tsx","src/src/components/LoadingWrapper/index.tsx","src/src/generated/apollo-gql.tsx","src/src/utils/abis/erc20.ts","src/src/utils/transactions/evm/index.ts","src/src/providers/Store/index.tsx","src/src/components/ProgressBar/index.tsx","src/src/hooks/useChainWatcher.tsx","src/src/utils/debounce.tsx","src/src/steps/AssetSelection/index.tsx","src/src/components/MethodIcon/index.tsx","src/src/components/methods/BinancePay/index.tsx","src/src/components/methods/WalletConnect/index.tsx","src/src/components/methods/WindowEthereum/index.tsx","src/src/constants/index.ts","src/src/hooks/useDepositAddress.tsx","src/src/utils/toHex.ts","src/src/hooks/useWeb3.tsx","src/src/hooks/usePrebuildTx.tsx","src/src/steps/EnterAmount/index.tsx","src/src/steps/NetworkSelection/index.tsx","src/src/steps/PaymentMethod/index.tsx","src/src/hooks/useModalSize.tsx","src/src/steps/BinancePay/index.tsx","src/src/steps/ConfirmRequiredAmount/index.tsx","src/src/steps/Result/index.tsx","src/src/utils/supabase.ts","src/src/steps/ShowAddress/index.tsx","src/src/steps/SwitchChain/index.tsx","src/src/steps/WalletConnect/index.tsx","src/src/steps/index.tsx","src/src/App.withAddressAndNetwork.tsx","src/src/App.withAssetId.tsx","src/src/App.withNetwork.tsx","src/src/hooks/useWindowSize.tsx","src/src/App.tsx","src/src/index.tsx","src/index.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client';\nimport { offsetLimitPagination } from '@apollo/client/utilities';\nimport { createRoot, Root } from 'react-dom/client';\n\nimport App from './App';\n\nexport interface Map3InitConfig {\n address?: string;\n amount?: string;\n anonKey: string;\n appName?: string;\n assetId?: string;\n authorizeTransaction?: (\n fromAddress: string,\n network: string,\n amount: string\n ) => Promise<Boolean>;\n colors?: {\n progressBar?: string;\n scrollBar?: string;\n };\n embed?: {\n height?: string;\n id?: string;\n width?: string;\n };\n fiat?: string;\n generateDepositAddress: (\n asset?: string,\n network?: string\n ) =>\n | Promise<{ address: string; memo?: string }>\n | { address: string; memo?: string };\n networkCode?: string;\n onClose?: () => void;\n onFailure?: (error: string, networkCode: string, address?: string) => void;\n onSuccess?: (txHash: string, networkCode: string, address?: string) => void;\n paymentMethod?: 'binance-pay' | 'show-address';\n rainbowRoad?: boolean;\n theme?: 'dark' | 'light';\n userId: string;\n}\nexport class Map3 {\n private onClose: () => void;\n private root: Root;\n private config: Map3InitConfig;\n\n constructor(config: Map3InitConfig) {\n if (!config.generateDepositAddress) {\n throw new Error('generateDepositAddress is required.');\n }\n if (!config.anonKey) {\n throw new Error('anonKey is required.');\n }\n\n if (!config.userId) {\n throw new Error('userId is required.');\n }\n\n if (!config.theme) {\n config.theme = 'light';\n }\n\n if (!config.fiat) {\n config.fiat = 'USD';\n }\n\n if (config.address && !config.networkCode) {\n console.warn(\n 'Warning: networkCode is required when address is provided. Falling back to asset selection.'\n );\n config.address = undefined;\n }\n\n if (config.amount && !config.networkCode) {\n console.warn(\n 'Warning: networkCode is required when amount is provided. Falling back to asset selection.'\n );\n config.amount = undefined;\n }\n\n if (config.rainbowRoad) {\n document.body.classList.add('rainbow-road');\n }\n\n if (config.appName) {\n document.title = config.appName;\n }\n\n if (config.colors) {\n const validKeys = ['progressBar', 'scrollBar'];\n const invalidKeys = Object.keys(config.colors).filter(\n (key) => !validKeys.includes(key)\n );\n if (invalidKeys.length > 0) {\n console.warn(\n `Warning: invalid key passed to colors. Valid keys are: ${validKeys.join(\n ', '\n )}`\n );\n }\n\n if (config.colors.scrollBar) {\n if (CSS.supports('color', config.colors.scrollBar)) {\n document.body.style.setProperty(\n '--scrollbar-color',\n config.colors.scrollBar\n );\n } else {\n console.warn(\n `Warning: invalid value passed to colors.scrollBar. Falling back to default.`\n );\n }\n }\n }\n\n this.config = config;\n\n this.onClose = () => {\n this.root.unmount();\n this.config.onClose?.();\n };\n\n const element = document.createElement('div');\n const embed = config.embed?.id\n ? document.getElementById(config.embed.id)\n : null;\n\n if (embed) {\n embed.appendChild(element);\n embed.classList.add('map3');\n } else {\n document.body.appendChild(element);\n }\n\n if (config.theme === 'dark' && !document.body.classList.contains('dark')) {\n document.body.classList.add('dark');\n }\n\n var parent = document.createElement('div');\n parent.setAttribute('style', 'width:30px;height:30px;');\n parent.classList.add('scrollbar-test');\n\n var child = document.createElement('div');\n child.setAttribute('style', 'width:100%;height:40px');\n parent.appendChild(child);\n document.body.appendChild(parent);\n\n // Measure the child element, if it is not\n // 30px wide the scrollbars are obtrusive.\n // @ts-ignore\n var scrollbarWidth = 30 - parent?.firstChild?.clientWidth;\n if (scrollbarWidth) {\n document.body.classList.add('map3-layout-scrollbar-obtrusive');\n }\n\n document.body.removeChild(parent);\n\n this.root = createRoot(element);\n }\n\n public open() {\n const client = new ApolloClient({\n cache: new InMemoryCache({\n typePolicies: {\n Query: {\n fields: {\n assetsForOrganization: offsetLimitPagination(),\n },\n },\n },\n }),\n headers: {\n Authorization: 'Bearer ' + this.config.anonKey,\n 'x-map3-user': this.config.userId,\n },\n uri: process.env.CONSOLE_API_URL + '/graphql',\n });\n this.root.render(\n <ApolloProvider client={client}>\n <App config={this.config} onClose={this.onClose} />\n </ApolloProvider>\n );\n }\n\n public close() {\n this.onClose();\n }\n}\n\nexport const initMap3Supercharge = (args: Map3InitConfig) => {\n return new Map3(args);\n};\n\nif (typeof window !== 'undefined') {\n // @ts-ignore\n window.initMap3Supercharge = initMap3Supercharge;\n}\n"],"names":[],"version":3,"file":"types.d.ts.map"}

0 comments on commit 152a86b

Please sign in to comment.