@mysten/zksend
Advanced tools
Comparing version 0.0.0-experimental-20240113002234 to 0.0.0-experimental-20240113020050
# @mysten/zksend | ||
## 0.0.0-experimental-20240113002234 | ||
## 0.0.0-experimental-20240113020050 | ||
@@ -18,2 +18,3 @@ ### Minor Changes | ||
- c6b3066069: Improve zkSend error messages | ||
- ea2744b0c3: Add redirect parameter and fix listing assets on links without Sui | ||
- 44a1f9ea0b: Tweak types of events sent over the bridge | ||
@@ -26,4 +27,4 @@ - 7cc09a7bb4: Handle cases where list of objects to transfer is empty | ||
- Updated dependencies [9a14e61db4] | ||
- @mysten/sui.js@0.0.0-experimental-20240113002234 | ||
- @mysten/wallet-standard@0.0.0-experimental-20240113002234 | ||
- @mysten/sui.js@0.0.0-experimental-20240113020050 | ||
- @mysten/wallet-standard@0.0.0-experimental-20240113020050 | ||
@@ -30,0 +31,0 @@ ## 0.1.1 |
@@ -5,2 +5,6 @@ import { SuiClient } from '@mysten/sui.js/client'; | ||
import { TransactionBlock } from '@mysten/sui.js/transactions'; | ||
interface ZkSendLinkRedirect { | ||
url: string; | ||
name?: string; | ||
} | ||
export interface ZkSendLinkBuilderOptions { | ||
@@ -13,2 +17,3 @@ host?: string; | ||
sender: string; | ||
redirect: ZkSendLinkRedirect; | ||
} | ||
@@ -29,3 +34,3 @@ export interface ZkSendLinkOptions { | ||
#private; | ||
constructor({ host, path, keypair, client, sender, }: ZkSendLinkBuilderOptions); | ||
constructor({ host, path, keypair, client, sender, redirect, }: ZkSendLinkBuilderOptions); | ||
addClaimableMist(amount: bigint): void; | ||
@@ -32,0 +37,0 @@ addClaimableBalance(coinType: string, amount: bigint): void; |
@@ -51,3 +51,3 @@ "use strict"; | ||
var import_utils = require("@mysten/sui.js/utils"); | ||
var _host, _path, _keypair, _client, _objects, _balances, _sender, _coinsByType, _estimateClaimGasFee, estimateClaimGasFee_fn, _getCoinsByType, getCoinsByType_fn, _client2, _keypair2, _initiallyOwnedObjects, _ownedObjects, _gasCoin, _creatorAddress, _loadOwnedObjects, loadOwnedObjects_fn, _loadInitialTransactionData, loadInitialTransactionData_fn; | ||
var _host, _path, _keypair, _client, _redirect, _objects, _balances, _sender, _coinsByType, _estimateClaimGasFee, estimateClaimGasFee_fn, _getCoinsByType, getCoinsByType_fn, _client2, _keypair2, _initiallyOwnedObjects, _ownedObjects, _gasCoin, _creatorAddress, _loadOwnedObjects, loadOwnedObjects_fn, _loadInitialTransactionData, loadInitialTransactionData_fn; | ||
const DEFAULT_ZK_SEND_LINK_OPTIONS = { | ||
@@ -66,3 +66,4 @@ host: "https://zksend.com", | ||
client = DEFAULT_ZK_SEND_LINK_OPTIONS.client, | ||
sender | ||
sender, | ||
redirect | ||
}) { | ||
@@ -75,2 +76,3 @@ __privateAdd(this, _estimateClaimGasFee); | ||
__privateAdd(this, _client, void 0); | ||
__privateAdd(this, _redirect, void 0); | ||
__privateAdd(this, _objects, /* @__PURE__ */ new Set()); | ||
@@ -82,2 +84,3 @@ __privateAdd(this, _balances, /* @__PURE__ */ new Map()); | ||
__privateSet(this, _path, path); | ||
__privateSet(this, _redirect, redirect); | ||
__privateSet(this, _keypair, keypair); | ||
@@ -100,2 +103,8 @@ __privateSet(this, _client, client); | ||
link.hash = __privateGet(this, _keypair).export().privateKey; | ||
if (__privateGet(this, _redirect)) { | ||
link.searchParams.set("redirect_url", __privateGet(this, _redirect).url); | ||
if (__privateGet(this, _redirect).name) { | ||
link.searchParams.set("name", __privateGet(this, _redirect).name); | ||
} | ||
} | ||
return link.toString(); | ||
@@ -151,2 +160,3 @@ } | ||
_client = new WeakMap(); | ||
_redirect = new WeakMap(); | ||
_objects = new WeakMap(); | ||
@@ -225,2 +235,3 @@ _balances = new WeakMap(); | ||
const txb = this.createClaimTransaction(normalizedAddress, options); | ||
txb.setGasPayment([]); | ||
const dryRun = await __privateGet(this, _client2).dryRunTransactionBlock({ | ||
@@ -227,0 +238,0 @@ transactionBlock: await txb.build({ client: __privateGet(this, _client2) }) |
@@ -5,2 +5,6 @@ import { SuiClient } from '@mysten/sui.js/client'; | ||
import { TransactionBlock } from '@mysten/sui.js/transactions'; | ||
interface ZkSendLinkRedirect { | ||
url: string; | ||
name?: string; | ||
} | ||
export interface ZkSendLinkBuilderOptions { | ||
@@ -13,2 +17,3 @@ host?: string; | ||
sender: string; | ||
redirect: ZkSendLinkRedirect; | ||
} | ||
@@ -29,3 +34,3 @@ export interface ZkSendLinkOptions { | ||
#private; | ||
constructor({ host, path, keypair, client, sender, }: ZkSendLinkBuilderOptions); | ||
constructor({ host, path, keypair, client, sender, redirect, }: ZkSendLinkBuilderOptions); | ||
addClaimableMist(amount: bigint): void; | ||
@@ -32,0 +37,0 @@ addClaimableBalance(coinType: string, amount: bigint): void; |
@@ -23,3 +23,3 @@ var __accessCheck = (obj, member, msg) => { | ||
}; | ||
var _host, _path, _keypair, _client, _objects, _balances, _sender, _coinsByType, _estimateClaimGasFee, estimateClaimGasFee_fn, _getCoinsByType, getCoinsByType_fn, _client2, _keypair2, _initiallyOwnedObjects, _ownedObjects, _gasCoin, _creatorAddress, _loadOwnedObjects, loadOwnedObjects_fn, _loadInitialTransactionData, loadInitialTransactionData_fn; | ||
var _host, _path, _keypair, _client, _redirect, _objects, _balances, _sender, _coinsByType, _estimateClaimGasFee, estimateClaimGasFee_fn, _getCoinsByType, getCoinsByType_fn, _client2, _keypair2, _initiallyOwnedObjects, _ownedObjects, _gasCoin, _creatorAddress, _loadOwnedObjects, loadOwnedObjects_fn, _loadInitialTransactionData, loadInitialTransactionData_fn; | ||
import { getFullnodeUrl, SuiClient } from "@mysten/sui.js/client"; | ||
@@ -49,3 +49,4 @@ import { Ed25519Keypair } from "@mysten/sui.js/keypairs/ed25519"; | ||
client = DEFAULT_ZK_SEND_LINK_OPTIONS.client, | ||
sender | ||
sender, | ||
redirect | ||
}) { | ||
@@ -58,2 +59,3 @@ __privateAdd(this, _estimateClaimGasFee); | ||
__privateAdd(this, _client, void 0); | ||
__privateAdd(this, _redirect, void 0); | ||
__privateAdd(this, _objects, /* @__PURE__ */ new Set()); | ||
@@ -65,2 +67,3 @@ __privateAdd(this, _balances, /* @__PURE__ */ new Map()); | ||
__privateSet(this, _path, path); | ||
__privateSet(this, _redirect, redirect); | ||
__privateSet(this, _keypair, keypair); | ||
@@ -83,2 +86,8 @@ __privateSet(this, _client, client); | ||
link.hash = __privateGet(this, _keypair).export().privateKey; | ||
if (__privateGet(this, _redirect)) { | ||
link.searchParams.set("redirect_url", __privateGet(this, _redirect).url); | ||
if (__privateGet(this, _redirect).name) { | ||
link.searchParams.set("name", __privateGet(this, _redirect).name); | ||
} | ||
} | ||
return link.toString(); | ||
@@ -134,2 +143,3 @@ } | ||
_client = new WeakMap(); | ||
_redirect = new WeakMap(); | ||
_objects = new WeakMap(); | ||
@@ -208,2 +218,3 @@ _balances = new WeakMap(); | ||
const txb = this.createClaimTransaction(normalizedAddress, options); | ||
txb.setGasPayment([]); | ||
const dryRun = await __privateGet(this, _client2).dryRunTransactionBlock({ | ||
@@ -210,0 +221,0 @@ transactionBlock: await txb.build({ client: __privateGet(this, _client2) }) |
{ | ||
"name": "@mysten/zksend", | ||
"version": "0.0.0-experimental-20240113002234", | ||
"version": "0.0.0-experimental-20240113020050", | ||
"description": "TODO: Write Description", | ||
@@ -40,4 +40,4 @@ "license": "Apache-2.0", | ||
"valibot": "^0.25.0", | ||
"@mysten/sui.js": "0.0.0-experimental-20240113002234", | ||
"@mysten/wallet-standard": "0.0.0-experimental-20240113002234" | ||
"@mysten/sui.js": "0.0.0-experimental-20240113020050", | ||
"@mysten/wallet-standard": "0.0.0-experimental-20240113020050" | ||
}, | ||
@@ -44,0 +44,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
296732
2520
+ Added@mysten/sui.js@0.0.0-experimental-20240113020050(transitive)
+ Added@mysten/wallet-standard@0.0.0-experimental-20240113020050(transitive)
- Removed@mysten/sui.js@0.0.0-experimental-20240113002234(transitive)
- Removed@mysten/wallet-standard@0.0.0-experimental-20240113002234(transitive)
Updated@mysten/wallet-standard@0.0.0-experimental-20240113020050