Skip to content

Commit

Permalink
Add support for partner ids
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelwhisperer committed Oct 10, 2022
1 parent 89675a4 commit 03cbe11
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"dotenv": "10.0.0",
"emittery": "0.8.1",
"type-fest": "1.2.1",
"wido": "^0.0.24"
"wido": "^0.0.25"
},
"size-limit": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ export class SimulationInterface<T extends ChainId> extends ServiceInterface<T>
partnerId
);
} else if (zapInWith === "widoZapIn") {
zapInPromise = this.yearn.services.wido.zapIn(toVault, sellToken, amount, from, options.slippage);
zapInPromise = this.yearn.services.wido.zapIn(toVault, sellToken, amount, from, options.slippage, partnerId);
} else {
throw new Error("zapInWith not supported");
}
Expand Down
9 changes: 8 additions & 1 deletion src/interfaces/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,14 @@ export class VaultInterface<T extends ChainId> extends ServiceInterface<T> {
this.yearn.services.partner?.partnerId
);
} else if (zapInWith === "widoZapIn") {
zapInPromise = this.yearn.services.wido.zapIn(vaultAddr, token, amount, account, options.slippage);
zapInPromise = this.yearn.services.wido.zapIn(
vaultAddr,
token,
amount,
account,
options.slippage,
this.yearn.services.partner?.partnerId
);
} else {
throw new Error("zapInWith not supported");
}
Expand Down
6 changes: 5 additions & 1 deletion src/services/wido.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export class WidoService extends Service {
token: Address,
amount: Integer,
account: Address,
slippagePercentage: number
slippagePercentage: number,
partnerId?: string
): Promise<TransactionRequest> {
// unsupported networks
if (this.chainId === 1337) {
Expand All @@ -165,6 +166,9 @@ export class WidoService extends Service {
amount,
slippagePercentage,
user: account,
varsOverride: {
$yearn_partner_id: partnerId,
},
});

return { data, to, from, value };
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9639,10 +9639,10 @@ which@^2.0.1, which@^2.0.2:
dependencies:
isexe "^2.0.0"

wido@^0.0.24:
version "0.0.24"
resolved "https://registry.yarnpkg.com/wido/-/wido-0.0.24.tgz#0d081f41184965541a8f96668998325213bcba18"
integrity sha512-VspqM5Wfmp/L4KFE62y/LJEM7bbnqyYecrihy2CWpQTVxRJ2wun3eM3dggqDL5Oka/eZF4A8l716jOgcCMPGgw==
wido@^0.0.25:
version "0.0.25"
resolved "https://registry.yarnpkg.com/wido/-/wido-0.0.25.tgz#06757814bb019b806496272cc8af0023f00dbd07"
integrity sha512-jjGPKSz9z8GOdts/TbeJ3pOmr2Rx2x1TCSpYhGP8pqAVBZ0Oz54BibFsXb+HNZ1VcCFZ/s8H/8nw8aMRSIGSxA==
dependencies:
"@segment/analytics-next" "^1.42.3"
ethers "^5.6.9"
Expand Down

0 comments on commit 03cbe11

Please sign in to comment.