@tonconnect/sdk 2.0.7 → 2.1.1
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 +81 -9
- package/dist/tonconnect-sdk.min.js +1 -1
- package/dist/tonconnect-sdk.min.js.map +1 -1
- package/lib/cjs/index.cjs +1627 -0
- package/lib/cjs/index.cjs.map +1 -0
- package/lib/esm/index.mjs +1597 -0
- package/lib/esm/index.mjs.map +1 -0
- package/lib/types/index.d.ts +601 -8
- package/package.json +15 -15
- package/lib/cjs/errors/address/index.js +0 -6
- package/lib/cjs/errors/address/index.js.map +0 -1
- package/lib/cjs/errors/address/wrong-address.error.js +0 -15
- package/lib/cjs/errors/address/wrong-address.error.js.map +0 -1
- package/lib/cjs/errors/binary/index.js +0 -6
- package/lib/cjs/errors/binary/index.js.map +0 -1
- package/lib/cjs/errors/binary/parse-hex.error.js +0 -15
- package/lib/cjs/errors/binary/parse-hex.error.js.map +0 -1
- package/lib/cjs/errors/dapp/dapp-metadata.error.js +0 -15
- package/lib/cjs/errors/dapp/dapp-metadata.error.js.map +0 -1
- package/lib/cjs/errors/index.js +0 -28
- package/lib/cjs/errors/index.js.map +0 -1
- package/lib/cjs/errors/protocol/events/connect/index.js +0 -6
- package/lib/cjs/errors/protocol/events/connect/index.js.map +0 -1
- package/lib/cjs/errors/protocol/events/connect/manifest-content-error.error.js +0 -16
- package/lib/cjs/errors/protocol/events/connect/manifest-content-error.error.js.map +0 -1
- package/lib/cjs/errors/protocol/events/connect/manifest-not-found.error.js +0 -16
- package/lib/cjs/errors/protocol/events/connect/manifest-not-found.error.js.map +0 -1
- package/lib/cjs/errors/protocol/events/connect/user-rejects.error.js +0 -15
- package/lib/cjs/errors/protocol/events/connect/user-rejects.error.js.map +0 -1
- package/lib/cjs/errors/protocol/events/index.js +0 -18
- package/lib/cjs/errors/protocol/events/index.js.map +0 -1
- package/lib/cjs/errors/protocol/index.js +0 -19
- package/lib/cjs/errors/protocol/index.js.map +0 -1
- package/lib/cjs/errors/protocol/responses/bad-request.error.js +0 -15
- package/lib/cjs/errors/protocol/responses/bad-request.error.js.map +0 -1
- package/lib/cjs/errors/protocol/responses/index.js +0 -8
- package/lib/cjs/errors/protocol/responses/index.js.map +0 -1
- package/lib/cjs/errors/protocol/responses/unknown-app.error.js +0 -15
- package/lib/cjs/errors/protocol/responses/unknown-app.error.js.map +0 -1
- package/lib/cjs/errors/storage/index.js +0 -6
- package/lib/cjs/errors/storage/index.js.map +0 -1
- package/lib/cjs/errors/storage/localstorage-not-found.error.js +0 -15
- package/lib/cjs/errors/storage/localstorage-not-found.error.js.map +0 -1
- package/lib/cjs/errors/ton-connect.error.js +0 -18
- package/lib/cjs/errors/ton-connect.error.js.map +0 -1
- package/lib/cjs/errors/unknown.error.js +0 -15
- package/lib/cjs/errors/unknown.error.js.map +0 -1
- package/lib/cjs/errors/wallet/index.js +0 -10
- package/lib/cjs/errors/wallet/index.js.map +0 -1
- package/lib/cjs/errors/wallet/wallet-already-connected.error.js +0 -15
- package/lib/cjs/errors/wallet/wallet-already-connected.error.js.map +0 -1
- package/lib/cjs/errors/wallet/wallet-not-connected.error.js +0 -15
- package/lib/cjs/errors/wallet/wallet-not-connected.error.js.map +0 -1
- package/lib/cjs/errors/wallet/wallet-not-injected.error.js +0 -15
- package/lib/cjs/errors/wallet/wallet-not-injected.error.js.map +0 -1
- package/lib/cjs/errors/wallet/wallet-not-support-feature.error.js +0 -15
- package/lib/cjs/errors/wallet/wallet-not-support-feature.error.js.map +0 -1
- package/lib/cjs/errors/wallets-manager/fetch-wallets.error.js +0 -15
- package/lib/cjs/errors/wallets-manager/fetch-wallets.error.js.map +0 -1
- package/lib/cjs/errors/wallets-manager/index.js +0 -6
- package/lib/cjs/errors/wallets-manager/index.js.map +0 -1
- package/lib/cjs/index.js +0 -27
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/models/dapp/dapp-metadata.js +0 -3
- package/lib/cjs/models/dapp/dapp-metadata.js.map +0 -1
- package/lib/cjs/models/index.js +0 -19
- package/lib/cjs/models/index.js.map +0 -1
- package/lib/cjs/models/methods/connect/connect-additional-request.js +0 -3
- package/lib/cjs/models/methods/connect/connect-additional-request.js.map +0 -1
- package/lib/cjs/models/methods/connect/index.js +0 -3
- package/lib/cjs/models/methods/connect/index.js.map +0 -1
- package/lib/cjs/models/methods/index.js +0 -19
- package/lib/cjs/models/methods/index.js.map +0 -1
- package/lib/cjs/models/methods/send-transaction/index.js +0 -3
- package/lib/cjs/models/methods/send-transaction/index.js.map +0 -1
- package/lib/cjs/models/methods/send-transaction/send-transaction-request.js +0 -3
- package/lib/cjs/models/methods/send-transaction/send-transaction-request.js.map +0 -1
- package/lib/cjs/models/methods/send-transaction/send-transaction-response.js +0 -3
- package/lib/cjs/models/methods/send-transaction/send-transaction-response.js.map +0 -1
- package/lib/cjs/models/ton-connect-options.js +0 -3
- package/lib/cjs/models/ton-connect-options.js.map +0 -1
- package/lib/cjs/models/wallet/account.js +0 -3
- package/lib/cjs/models/wallet/account.js.map +0 -1
- package/lib/cjs/models/wallet/index.js +0 -6
- package/lib/cjs/models/wallet/index.js.map +0 -1
- package/lib/cjs/models/wallet/wallet-connection-source.js +0 -8
- package/lib/cjs/models/wallet/wallet-connection-source.js.map +0 -1
- package/lib/cjs/models/wallet/wallet-info.js +0 -8
- package/lib/cjs/models/wallet/wallet-info.js.map +0 -1
- package/lib/cjs/models/wallet/wallet.js +0 -3
- package/lib/cjs/models/wallet/wallet.js.map +0 -1
- package/lib/cjs/parsers/connect-errors-parser.js +0 -27
- package/lib/cjs/parsers/connect-errors-parser.js.map +0 -1
- package/lib/cjs/parsers/rpc-parser.js +0 -10
- package/lib/cjs/parsers/rpc-parser.js.map +0 -1
- package/lib/cjs/parsers/send-transaction-parser.js +0 -35
- package/lib/cjs/parsers/send-transaction-parser.js.map +0 -1
- package/lib/cjs/provider/bridge/bridge-gateway.js +0 -110
- package/lib/cjs/provider/bridge/bridge-gateway.js.map +0 -1
- package/lib/cjs/provider/bridge/bridge-provider.js +0 -147
- package/lib/cjs/provider/bridge/bridge-provider.js.map +0 -1
- package/lib/cjs/provider/bridge/models/bridge-connection.js +0 -3
- package/lib/cjs/provider/bridge/models/bridge-connection.js.map +0 -1
- package/lib/cjs/provider/bridge/models/bridge-incomming-message.js +0 -3
- package/lib/cjs/provider/bridge/models/bridge-incomming-message.js.map +0 -1
- package/lib/cjs/provider/bridge/models/bridge-session-raw.js +0 -3
- package/lib/cjs/provider/bridge/models/bridge-session-raw.js.map +0 -1
- package/lib/cjs/provider/bridge/models/bridge-session.js +0 -3
- package/lib/cjs/provider/bridge/models/bridge-session.js.map +0 -1
- package/lib/cjs/provider/injected/injected-provider.js +0 -143
- package/lib/cjs/provider/injected/injected-provider.js.map +0 -1
- package/lib/cjs/provider/injected/models/injected-wallet-api.js +0 -3
- package/lib/cjs/provider/injected/models/injected-wallet-api.js.map +0 -1
- package/lib/cjs/provider/provider.js +0 -3
- package/lib/cjs/provider/provider.js.map +0 -1
- package/lib/cjs/resources/protocol.js +0 -5
- package/lib/cjs/resources/protocol.js.map +0 -1
- package/lib/cjs/storage/bridge-connection-storage.js +0 -101
- package/lib/cjs/storage/bridge-connection-storage.js.map +0 -1
- package/lib/cjs/storage/default-storage.js +0 -40
- package/lib/cjs/storage/default-storage.js.map +0 -1
- package/lib/cjs/storage/http-bridge-gateway-storage.js +0 -39
- package/lib/cjs/storage/http-bridge-gateway-storage.js.map +0 -1
- package/lib/cjs/storage/models/storage.interface.js +0 -3
- package/lib/cjs/storage/models/storage.interface.js.map +0 -1
- package/lib/cjs/ton-connect.interface.js +0 -3
- package/lib/cjs/ton-connect.interface.js.map +0 -1
- package/lib/cjs/ton-connect.js +0 -275
- package/lib/cjs/ton-connect.js.map +0 -1
- package/lib/cjs/utils/address.js +0 -98
- package/lib/cjs/utils/address.js.map +0 -1
- package/lib/cjs/utils/options.js +0 -16
- package/lib/cjs/utils/options.js.map +0 -1
- package/lib/cjs/utils/types.js +0 -3
- package/lib/cjs/utils/types.js.map +0 -1
- package/lib/cjs/utils/url.js +0 -15
- package/lib/cjs/utils/url.js.map +0 -1
- package/lib/cjs/utils/web-api.js +0 -27
- package/lib/cjs/utils/web-api.js.map +0 -1
- package/lib/cjs/wallets-list-manager.js +0 -123
- package/lib/cjs/wallets-list-manager.js.map +0 -1
- package/lib/esm/errors/address/index.js +0 -2
- package/lib/esm/errors/address/index.js.map +0 -1
- package/lib/esm/errors/address/wrong-address.error.js +0 -11
- package/lib/esm/errors/address/wrong-address.error.js.map +0 -1
- package/lib/esm/errors/binary/index.js +0 -2
- package/lib/esm/errors/binary/index.js.map +0 -1
- package/lib/esm/errors/binary/parse-hex.error.js +0 -11
- package/lib/esm/errors/binary/parse-hex.error.js.map +0 -1
- package/lib/esm/errors/dapp/dapp-metadata.error.js +0 -11
- package/lib/esm/errors/dapp/dapp-metadata.error.js.map +0 -1
- package/lib/esm/errors/index.js +0 -9
- package/lib/esm/errors/index.js.map +0 -1
- package/lib/esm/errors/protocol/events/connect/index.js +0 -2
- package/lib/esm/errors/protocol/events/connect/index.js.map +0 -1
- package/lib/esm/errors/protocol/events/connect/manifest-content-error.error.js +0 -12
- package/lib/esm/errors/protocol/events/connect/manifest-content-error.error.js.map +0 -1
- package/lib/esm/errors/protocol/events/connect/manifest-not-found.error.js +0 -12
- package/lib/esm/errors/protocol/events/connect/manifest-not-found.error.js.map +0 -1
- package/lib/esm/errors/protocol/events/connect/user-rejects.error.js +0 -11
- package/lib/esm/errors/protocol/events/connect/user-rejects.error.js.map +0 -1
- package/lib/esm/errors/protocol/events/index.js +0 -2
- package/lib/esm/errors/protocol/events/index.js.map +0 -1
- package/lib/esm/errors/protocol/index.js +0 -3
- package/lib/esm/errors/protocol/index.js.map +0 -1
- package/lib/esm/errors/protocol/responses/bad-request.error.js +0 -11
- package/lib/esm/errors/protocol/responses/bad-request.error.js.map +0 -1
- package/lib/esm/errors/protocol/responses/index.js +0 -3
- package/lib/esm/errors/protocol/responses/index.js.map +0 -1
- package/lib/esm/errors/protocol/responses/unknown-app.error.js +0 -11
- package/lib/esm/errors/protocol/responses/unknown-app.error.js.map +0 -1
- package/lib/esm/errors/storage/index.js +0 -2
- package/lib/esm/errors/storage/index.js.map +0 -1
- package/lib/esm/errors/storage/localstorage-not-found.error.js +0 -11
- package/lib/esm/errors/storage/localstorage-not-found.error.js.map +0 -1
- package/lib/esm/errors/ton-connect.error.js +0 -14
- package/lib/esm/errors/ton-connect.error.js.map +0 -1
- package/lib/esm/errors/unknown.error.js +0 -11
- package/lib/esm/errors/unknown.error.js.map +0 -1
- package/lib/esm/errors/wallet/index.js +0 -4
- package/lib/esm/errors/wallet/index.js.map +0 -1
- package/lib/esm/errors/wallet/wallet-already-connected.error.js +0 -11
- package/lib/esm/errors/wallet/wallet-already-connected.error.js.map +0 -1
- package/lib/esm/errors/wallet/wallet-not-connected.error.js +0 -11
- package/lib/esm/errors/wallet/wallet-not-connected.error.js.map +0 -1
- package/lib/esm/errors/wallet/wallet-not-injected.error.js +0 -11
- package/lib/esm/errors/wallet/wallet-not-injected.error.js.map +0 -1
- package/lib/esm/errors/wallet/wallet-not-support-feature.error.js +0 -11
- package/lib/esm/errors/wallet/wallet-not-support-feature.error.js.map +0 -1
- package/lib/esm/errors/wallets-manager/fetch-wallets.error.js +0 -11
- package/lib/esm/errors/wallets-manager/fetch-wallets.error.js.map +0 -1
- package/lib/esm/errors/wallets-manager/index.js +0 -2
- package/lib/esm/errors/wallets-manager/index.js.map +0 -1
- package/lib/esm/index.js +0 -7
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/models/dapp/dapp-metadata.js +0 -2
- package/lib/esm/models/dapp/dapp-metadata.js.map +0 -1
- package/lib/esm/models/index.js +0 -3
- package/lib/esm/models/index.js.map +0 -1
- package/lib/esm/models/methods/connect/connect-additional-request.js +0 -2
- package/lib/esm/models/methods/connect/connect-additional-request.js.map +0 -1
- package/lib/esm/models/methods/connect/index.js +0 -2
- package/lib/esm/models/methods/connect/index.js.map +0 -1
- package/lib/esm/models/methods/index.js +0 -3
- package/lib/esm/models/methods/index.js.map +0 -1
- package/lib/esm/models/methods/send-transaction/index.js +0 -2
- package/lib/esm/models/methods/send-transaction/index.js.map +0 -1
- package/lib/esm/models/methods/send-transaction/send-transaction-request.js +0 -2
- package/lib/esm/models/methods/send-transaction/send-transaction-request.js.map +0 -1
- package/lib/esm/models/methods/send-transaction/send-transaction-response.js +0 -2
- package/lib/esm/models/methods/send-transaction/send-transaction-response.js.map +0 -1
- package/lib/esm/models/ton-connect-options.js +0 -2
- package/lib/esm/models/ton-connect-options.js.map +0 -1
- package/lib/esm/models/wallet/account.js +0 -2
- package/lib/esm/models/wallet/account.js.map +0 -1
- package/lib/esm/models/wallet/index.js +0 -2
- package/lib/esm/models/wallet/index.js.map +0 -1
- package/lib/esm/models/wallet/wallet-connection-source.js +0 -4
- package/lib/esm/models/wallet/wallet-connection-source.js.map +0 -1
- package/lib/esm/models/wallet/wallet-info.js +0 -4
- package/lib/esm/models/wallet/wallet-info.js.map +0 -1
- package/lib/esm/models/wallet/wallet.js +0 -2
- package/lib/esm/models/wallet/wallet.js.map +0 -1
- package/lib/esm/parsers/connect-errors-parser.js +0 -24
- package/lib/esm/parsers/connect-errors-parser.js.map +0 -1
- package/lib/esm/parsers/rpc-parser.js +0 -6
- package/lib/esm/parsers/rpc-parser.js.map +0 -1
- package/lib/esm/parsers/send-transaction-parser.js +0 -32
- package/lib/esm/parsers/send-transaction-parser.js.map +0 -1
- package/lib/esm/provider/bridge/bridge-gateway.js +0 -106
- package/lib/esm/provider/bridge/bridge-gateway.js.map +0 -1
- package/lib/esm/provider/bridge/bridge-provider.js +0 -143
- package/lib/esm/provider/bridge/bridge-provider.js.map +0 -1
- package/lib/esm/provider/bridge/models/bridge-connection.js +0 -2
- package/lib/esm/provider/bridge/models/bridge-connection.js.map +0 -1
- package/lib/esm/provider/bridge/models/bridge-incomming-message.js +0 -2
- package/lib/esm/provider/bridge/models/bridge-incomming-message.js.map +0 -1
- package/lib/esm/provider/bridge/models/bridge-session-raw.js +0 -2
- package/lib/esm/provider/bridge/models/bridge-session-raw.js.map +0 -1
- package/lib/esm/provider/bridge/models/bridge-session.js +0 -2
- package/lib/esm/provider/bridge/models/bridge-session.js.map +0 -1
- package/lib/esm/provider/injected/injected-provider.js +0 -139
- package/lib/esm/provider/injected/injected-provider.js.map +0 -1
- package/lib/esm/provider/injected/models/injected-wallet-api.js +0 -2
- package/lib/esm/provider/injected/models/injected-wallet-api.js.map +0 -1
- package/lib/esm/provider/provider.js +0 -2
- package/lib/esm/provider/provider.js.map +0 -1
- package/lib/esm/resources/protocol.js +0 -2
- package/lib/esm/resources/protocol.js.map +0 -1
- package/lib/esm/storage/bridge-connection-storage.js +0 -97
- package/lib/esm/storage/bridge-connection-storage.js.map +0 -1
- package/lib/esm/storage/default-storage.js +0 -36
- package/lib/esm/storage/default-storage.js.map +0 -1
- package/lib/esm/storage/http-bridge-gateway-storage.js +0 -35
- package/lib/esm/storage/http-bridge-gateway-storage.js.map +0 -1
- package/lib/esm/storage/models/storage.interface.js +0 -2
- package/lib/esm/storage/models/storage.interface.js.map +0 -1
- package/lib/esm/ton-connect.interface.js +0 -2
- package/lib/esm/ton-connect.interface.js.map +0 -1
- package/lib/esm/ton-connect.js +0 -271
- package/lib/esm/ton-connect.js.map +0 -1
- package/lib/esm/utils/address.js +0 -94
- package/lib/esm/utils/address.js.map +0 -1
- package/lib/esm/utils/options.js +0 -9
- package/lib/esm/utils/options.js.map +0 -1
- package/lib/esm/utils/types.js +0 -2
- package/lib/esm/utils/types.js.map +0 -1
- package/lib/esm/utils/url.js +0 -10
- package/lib/esm/utils/url.js.map +0 -1
- package/lib/esm/utils/web-api.js +0 -21
- package/lib/esm/utils/web-api.js.map +0 -1
- package/lib/esm/wallets-list-manager.js +0 -119
- package/lib/esm/wallets-list-manager.js.map +0 -1
- package/lib/types/errors/address/index.d.ts +0 -1
- package/lib/types/errors/address/wrong-address.error.d.ts +0 -7
- package/lib/types/errors/binary/index.d.ts +0 -1
- package/lib/types/errors/binary/parse-hex.error.d.ts +0 -7
- package/lib/types/errors/dapp/dapp-metadata.error.d.ts +0 -7
- package/lib/types/errors/index.d.ts +0 -8
- package/lib/types/errors/protocol/events/connect/index.d.ts +0 -1
- package/lib/types/errors/protocol/events/connect/manifest-content-error.error.d.ts +0 -8
- package/lib/types/errors/protocol/events/connect/manifest-not-found.error.d.ts +0 -8
- package/lib/types/errors/protocol/events/connect/user-rejects.error.d.ts +0 -7
- package/lib/types/errors/protocol/events/index.d.ts +0 -1
- package/lib/types/errors/protocol/index.d.ts +0 -2
- package/lib/types/errors/protocol/responses/bad-request.error.d.ts +0 -7
- package/lib/types/errors/protocol/responses/index.d.ts +0 -2
- package/lib/types/errors/protocol/responses/unknown-app.error.d.ts +0 -7
- package/lib/types/errors/storage/index.d.ts +0 -1
- package/lib/types/errors/storage/localstorage-not-found.error.d.ts +0 -7
- package/lib/types/errors/ton-connect.error.d.ts +0 -7
- package/lib/types/errors/unknown.error.d.ts +0 -7
- package/lib/types/errors/wallet/index.d.ts +0 -3
- package/lib/types/errors/wallet/wallet-already-connected.error.d.ts +0 -7
- package/lib/types/errors/wallet/wallet-not-connected.error.d.ts +0 -7
- package/lib/types/errors/wallet/wallet-not-injected.error.d.ts +0 -7
- package/lib/types/errors/wallet/wallet-not-support-feature.error.d.ts +0 -7
- package/lib/types/errors/wallets-manager/fetch-wallets.error.d.ts +0 -7
- package/lib/types/errors/wallets-manager/index.d.ts +0 -1
- package/lib/types/models/dapp/dapp-metadata.d.ts +0 -18
- package/lib/types/models/index.d.ts +0 -4
- package/lib/types/models/methods/connect/connect-additional-request.d.ts +0 -6
- package/lib/types/models/methods/connect/index.d.ts +0 -1
- package/lib/types/models/methods/index.d.ts +0 -2
- package/lib/types/models/methods/send-transaction/index.d.ts +0 -2
- package/lib/types/models/methods/send-transaction/send-transaction-request.d.ts +0 -27
- package/lib/types/models/methods/send-transaction/send-transaction-response.d.ts +0 -6
- package/lib/types/models/ton-connect-options.d.ts +0 -21
- package/lib/types/models/wallet/account.d.ts +0 -16
- package/lib/types/models/wallet/index.d.ts +0 -4
- package/lib/types/models/wallet/wallet-connection-source.d.ts +0 -18
- package/lib/types/models/wallet/wallet-info.d.ts +0 -65
- package/lib/types/models/wallet/wallet.d.ts +0 -22
- package/lib/types/parsers/connect-errors-parser.d.ts +0 -7
- package/lib/types/parsers/rpc-parser.d.ts +0 -8
- package/lib/types/parsers/send-transaction-parser.d.ts +0 -13
- package/lib/types/provider/bridge/bridge-gateway.d.ts +0 -21
- package/lib/types/provider/bridge/bridge-provider.d.ts +0 -29
- package/lib/types/provider/bridge/models/bridge-connection.d.ts +0 -23
- package/lib/types/provider/bridge/models/bridge-incomming-message.d.ts +0 -4
- package/lib/types/provider/bridge/models/bridge-session-raw.d.ts +0 -5
- package/lib/types/provider/bridge/models/bridge-session.d.ts +0 -8
- package/lib/types/provider/injected/injected-provider.d.ts +0 -29
- package/lib/types/provider/injected/models/injected-wallet-api.d.ts +0 -11
- package/lib/types/provider/provider.d.ts +0 -19
- package/lib/types/resources/protocol.d.ts +0 -1
- package/lib/types/storage/bridge-connection-storage.d.ts +0 -13
- package/lib/types/storage/default-storage.d.ts +0 -8
- package/lib/types/storage/http-bridge-gateway-storage.d.ts +0 -9
- package/lib/types/storage/models/storage.interface.d.ts +0 -21
- package/lib/types/ton-connect.d.ts +0 -86
- package/lib/types/ton-connect.interface.d.ts +0 -53
- package/lib/types/utils/address.d.ts +0 -6
- package/lib/types/utils/options.d.ts +0 -1
- package/lib/types/utils/types.d.ts +0 -6
- package/lib/types/utils/url.d.ts +0 -2
- package/lib/types/utils/web-api.d.ts +0 -3
- package/lib/types/wallets-list-manager.d.ts +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-api.js","sourceRoot":"","sources":["../../../src/utils/web-api.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS;IACrB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAC/B,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,WAAW;IACvB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACjC,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,kBAAkB;;IAC9B,MAAM,MAAM,GAAG,MAAA,SAAS,EAAE,0CAAE,QAAQ,CAAC,MAAM,CAAC;IAC5C,IAAI,MAAM,EAAE;QACR,OAAO,MAAM,GAAG,2BAA2B,CAAC;KAC/C;IAED,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { FetchWalletsError } from "./errors/wallets-manager/fetch-wallets.error";
|
|
11
|
-
import { isWalletInfoInjected } from "./models/wallet/wallet-info";
|
|
12
|
-
import { InjectedProvider } from "./provider/injected/injected-provider";
|
|
13
|
-
export class WalletsListManager {
|
|
14
|
-
constructor(walletsListSource) {
|
|
15
|
-
this.walletsListCache = null;
|
|
16
|
-
this.walletsListSource = 'https://raw.githubusercontent.com/ton-connect/wallets-list/main/wallets.json';
|
|
17
|
-
if (walletsListSource) {
|
|
18
|
-
this.walletsListSource = walletsListSource;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
getWallets() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
if (!this.walletsListCache) {
|
|
24
|
-
this.walletsListCache = this.fetchWalletsList();
|
|
25
|
-
this.walletsListCache.catch(() => (this.walletsListCache = null));
|
|
26
|
-
}
|
|
27
|
-
return this.walletsListCache;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
getEmbeddedWallet() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const walletsList = yield this.getWallets();
|
|
33
|
-
const embeddedWallets = walletsList.filter(item => isWalletInfoInjected(item) && item.embedded);
|
|
34
|
-
if (embeddedWallets.length !== 1) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return embeddedWallets[0];
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
fetchWalletsList() {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
try {
|
|
43
|
-
const walletsResponse = yield fetch(this.walletsListSource);
|
|
44
|
-
const walletsList = yield walletsResponse.json();
|
|
45
|
-
if (!Array.isArray(walletsList) ||
|
|
46
|
-
!walletsList.every(wallet => this.isCorrectWalletConfigDTO(wallet))) {
|
|
47
|
-
throw new FetchWalletsError('Wrong wallets list format');
|
|
48
|
-
}
|
|
49
|
-
return this.walletConfigDTOListToWalletConfigList(walletsList);
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
throw new FetchWalletsError(e);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
walletConfigDTOListToWalletConfigList(walletConfigDTO) {
|
|
57
|
-
return walletConfigDTO.map(walletConfigDTO => {
|
|
58
|
-
const walletConfig = {
|
|
59
|
-
name: walletConfigDTO.name,
|
|
60
|
-
imageUrl: walletConfigDTO.image,
|
|
61
|
-
aboutUrl: walletConfigDTO.about_url,
|
|
62
|
-
tondns: walletConfigDTO.tondns
|
|
63
|
-
};
|
|
64
|
-
walletConfigDTO.bridge.forEach(bridge => {
|
|
65
|
-
if (bridge.type === 'sse') {
|
|
66
|
-
walletConfig.bridgeUrl = bridge.url;
|
|
67
|
-
walletConfig.universalLink =
|
|
68
|
-
walletConfigDTO.universal_url;
|
|
69
|
-
walletConfig.deepLink = walletConfigDTO.deepLink;
|
|
70
|
-
}
|
|
71
|
-
if (bridge.type === 'js') {
|
|
72
|
-
const jsBridgeKey = bridge.key;
|
|
73
|
-
walletConfig.jsBridgeKey = jsBridgeKey;
|
|
74
|
-
walletConfig.injected =
|
|
75
|
-
InjectedProvider.isWalletInjected(jsBridgeKey);
|
|
76
|
-
walletConfig.embedded =
|
|
77
|
-
InjectedProvider.isInsideWalletBrowser(jsBridgeKey);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return walletConfig;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
isCorrectWalletConfigDTO(value) {
|
|
84
|
-
if (!value || !(typeof value === 'object')) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
const containsName = 'name' in value;
|
|
88
|
-
const containsImage = 'image' in value;
|
|
89
|
-
const containsAbout = 'about_url' in value;
|
|
90
|
-
if (!containsName || !containsImage || !containsAbout) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
if (!('bridge' in value) ||
|
|
94
|
-
!Array.isArray(value.bridge) ||
|
|
95
|
-
!value.bridge.length) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
const bridge = value.bridge;
|
|
99
|
-
if (bridge.some(item => !item || typeof item !== 'object' || !('type' in item))) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
const sseBridge = bridge.find(item => item.type === 'sse');
|
|
103
|
-
if (sseBridge) {
|
|
104
|
-
if (!('url' in sseBridge) ||
|
|
105
|
-
!sseBridge.url ||
|
|
106
|
-
!value.universal_url) {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const jsBridge = bridge.find(item => item.type === 'js');
|
|
111
|
-
if (jsBridge) {
|
|
112
|
-
if (!('key' in jsBridge) || !jsBridge.key) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=wallets-list-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallets-list-manager.js","sourceRoot":"","sources":["../../src/wallets-list-manager.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { WrongAddressError } from './wrong-address.error';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ParseHexError } from './parse-hex.error';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when passed DappMetadata is in incorrect format.
|
|
4
|
-
*/
|
|
5
|
-
export declare class DappMetadataError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './protocol';
|
|
2
|
-
export * from './wallet';
|
|
3
|
-
export * from './storage';
|
|
4
|
-
export * from './wallets-manager';
|
|
5
|
-
export * from './address';
|
|
6
|
-
export * from './binary';
|
|
7
|
-
export { TonConnectError } from './ton-connect.error';
|
|
8
|
-
export { UnknownError } from './unknown.error';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { UserRejectsError } from "./user-rejects.error";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../../../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when passed manifest contains errors.
|
|
4
|
-
*/
|
|
5
|
-
export declare class ManifestContentErrorError extends TonConnectError {
|
|
6
|
-
private static additionalMessage;
|
|
7
|
-
constructor(message?: string);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../../../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when wallet can't get manifest by passed manifestUrl.
|
|
4
|
-
*/
|
|
5
|
-
export declare class ManifestNotFoundError extends TonConnectError {
|
|
6
|
-
private static additionalMessage;
|
|
7
|
-
constructor(message?: string);
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../../../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when user rejects the action in the wallet.
|
|
4
|
-
*/
|
|
5
|
-
export declare class UserRejectsError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './connect';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when app tries to send rpc request to the injected wallet while not connected.
|
|
4
|
-
*/
|
|
5
|
-
export declare class UnknownAppError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { LocalstorageNotFoundError } from './localstorage-not-found.error';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when `Storage` was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment.
|
|
4
|
-
*/
|
|
5
|
-
export declare class LocalstorageNotFoundError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base class for TonConnect errors. You can check if the error was triggered by the @tonconnect/sdk using `err instanceof TonConnectError`.
|
|
3
|
-
*/
|
|
4
|
-
export declare class TonConnectError extends Error {
|
|
5
|
-
private static prefix;
|
|
6
|
-
constructor(message?: string, options?: ErrorOptions);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection.
|
|
4
|
-
*/
|
|
5
|
-
export declare class WalletAlreadyConnectedError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when send transaction or other protocol methods called while wallet is not connected.
|
|
4
|
-
*/
|
|
5
|
-
export declare class WalletNotConnectedError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when there is an attempt to connect to the injected wallet while it is not exists in the webpage.
|
|
4
|
-
*/
|
|
5
|
-
export declare class WalletNotInjectedError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when wallet doesn't support requested feature method.
|
|
4
|
-
*/
|
|
5
|
-
export declare class WalletNotSupportFeatureError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../ton-connect.error";
|
|
2
|
-
/**
|
|
3
|
-
* Thrown when an error occurred while fetching the wallets list.
|
|
4
|
-
*/
|
|
5
|
-
export declare class FetchWalletsError extends TonConnectError {
|
|
6
|
-
constructor(...args: ConstructorParameters<typeof TonConnectError>);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FetchWalletsError } from './fetch-wallets.error';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface DappMetadata {
|
|
2
|
-
/**
|
|
3
|
-
* Dapp name. Might be simple, will not be used as identifier.
|
|
4
|
-
* @default `document.title` if exists, 'Unknown dapp' overwise
|
|
5
|
-
*/
|
|
6
|
-
name: string;
|
|
7
|
-
/**
|
|
8
|
-
* URL to the dapp icon. Must be PNG, ICO, ... . SVG icons are not supported.
|
|
9
|
-
* @default best quality favicon declared via <link> in the document or '' if there are no any icons in the document.
|
|
10
|
-
*/
|
|
11
|
-
icon: string;
|
|
12
|
-
/**
|
|
13
|
-
* Dapp URL. Will be used as the dapp identifier. Will be used to open the dapp after click to its icon in the wallet.
|
|
14
|
-
* It is recommended to pass url without closing slash, e.g. 'https://mydapp.com' instead of 'https://mydapp.com/'.
|
|
15
|
-
* @default `window.location.origin` if exists, otherwise (if not explicitly specified) an error will be thrown.
|
|
16
|
-
*/
|
|
17
|
-
url: string;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ConnectAdditionalRequest } from './connect-additional-request';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface SendTransactionRequest {
|
|
2
|
-
/**
|
|
3
|
-
* Sending transaction deadline in unix epoch seconds.
|
|
4
|
-
*/
|
|
5
|
-
validUntil: number;
|
|
6
|
-
/**
|
|
7
|
-
* Messages to send: min is 1, max is 4.
|
|
8
|
-
*/
|
|
9
|
-
messages: {
|
|
10
|
-
/**
|
|
11
|
-
* Receiver's address.
|
|
12
|
-
*/
|
|
13
|
-
address: string;
|
|
14
|
-
/**
|
|
15
|
-
* Amount to send in nanoTon.
|
|
16
|
-
*/
|
|
17
|
-
amount: string;
|
|
18
|
-
/**
|
|
19
|
-
* Contract specific data to add to the transaction.
|
|
20
|
-
*/
|
|
21
|
-
stateInit?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Contract specific data to add to the transaction.
|
|
24
|
-
*/
|
|
25
|
-
payload?: string;
|
|
26
|
-
}[];
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IStorage } from "../storage/models/storage.interface";
|
|
2
|
-
/**
|
|
3
|
-
* TonConnect constructor options
|
|
4
|
-
*/
|
|
5
|
-
export interface TonConnectOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Url to the [manifest]{@link https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest} with the Dapp metadata that will be displayed in the user's wallet.
|
|
8
|
-
* If not passed, manifest from `${window.location.origin}/tonconnect-manifest.json` will be taken.
|
|
9
|
-
*/
|
|
10
|
-
manifestUrl?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Storage to save protocol data. For browser default is `localStorage`. If you use SDK with nodeJS, you have to specify this field.
|
|
13
|
-
*/
|
|
14
|
-
storage?: IStorage;
|
|
15
|
-
/**
|
|
16
|
-
* Redefine wallets list source URL. Must be a link to a json file with [following structure]{@link https://github.com/ton-connect/wallets-list}
|
|
17
|
-
* @default https://raw.githubusercontent.com/ton-connect/wallets-list/main/wallets.json
|
|
18
|
-
* @
|
|
19
|
-
*/
|
|
20
|
-
walletsListSource?: string;
|
|
21
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CHAIN } from '@tonconnect/protocol';
|
|
2
|
-
export interface Account {
|
|
3
|
-
/**
|
|
4
|
-
* User's address in "hex" format: "<wc>:<hex>".
|
|
5
|
-
*/
|
|
6
|
-
address: string;
|
|
7
|
-
/**
|
|
8
|
-
* User's selected chain.
|
|
9
|
-
*/
|
|
10
|
-
chain: CHAIN;
|
|
11
|
-
/**
|
|
12
|
-
* Base64 (not url safe) encoded wallet contract stateInit.
|
|
13
|
-
* Can be used to get user's public key from the stateInit if the wallet contract doesn't support corresponding get method.
|
|
14
|
-
*/
|
|
15
|
-
walletStateInit: string;
|
|
16
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { Account } from './account';
|
|
2
|
-
export type { Wallet } from './wallet';
|
|
3
|
-
export type { WalletConnectionSource, WalletConnectionSourceHTTP, WalletConnectionSourceJS } from './wallet-connection-source';
|
|
4
|
-
export { WalletInfo, WalletInfoBase, WalletInfoInjected, WalletInfoRemote, isWalletInfoInjected } from './wallet-info';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare type WalletConnectionSource = WalletConnectionSourceHTTP | WalletConnectionSourceJS;
|
|
2
|
-
export interface WalletConnectionSourceHTTP {
|
|
3
|
-
/**
|
|
4
|
-
* Base part of the wallet universal url. The link should support [Ton Connect parameters]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#universal-link}.
|
|
5
|
-
*/
|
|
6
|
-
universalLink: string;
|
|
7
|
-
/**
|
|
8
|
-
* Url of the wallet's implementation of the [HTTP bridge]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#http-bridge}.
|
|
9
|
-
*/
|
|
10
|
-
bridgeUrl: string;
|
|
11
|
-
}
|
|
12
|
-
export interface WalletConnectionSourceJS {
|
|
13
|
-
/**
|
|
14
|
-
* If the wallet handles JS Bridge connection, specifies the binding for the bridge object accessible through window. Example: the key "tonkeeper" means the bridge can be accessed as window.tonkeeper.
|
|
15
|
-
*/
|
|
16
|
-
jsBridgeKey: string;
|
|
17
|
-
}
|
|
18
|
-
export declare function isWalletConnectionSourceJS(value: WalletConnectionSource): value is WalletConnectionSourceJS;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export interface WalletInfoBase {
|
|
2
|
-
/**
|
|
3
|
-
* Name of the wallet.
|
|
4
|
-
*/
|
|
5
|
-
name: string;
|
|
6
|
-
/**
|
|
7
|
-
* Url to the icon of the wallet. Resolution 288×288px. On non-transparent background, without rounded corners. PNG format.
|
|
8
|
-
*/
|
|
9
|
-
imageUrl: string;
|
|
10
|
-
/**
|
|
11
|
-
* Will be used in the protocol later.
|
|
12
|
-
*/
|
|
13
|
-
tondns?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Info or landing page of your wallet. May be useful for TON newcomers.
|
|
16
|
-
*/
|
|
17
|
-
aboutUrl: string;
|
|
18
|
-
}
|
|
19
|
-
export interface WalletInfoRemote extends WalletInfoBase {
|
|
20
|
-
/**
|
|
21
|
-
* Base part of the wallet universal url. The link should support [Ton Connect parameters]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#universal-link}.
|
|
22
|
-
*/
|
|
23
|
-
universalLink: string;
|
|
24
|
-
/**
|
|
25
|
-
* Native wallet app deepLink. The link should support [Ton Connect parameters]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#universal-link}.
|
|
26
|
-
*/
|
|
27
|
-
deepLink: string;
|
|
28
|
-
/**
|
|
29
|
-
* Url of the wallet's implementation of the [HTTP bridge]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#http-bridge}.
|
|
30
|
-
*/
|
|
31
|
-
bridgeUrl: string;
|
|
32
|
-
}
|
|
33
|
-
export interface WalletInfoInjected extends WalletInfoBase {
|
|
34
|
-
/**
|
|
35
|
-
* If the wallet handles JS Bridge connection, specifies the binding for the bridge object accessible through window. Example: the key "tonkeeper" means the bridge can be accessed as window.tonkeeper.
|
|
36
|
-
*/
|
|
37
|
-
jsBridgeKey: string;
|
|
38
|
-
/**
|
|
39
|
-
* Indicates if the wallet currently is injected to the webpage.
|
|
40
|
-
*/
|
|
41
|
-
injected: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Indicates if the dapp is opened inside this wallet's browser.
|
|
44
|
-
*/
|
|
45
|
-
embedded: boolean;
|
|
46
|
-
}
|
|
47
|
-
export declare type WalletInfo = WalletInfoRemote | WalletInfoInjected | (WalletInfoRemote & WalletInfoInjected);
|
|
48
|
-
export interface WalletInfoDTO {
|
|
49
|
-
name: string;
|
|
50
|
-
image: string;
|
|
51
|
-
tondns?: string;
|
|
52
|
-
about_url: string;
|
|
53
|
-
universal_url: string;
|
|
54
|
-
deepLink: string;
|
|
55
|
-
bridge: (WalletInfoBridgeRemoteDTO | WalletInfoBridgeInjectedDTO)[];
|
|
56
|
-
}
|
|
57
|
-
export interface WalletInfoBridgeRemoteDTO {
|
|
58
|
-
type: 'sse';
|
|
59
|
-
url: string;
|
|
60
|
-
}
|
|
61
|
-
export interface WalletInfoBridgeInjectedDTO {
|
|
62
|
-
type: 'js';
|
|
63
|
-
key: string;
|
|
64
|
-
}
|
|
65
|
-
export declare function isWalletInfoInjected(value: WalletInfo): value is WalletInfoInjected;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DeviceInfo, TonProofItemReply } from '@tonconnect/protocol';
|
|
2
|
-
import { Account } from "..";
|
|
3
|
-
export interface Wallet {
|
|
4
|
-
/**
|
|
5
|
-
* Information about user's wallet's device.
|
|
6
|
-
*/
|
|
7
|
-
device: DeviceInfo;
|
|
8
|
-
/**
|
|
9
|
-
* Provider type: http bridge or injected js.
|
|
10
|
-
*/
|
|
11
|
-
provider: 'http' | 'injected';
|
|
12
|
-
/**
|
|
13
|
-
* Selected account.
|
|
14
|
-
*/
|
|
15
|
-
account: Account;
|
|
16
|
-
/**
|
|
17
|
-
* Response for connect items request.
|
|
18
|
-
*/
|
|
19
|
-
connectItems?: {
|
|
20
|
-
tonProof?: TonProofItemReply;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TonConnectError } from "../errors/ton-connect.error";
|
|
2
|
-
import { ConnectEventError } from '@tonconnect/protocol';
|
|
3
|
-
declare class ConnectErrorsParser {
|
|
4
|
-
parseError(error: ConnectEventError['payload']): TonConnectError;
|
|
5
|
-
}
|
|
6
|
-
export declare const connectErrorsParser: ConnectErrorsParser;
|
|
7
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AppRequest, RpcMethod, WalletResponse, WalletResponseError, WalletResponseSuccess } from '@tonconnect/protocol';
|
|
2
|
-
import { WithoutId } from "../utils/types";
|
|
3
|
-
export declare abstract class RpcParser<T extends RpcMethod> {
|
|
4
|
-
abstract convertToRpcRequest(...args: unknown[]): WithoutId<AppRequest<T>>;
|
|
5
|
-
abstract convertFromRpcResponse(rpcResponse: WithoutId<WalletResponseSuccess<T>>): unknown;
|
|
6
|
-
abstract parseAndThrowError(response: WithoutId<WalletResponseError<T>>): never;
|
|
7
|
-
isError(response: WithoutId<WalletResponse<T>>): response is WithoutId<WalletResponseError<T>>;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SendTransactionRpcRequest, SendTransactionRpcResponseError, SendTransactionRpcResponseSuccess } from '@tonconnect/protocol';
|
|
2
|
-
import { SendTransactionRequest, SendTransactionResponse } from "../models/methods";
|
|
3
|
-
import { RpcParser } from "./rpc-parser";
|
|
4
|
-
import { WithoutId } from "../utils/types";
|
|
5
|
-
declare class SendTransactionParser extends RpcParser<'sendTransaction'> {
|
|
6
|
-
convertToRpcRequest(request: Omit<SendTransactionRequest, 'validUntil'> & {
|
|
7
|
-
valid_until: number;
|
|
8
|
-
}): WithoutId<SendTransactionRpcRequest>;
|
|
9
|
-
parseAndThrowError(response: WithoutId<SendTransactionRpcResponseError>): never;
|
|
10
|
-
convertFromRpcResponse(rpcResponse: WithoutId<SendTransactionRpcResponseSuccess>): SendTransactionResponse;
|
|
11
|
-
}
|
|
12
|
-
export declare const sendTransactionParser: SendTransactionParser;
|
|
13
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BridgeIncomingMessage } from "./models/bridge-incomming-message";
|
|
2
|
-
import { IStorage } from "../../storage/models/storage.interface";
|
|
3
|
-
export declare class BridgeGateway {
|
|
4
|
-
private readonly bridgeUrl;
|
|
5
|
-
readonly sessionId: string;
|
|
6
|
-
private readonly listener;
|
|
7
|
-
private readonly errorsListener;
|
|
8
|
-
private readonly ssePath;
|
|
9
|
-
private readonly postPath;
|
|
10
|
-
private readonly heartbeatMessage;
|
|
11
|
-
private readonly defaultTtl;
|
|
12
|
-
private eventSource;
|
|
13
|
-
private isClosed;
|
|
14
|
-
private readonly bridgeGatewayStorage;
|
|
15
|
-
constructor(storage: IStorage, bridgeUrl: string, sessionId: string, listener: (msg: BridgeIncomingMessage) => void, errorsListener: (err: Event) => void);
|
|
16
|
-
registerSession(): Promise<void>;
|
|
17
|
-
send(message: Uint8Array, receiver: string, ttl?: number): Promise<void>;
|
|
18
|
-
close(): void;
|
|
19
|
-
private errorsHandler;
|
|
20
|
-
private messagesHandler;
|
|
21
|
-
}
|